halo-theme-butterfly
Version:
一个Halo博客主题,Butterfly
1 lines • 3.54 kB
JavaScript
(()=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},n(e)}function e(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,o(r.key),r)}}function t(n,e,t){return(e=o(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function o(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var r=o.call(e,t||"default");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var r=new(function(){return n=function n(){!function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),t(this,"cssText",'\n .loading-container {\n display: flex;\n justify-content: center;\n align-items: center;\n width:100vw;\n height:100vh;\n }\n .loading-body {\n position: relative;\n width: 2.5em;\n height: 2.5em;\n transform: rotate(165deg);\n }\n\n .loading-body:before, .loading-body:after {\n content: "";\n position: absolute;\n top: 50%;\n left: 50%;\n display: block;\n width: 0.5em;\n height: 0.5em;\n border-radius: 0.25em;\n transform: translate(-50%, -50%);\n }\n \n .loading-body:before {\n animation: before8 2s infinite;\n }\n\n .loading-body:after {\n animation: after6 2s infinite;\n }\n \n @keyframes before8 {\n 0% {\n width: 0.5em;\n box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);\n }\n \n 35% {\n width: 2.5em;\n box-shadow: 0 -0.5em rgba(225, 20, 98, 0.75), 0 0.5em rgba(111, 202, 220, 0.75);\n }\n \n 70% {\n width: 0.5em;\n box-shadow: -1em -0.5em rgba(225, 20, 98, 0.75), 1em 0.5em rgba(111, 202, 220, 0.75);\n }\n \n 100% {\n box-shadow: 1em -0.5em rgba(225, 20, 98, 0.75), -1em 0.5em rgba(111, 202, 220, 0.75);\n }\n }\n \n @keyframes after6 {\n 0% {\n height: 0.5em;\n box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);\n }\n \n 35% {\n height: 2.5em;\n box-shadow: 0.5em 0 rgba(61, 184, 143, 0.75), -0.5em 0 rgba(233, 169, 32, 0.75);\n }\n \n 70% {\n height: 0.5em;\n box-shadow: 0.5em -1em rgba(61, 184, 143, 0.75), -0.5em 1em rgba(233, 169, 32, 0.75);\n }\n \n 100% {\n box-shadow: 0.5em 1em rgba(61, 184, 143, 0.75), -0.5em -1em rgba(233, 169, 32, 0.75);\n }\n }'),t(this,"style",document.createElement("style")),t(this,"container",document.createElement("div")),this.style.textContent=this.cssText,document.head.appendChild(this.style)},(o=[{key:"start",value:function(){this.container.className="loading-container",this.container.innerHTML='<div class="loading-body"></div>',document.body.appendChild(this.container)}},{key:"destroy",value:function(){document.body.classList.remove("loading"),this.container.remove(),this.style.remove()}}])&&e(n.prototype,o),r&&e(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,r}());r.start(),window.addEventListener("load",(function(){return r.destroy()}))})();