Files
CloudFlare-ImgBed/frontend-dist/js/331.096fa41f.js
T

2 lines
12 KiB
JavaScript

"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[331],{7835:function(e,t,a){e.exports=a.p+"img/background-light.f17603bc.jpg"},10732:function(e,t,a){e.exports=a.p+"img/background.de27f549.jpg"},16331:function(e,t,a){a.r(t),a.d(t,{default:function(){return C}});var n=a(80047),s=(a(85331),a(99648),a(56768));const i={class:"blocked-container"},o=["innerHTML"],r={class:"blocked-content"},l={class:"back-button-wrapper"},c={class:"status-animation"},u={class:"status-icon"},d={class:"status-badge"},g={class:"status-info"},m={class:"status-actions"},p={class:"help-info"},h={class:"quick-links"};function k(e,t,a,k,b,y){const f=(0,s.g2)("font-awesome-icon"),v=n.S2;return(0,s.uX)(),(0,s.CE)("div",i,[(0,s.Lk)("div",{class:"background-wrapper",innerHTML:e.backgroundImagesTemplate},null,8,o),(0,s.Lk)("div",r,[(0,s.Lk)("div",l,[(0,s.bF)(v,{class:"back-button",onClick:y.goHome,circle:"",size:"large"},{default:(0,s.k6)(()=>[(0,s.bF)(f,{icon:"home"})]),_:1},8,["onClick"])]),(0,s.Lk)("div",c,[(0,s.Lk)("div",u,[(0,s.bF)(f,{icon:"ban",class:"ban-icon"}),(0,s.Lk)("div",d,[(0,s.bF)(f,{icon:"exclamation",class:"exclamation-icon"})])])]),(0,s.Lk)("div",g,[t[9]||(t[9]=(0,s.Lk)("h1",{class:"status-title"},"图片访问被禁止",-1)),t[10]||(t[10]=(0,s.Lk)("p",{class:"status-description"}," 抱歉,当前图片已被禁止访问。 ",-1)),t[11]||(t[11]=(0,s.Lk)("p",{class:"status-description-en"}," Sorry, current image is prohibited from being accessed. ",-1)),(0,s.Lk)("div",m,[(0,s.bF)(v,{type:"primary",size:"large",class:"action-btn primary-btn",onClick:y.goHome},{default:(0,s.k6)(()=>[(0,s.bF)(f,{icon:"home",class:"btn-icon"}),t[3]||(t[3]=(0,s.eW)(" 返回首页 ",-1))]),_:1},8,["onClick"]),(0,s.bF)(v,{size:"large",class:"action-btn secondary-btn",onClick:y.goBack},{default:(0,s.k6)(()=>[(0,s.bF)(f,{icon:"arrow-left",class:"btn-icon"}),t[4]||(t[4]=(0,s.eW)(" 返回上页 ",-1))]),_:1},8,["onClick"])]),(0,s.Lk)("div",p,[t[8]||(t[8]=(0,s.Lk)("p",{class:"help-text"},"您可以尝试:",-1)),(0,s.Lk)("div",h,[(0,s.Lk)("a",{href:"javascript:void(0)",onClick:t[0]||(t[0]=(...e)=>y.goHome&&y.goHome(...e)),class:"quick-link"},[(0,s.bF)(f,{icon:"cloud-upload-alt"}),t[5]||(t[5]=(0,s.eW)(" 图片上传 ",-1))]),(0,s.Lk)("a",{href:"javascript:void(0)",onClick:t[1]||(t[1]=(...e)=>y.refreshPage&&y.refreshPage(...e)),class:"quick-link"},[(0,s.bF)(f,{icon:"redo"}),t[6]||(t[6]=(0,s.eW)(" 刷新页面 ",-1))]),(0,s.Lk)("a",{href:"javascript:void(0)",onClick:t[2]||(t[2]=(...e)=>y.contactSupport&&y.contactSupport(...e)),class:"quick-link"},[(0,s.bF)(f,{icon:"question-circle"}),t[7]||(t[7]=(0,s.eW)(" 联系支持 ",-1))])])]),t[12]||(t[12]=(0,s.Lk)("div",{class:"powered-by"},[(0,s.Lk)("p",null,[(0,s.eW)("Powered By: "),(0,s.Lk)("a",{href:"https://github.com/MarSeventh/CloudFlare-ImgBed",class:"project-link"}," CloudFlare-ImgBed ")])],-1))])]),t[13]||(t[13]=(0,s.Fv)('<div class="floating-elements" data-v-98114f90><div class="floating-shape shape-1" data-v-98114f90></div><div class="floating-shape shape-2" data-v-98114f90></div><div class="floating-shape shape-3" data-v-98114f90></div><div class="floating-shape shape-4" data-v-98114f90></div><div class="floating-shape shape-5" data-v-98114f90></div></div>',1))])}a(44114);var b=a(74354),y=a(60782),f=a(48903),v={name:"BlockedImage",mixins:[f.A],computed:{...(0,y.L8)(["useDarkMode","userConfig"])},setup(){(0,b.u)({title:"Blocked Image",meta:[{name:"robots",content:"noindex, nofollow"},{name:"viewport",content:"width=device-width, initial-scale=1"},{charset:"UTF-8"}]})},mounted(){this.initializeBackground("uploadBkImg",".blocked-container",!1,!0)},beforeUnmount(){this.clearBackgroundInterval()},methods:{goHome(){this.$router.push("/")},goBack(){window.history.length>1?this.$router.go(-1):this.$router.push("/")},refreshPage(){window.location.reload()},contactSupport(){window.open("https://github.com/MarSeventh/CloudFlare-ImgBed/issues","_blank")}}},I=a(71241);const B=(0,I.A)(v,[["render",k],["__scopeId","data-v-98114f90"]]);var C=B},48903:function(e,t,a){var n=a(60782);t.A={data(){return{bingWallPaperIndex:0,customWallPaperIndex:0,backgroundInterval:null,backgroundInitParams:null}},computed:{...(0,n.L8)(["userConfig","bingWallPapers","useDarkMode"]),bkInterval(){return this.userConfig?.bkInterval||3e3},bkOpacity(){return this.userConfig?.bkOpacity||1},backgroundImagesTemplate(){return'\n <img id="bg1" class="background-image1" alt="Background Image"/>\n <img id="bg2" class="background-image2" alt="Background Image"/>\n '},backgroundImagesStyles(){return"\n .background-image1 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: -1;\n pointer-events: none;\n opacity: 0;\n transition: opacity 1.2s ease-in-out, filter 0.3s ease, transform 4.2s ease-out;\n transform: scale(1);\n transform-origin: center center;\n will-change: opacity, transform;\n filter: var(--background-image-filter, brightness(1));\n }\n .background-image2 {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n z-index: -1;\n pointer-events: none;\n opacity: 0;\n transition: opacity 1.2s ease-in-out, filter 0.3s ease, transform 4.2s ease-out;\n transform: scale(1);\n transform-origin: center center;\n will-change: opacity, transform;\n filter: var(--background-image-filter, brightness(1));\n }\n "}},watch:{useDarkMode(e,t){e!==t&&this.backgroundInitParams&&this.$nextTick(()=>{this.smoothThemeTransition(this.backgroundInitParams.configKey,this.backgroundInitParams.containerSelector,this.backgroundInitParams.useDefaultBackground,this.backgroundInitParams.autoCreateElements)})}},mounted(){this.injectBackgroundStyles()},beforeUnmount(){this.backgroundInterval&&clearInterval(this.backgroundInterval),this.clearBackgroundImages(!0),this.removeBackgroundStyles()},methods:{injectBackgroundStyles(){const e="background-manager-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent=this.backgroundImagesStyles,document.head.appendChild(t)}},removeBackgroundStyles(){const e="background-manager-styles",t=document.getElementById(e);t&&t.remove()},createBackgroundElements(e){if(!e)return void console.warn("未提供有效的容器元素");if(document.getElementById("bg1")||document.getElementById("bg2"))return;const t=document.createElement("img");t.id="bg1",t.className="background-image1",t.alt="Background Image";const a=document.createElement("img");a.id="bg2",a.className="background-image2",a.alt="Background Image",e.insertBefore(t,e.firstChild),e.insertBefore(a,e.firstChild)},initializeBackground(e,t=".login",a=!1,n=!1){if(!1===this.userConfig?.wallpaperEnabled)return void this.clearBackgroundImages(!0);this.backgroundInitParams={configKey:e,containerSelector:t,useDefaultBackground:a,autoCreateElements:n};const s=document.querySelector(t);this.prepareBackgroundContainer(s),n&&(!s||document.getElementById("bg1")&&document.getElementById("bg2")||this.createBackgroundElements(s));const i=document.getElementById("bg1"),o=document.getElementById("bg2");if(!i||!o)return void console.warn("背景图元素 #bg1 或 #bg2 未找到,请确保页面中包含这些元素或启用 autoCreateElements");const r=this.userConfig?.[e];"bing"===r?this.setupBingWallpaper(i,o,t):Array.isArray(r)&&r.length>1?this.setupCustomWallpaperCarousel(i,o,r,t):Array.isArray(r)&&1===r.length?this.setupSingleCustomWallpaper(i,r[0],t):a&&this.setupDefaultWallpaper(i,t)},setupBingWallpaper(e,t,a){this.$store.dispatch("fetchBingWallPapers").then(()=>{0!==this.bingWallPapers.length&&(this.loadBackgroundImage(e,this.bingWallPapers[this.bingWallPaperIndex]?.url,a,!0),this.backgroundInterval=setInterval(()=>{this.switchBingWallpaper(e,t)},this.bkInterval))})},setupCustomWallpaperCarousel(e,t,a,n){this.loadBackgroundImage(e,a[this.customWallPaperIndex],n,!0),this.backgroundInterval=setInterval(()=>{this.switchCustomWallpaper(e,t,a)},this.bkInterval)},setupSingleCustomWallpaper(e,t,a){this.loadBackgroundImage(e,t,a)},setupDefaultWallpaper(e,t){const n=this.useDarkMode,s=a(n?10732:7835);this.loadBackgroundImage(e,s,t)},loadBackgroundImage(e,t,a,n=!1){e.style.zIndex=-1,e.style.opacity=0,this.prepareBackgroundMotion(e,n);const s=document.querySelector(a);this.prepareBackgroundContainer(s);const i=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.style.opacity=this.bkOpacity,n&&(e.style.transform="scale(1.045)")})})},o=new Image;o.onload=()=>{e.src=t,i()},o.onerror=()=>{e.src=t,i()},o.src=t},prepareBackgroundMotion(e,t=!1){if(!e)return;const a=Math.max(this.bkInterval+1200,4200);e.style.transition=t?`opacity 1.2s ease-in-out, filter 0.3s ease, transform ${a}ms ease-out`:"opacity 1.2s ease-in-out, filter 0.3s ease, transform 0.3s ease",e.style.transformOrigin="center center",e.style.transform="scale(1)"},prepareBackgroundContainer(e){if(!e)return;const t=window.getComputedStyle(e);"static"===t.position&&(e.style.position="relative"),"auto"===t.zIndex&&(e.style.zIndex="0"),e.style.isolation="isolate"},switchBingWallpaper(e,t){if(0===this.bingWallPapers.length)return;const a=0!=e.style.opacity,n=a?e:t,s=a?t:e;this.bingWallPaperIndex=(this.bingWallPaperIndex+1)%this.bingWallPapers.length;const i=this.bingWallPapers[this.bingWallPaperIndex]?.url;n.style.zIndex=-2,s.style.zIndex=-1,this.prepareBackgroundMotion(s,!0);const o=new Image;o.onload=()=>{s.src=i,setTimeout(()=>{s.style.opacity=this.bkOpacity,s.style.transform="scale(1.045)",setTimeout(()=>{n.style.opacity=0,this.prepareBackgroundMotion(n,!0)},1200)},50)},o.src=i},switchCustomWallpaper(e,t,a){const n=0!=e.style.opacity,s=n?e:t,i=n?t:e;this.customWallPaperIndex=(this.customWallPaperIndex+1)%a.length;const o=a[this.customWallPaperIndex];s.style.zIndex=-2,i.style.zIndex=-1,this.prepareBackgroundMotion(i,!0);const r=new Image;r.onload=()=>{i.src=o,setTimeout(()=>{i.style.opacity=this.bkOpacity,i.style.transform="scale(1.045)",setTimeout(()=>{s.style.opacity=0,this.prepareBackgroundMotion(s,!0)},1200)},50)},r.src=o},clearBackgroundInterval(){this.backgroundInterval&&(clearInterval(this.backgroundInterval),this.backgroundInterval=null)},clearBackgroundImages(e=!1){const t=document.getElementById("bg1"),a=document.getElementById("bg2");e?(t&&(t.style.transition="none",t.style.opacity=0,t.removeAttribute("src"),setTimeout(()=>{t&&(t.style.transition="opacity 1.2s ease-in-out, filter 0.3s ease, transform 0.3s ease")},50)),a&&(a.style.transition="none",a.style.opacity=0,a.removeAttribute("src"),setTimeout(()=>{a&&(a.style.transition="opacity 1.2s ease-in-out, filter 0.3s ease, transform 0.3s ease")},50))):(t&&(t.style.opacity=0,setTimeout(()=>{t&&t.removeAttribute("src")},1200)),a&&(a.style.opacity=0,setTimeout(()=>{a&&a.removeAttribute("src")},1200)))},smoothThemeTransition(e,t=".login",n=!1,s=!1){const i=this.userConfig?.[e];if(!n||void 0!==i)return void this.reinitializeBackground(e,t,n,s);const o=document.getElementById("bg1"),r=document.getElementById("bg2");if(!o||!r)return void this.reinitializeBackground(e,t,n,s);const l=0!=o.style.opacity?o:r,c=0!=o.style.opacity?r:o,u=this.useDarkMode,d=a(u?10732:7835),g=new Image;g.onload=()=>{c.src=d,c.onload=()=>{l.style.opacity=0,setTimeout(()=>{c.style.opacity=this.bkOpacity},50)}},g.onerror=()=>{console.warn("主题背景图预加载失败,回退到直接切换"),this.reinitializeBackground(e,t,n,s)},g.src=d},reinitializeBackground(e,t=".login",a=!1,n=!1){this.clearBackgroundInterval(),this.clearBackgroundImages(!0),this.bingWallPaperIndex=0,this.customWallPaperIndex=0,setTimeout(()=>{this.initializeBackground(e,t,a,n)},100)}}}}}]);
//# sourceMappingURL=331.096fa41f.js.map