blog-hexo/public/js/0c01b885.js
2023-11-01 15:10:40 +08:00

1 line
3.1 KiB
JavaScript

(()=>{"use strict";const o="__theme__",r={light:{"--color-primary":"rgb(110, 121, 214)","--color-primary-2":"rgba(110, 121, 214, .1)","--color-primary-3":"rgba(110, 121, 214, .03)","--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-segment":"rgb(244, 245, 248)","--color-seg-selected":"#fff","--color-bg-button":"rgb(255, 255, 255)","--color-seg-border":"rgb(223, 225, 228)","--color-bg-mask":"rgba(255, 255, 255,.6)","--shadow-button":"rgba(0, 0, 0, 0.09) 0px 1px 4px","--border-button":"1px solid rgb(223, 225, 228)","--shadow-box":"rgb(0 0 0 / 23%) 0px 16px 70px","--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-primary-3":"rgba(110, 121, 214, .1)","--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-segment":"#1f2023","--color-seg-selected":"rgb(57 57 57)","--color-seg-border":"rgb(49, 50, 72)","--color-bg-mask":"rgba(0, 0, 0, .6)","--color-bg-button":"rgb(48, 50, 54)","--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(68, 65, 62)","--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)"}},b=o=>{for(const[r,b]of Object.entries(o))document.documentElement.style.setProperty(r,b)},l=()=>{const r=localStorage.getItem(o);return null!=r?r:"light"},t=l=>{const t=r[l];(r=>{localStorage.setItem(o,r)})(l),b(t)};document.addEventListener("DOMContentLoaded",(function(){const o=document.getElementById("toggle-theme");o&&(o.classList.add("light"===l()?"light":"dark"),o.addEventListener("click",(function(){"light"===l()?(o.classList.remove("light"),o.classList.add("dark"),t("dark")):(o.classList.add("light"),o.classList.remove("dark"),t("light"))})))}))})();