blog-hexo/public/js/1247bc3e.js

1 line
2.7 KiB
JavaScript
Raw Normal View History

2023-10-19 22:37:02 +08:00
(()=>{"use strict";const o="__theme__",r={light:{"--color-primary":"rgb(110, 121, 214)","--color-primary-2":"rgba(110, 121, 214, .1)","--color-font":"rgb(40, 42, 48)","--color-font-2":"rgb(107, 111, 118)","--color-font-3":"rgb(160, 160, 160)","--color-menu-hover":"#f4f2f4","--color-tiny-hover":"rgb(251, 251, 252)","--color-border":"rgb(237, 240, 243)","--color-border-2":"rgba(237, 240, 243, .5)","--color-article-selection":"rgba(33, 96, 219, 0.4)","--color-selection":"rgba(106, 111, 117, 0.2)","--color-bg":"#fff","--color-bg-2":"#fafafa","--color-bg-3":"rgb(239, 239, 239)","--color-bg-4":"rgba(223, 225, 228,.6)","--color-bg-mask":"rgba(255, 255, 255,.6)","--shadow-button":"rgba(0, 0, 0, 0.09) 0px 1px 4px","--shadow-box":"rgb(0 0 0 / 23%) 0px 16px 70px","--border-button":"1px solid rgb(223, 225, 228)","--scrollbar-width":"12px","--scrollbar-min-size":"32px","--scrollbar-color":"rgba(143, 149, 156, 0.3)","--dropdown-bdf":"blur(12px) saturate(190%) contrast(50%) brightness(130%)","--dropdown-bg":"rgba(255, 255, 255, 0.5)","--dropdown-boxShadow":"rgba(0, 0, 0, 0.09) 0px 3px 12px","--dropdown-border":"1px solid rgb(233, 233, 233)"},dark:{"--color-primary":"rgb(90, 79, 182)","--color-primary-2":"rgba(90, 79, 182, .7)","--color-font":"rgb(215, 213, 207)","--color-font-2":"rgb(148, 155, 167)","--color-font-3":"rgb(107, 111, 118)","--color-menu-hover":"rgb(45, 47, 54)","--color-tiny-hover":"rgb(30, 30, 33)","--color-border":"rgb(68, 65, 62)","--color-border-2":"rgba(68, 65, 62, .7)","--color-article-selection":"rgba(72, 160, 255, 0.6)","--color-selection":"rgba(90, 95, 107, 0.8)","--color-bg":"#1f2023","--color-bg-2":"#27282b","--color-bg-3":"rgb(48, 50, 54)","--color-bg-4":"rgba(48, 50, 54,.6)","--color-bg-mask":"rgba(0, 0, 0, .2)","--shadow-button":"rgba(255, 255, 255, 0.05) 0px -1px 4px","--shadow-box":"rgb(0 0 0 / 77%) 0px -16px 70px","--border-button":"1px solid rgb(32, 35, 40)","--scrollbar-width":"12px","--scrollbar-min-size":"32px","--scrollbar-color":"rgba(112, 116, 121, 0.7)","--dropdown-bdf":"blur(10px) saturate(190%) contrast(70%) brightness(80%)","--dropdown-bg":"rgba(29, 30, 43, 0.498)","--dropdown-boxShadow":"rgba(0, 0, 0, 0.2) 0px 4px 24px","--dropdown-border":"1px solid rgba(82, 82, 111, 0.44)"}},t=o=>{for(const[r,t]of Object.entries(o))document.documentElement.style.setProperty(r,t)},b=()=>{const r=localStorage.getItem(o);return null!=r?r:"light"},l=b=>{const l=r[b];(r=>{localStorage.setItem(o,r)})(b),t(l)};document.addEventListener("DOMContentLoaded",(function(){const o=document.getElementById("toggle-theme");o&&(o.classList.add("light"===b()?"light":"dark"),o.addEventListener("click",(function(){"light"===b()?(o.classList.remove("light"),o.classList.add("dark"),l("dark")):(o.classList.add("light"),o.classList.remove("dark"),l("light"))})))}))})();