Bilibili-Evolved/min/dark-styles.min.js
2020-03-28 15:24:30 +08:00

1 line
718 B
JavaScript

(()=>{return(e,t)=>{const r=()=>{SpinQuery.select(".custom-scrollbar").then(e=>e&&e.classList.remove("custom-scrollbar"))};const l=()=>{document.body.classList.remove("dark");t.removeStyle("scrollbarStyle");t.removeStyle("darkStyleNavBar");t.removeStyle("darkStyle");t.removeStyle("darkStyleImportant")};const a=()=>{if(e.noDarkOnMember&&document.URL.startsWith("https://member.bilibili.com/v2")){l();return}document.body.classList.add("dark");r();if(!e.useDarkStyleAsUserStyle){t.applyStyle("scrollbarStyle");t.applyImportantStyle("darkStyleNavBar");t.applyStyle("darkStyle");t.applyImportantStyle("darkStyleImportant")}};a();addSettingsListener("useDarkStyleAsUserStyle",e=>{l();a()});return{reload:a,unload:l}}})();