mirror of
https://github.com/MarSeventh/CloudFlare-ImgBed.git
synced 2026-01-31 09:03:19 +08:00
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
"use strict";(self["webpackChunksanyue_imghub"]=self["webpackChunksanyue_imghub"]||[]).push([[917],{732:function(e,t,a){e.exports=a.p+"img/background.ea1b7ee7.jpg"},4917:function(e,t,a){a.r(t),a.d(t,{default:function(){return W}});var n=a(47),i=(a(5331),a(9648),a(6768));const s={class:"blocked-container"},o=["innerHTML"],c={class:"blocked-content"},r={class:"back-button-wrapper"},l={class:"status-animation"},d={class:"status-icon"},u={class:"status-badge"},g={class:"status-info"},p={class:"status-actions"},m={class:"help-info"},h={class:"quick-links"};function k(e,t,a,k,b,y){const v=(0,i.g2)("font-awesome-icon"),I=n.S2;return(0,i.uX)(),(0,i.CE)("div",s,[(0,i.Lk)("div",{class:"background-wrapper",innerHTML:e.backgroundImagesTemplate},null,8,o),(0,i.Lk)("div",c,[(0,i.Lk)("div",r,[(0,i.bF)(I,{class:"back-button",onClick:y.goHome,circle:"",size:"large"},{default:(0,i.k6)(()=>[(0,i.bF)(v,{icon:"home"})]),_:1},8,["onClick"])]),(0,i.Lk)("div",l,[(0,i.Lk)("div",d,[(0,i.bF)(v,{icon:"ban",class:"ban-icon"}),(0,i.Lk)("div",u,[(0,i.bF)(v,{icon:"exclamation",class:"exclamation-icon"})])])]),(0,i.Lk)("div",g,[t[9]||(t[9]=(0,i.Lk)("h1",{class:"status-title"},"图片访问被禁止",-1)),t[10]||(t[10]=(0,i.Lk)("p",{class:"status-description"}," 抱歉,当前图片已被禁止访问。 ",-1)),t[11]||(t[11]=(0,i.Lk)("p",{class:"status-description-en"}," Sorry, current image is prohibited from being accessed. ",-1)),(0,i.Lk)("div",p,[(0,i.bF)(I,{type:"primary",size:"large",class:"action-btn primary-btn",onClick:y.goHome},{default:(0,i.k6)(()=>[(0,i.bF)(v,{icon:"home",class:"btn-icon"}),t[3]||(t[3]=(0,i.eW)(" 返回首页 ",-1))]),_:1},8,["onClick"]),(0,i.bF)(I,{size:"large",class:"action-btn secondary-btn",onClick:y.goBack},{default:(0,i.k6)(()=>[(0,i.bF)(v,{icon:"arrow-left",class:"btn-icon"}),t[4]||(t[4]=(0,i.eW)(" 返回上页 ",-1))]),_:1},8,["onClick"])]),(0,i.Lk)("div",m,[t[8]||(t[8]=(0,i.Lk)("p",{class:"help-text"},"您可以尝试:",-1)),(0,i.Lk)("div",h,[(0,i.Lk)("a",{href:"javascript:void(0)",onClick:t[0]||(t[0]=(...e)=>y.goHome&&y.goHome(...e)),class:"quick-link"},[(0,i.bF)(v,{icon:"cloud-upload-alt"}),t[5]||(t[5]=(0,i.eW)(" 图片上传 ",-1))]),(0,i.Lk)("a",{href:"javascript:void(0)",onClick:t[1]||(t[1]=(...e)=>y.refreshPage&&y.refreshPage(...e)),class:"quick-link"},[(0,i.bF)(v,{icon:"redo"}),t[6]||(t[6]=(0,i.eW)(" 刷新页面 ",-1))]),(0,i.Lk)("a",{href:"javascript:void(0)",onClick:t[2]||(t[2]=(...e)=>y.contactSupport&&y.contactSupport(...e)),class:"quick-link"},[(0,i.bF)(v,{icon:"question-circle"}),t[7]||(t[7]=(0,i.eW)(" 联系支持 ",-1))])])]),t[12]||(t[12]=(0,i.Lk)("div",{class:"powered-by"},[(0,i.Lk)("p",null,[(0,i.eW)("Powered By: "),(0,i.Lk)("a",{href:"https://github.com/MarSeventh/CloudFlare-ImgBed",class:"project-link"}," CloudFlare-ImgBed ")])],-1))])]),t[13]||(t[13]=(0,i.Fv)('<div class="floating-elements" data-v-76cc7d3a><div class="floating-shape shape-1" data-v-76cc7d3a></div><div class="floating-shape shape-2" data-v-76cc7d3a></div><div class="floating-shape shape-3" data-v-76cc7d3a></div><div class="floating-shape shape-4" data-v-76cc7d3a></div><div class="floating-shape shape-5" data-v-76cc7d3a></div></div>',1))])}a(4114);var b=a(4354),y=a(8401),v=a(8903),I={name:"BlockedImage",mixins:[v.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")}}},f=a(1241);const B=(0,f.A)(I,[["render",k],["__scopeId","data-v-76cc7d3a"]]);var W=B},7835:function(e,t,a){e.exports=a.p+"img/background-light.f17603bc.jpg"},8903:function(e,t,a){var n=a(8401);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 opacity: 0;\n transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;\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 opacity: 0;\n transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;\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(this.backgroundInitParams={configKey:e,containerSelector:t,useDefaultBackground:a,autoCreateElements:n},n){const e=document.querySelector(t);!e||document.getElementById("bg1")&&document.getElementById("bg2")||this.createBackgroundElements(e)}const i=document.getElementById("bg1"),s=document.getElementById("bg2");if(!i||!s)return void console.warn("背景图元素 #bg1 或 #bg2 未找到,请确保页面中包含这些元素或启用 autoCreateElements");const o=this.userConfig?.[e];"bing"===o?this.setupBingWallpaper(i,s,t):Array.isArray(o)&&o.length>1?this.setupCustomWallpaperCarousel(i,s,o,t):Array.isArray(o)&&1===o.length?this.setupSingleCustomWallpaper(i,o[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),this.backgroundInterval=setInterval(()=>{this.switchBingWallpaper(e,t)},this.bkInterval))})},setupCustomWallpaperCarousel(e,t,a,n){this.loadBackgroundImage(e,a[this.customWallPaperIndex],n),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,i=a(n?732:7835);this.loadBackgroundImage(e,i,t)},loadBackgroundImage(e,t,a){e.src=t,e.onload=()=>{e.style.opacity=this.bkOpacity;const t=document.querySelector(a);t&&(t.style.background="transparent")}},switchBingWallpaper(e,t){if(0===this.bingWallPapers.length)return;const a=0!=e.style.opacity?e:t,n=0!=e.style.opacity?t:e;a.style.opacity=0,this.bingWallPaperIndex=(this.bingWallPaperIndex+1)%this.bingWallPapers.length,n.src=this.bingWallPapers[this.bingWallPaperIndex]?.url,n.onload=()=>{n.style.opacity=this.bkOpacity}},switchCustomWallpaper(e,t,a){const n=0!=e.style.opacity?e:t,i=0!=e.style.opacity?t:e;n.style.opacity=0,this.customWallPaperIndex=(this.customWallPaperIndex+1)%a.length,i.src=a[this.customWallPaperIndex],i.onload=()=>{i.style.opacity=this.bkOpacity}},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.src="",setTimeout(()=>{t&&(t.style.transition="opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1)")},50)),a&&(a.style.transition="none",a.style.opacity=0,a.src="",setTimeout(()=>{a&&(a.style.transition="opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1)")},50))):(t&&(t.style.opacity=0,setTimeout(()=>{t&&(t.src="")},800)),a&&(a.style.opacity=0,setTimeout(()=>{a&&(a.src="")},800)))},smoothThemeTransition(e,t=".login",n=!1,i=!1){const s=this.userConfig?.[e];if(!n||void 0!==s)return void this.reinitializeBackground(e,t,n,i);const o=document.getElementById("bg1"),c=document.getElementById("bg2");if(!o||!c)return void this.reinitializeBackground(e,t,n,i);const r=0!=o.style.opacity?o:c,l=0!=o.style.opacity?c:o,d=this.useDarkMode,u=a(d?732:7835),g=new Image;g.onload=()=>{l.src=u,l.onload=()=>{r.style.opacity=0,setTimeout(()=>{l.style.opacity=this.bkOpacity;const e=document.querySelector(t);e&&(e.style.background="transparent")},50)}},g.onerror=()=>{console.warn("主题背景图预加载失败,回退到直接切换"),this.reinitializeBackground(e,t,n,i)},g.src=u},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=917.49df25ec.js.map
|