관리-도구
편집 파일: switcher.min.js
"use strict";var html=document.documentElement;const switchRadioLight=document.getElementById("radioThemeLight"),switchRadioDark=document.getElementById("radioThemeDark"),switchRadioSquare=document.getElementById("radioThemeCardSquare"),switchRadioRound=document.getElementById("radioThemeCardRound"),switchRadioFluid=document.getElementById("radioThemeWidthFluid"),switchRadioBox=document.getElementById("radioThemeWidthBox");let themeMode,cardStyle,themeWidth;function toggleThemeMode(){themeMode="light"===themeMode?"dark":"light",html.setAttribute("data-theme-mode",themeMode),html.classList.remove("light","dark"),html.classList.add(themeMode),localStorage.setItem("theme-mode",themeMode),checker()}function toggleCardStyle(){cardStyle="square"===cardStyle?"round":"square",html.setAttribute("data-card-style",cardStyle),localStorage.setItem("card-style",cardStyle),checker()}function settingThemeWidth(){themeWidth="fluid"===themeWidth?"box":"fluid",html.setAttribute("data-theme-width",themeWidth),localStorage.setItem("theme-width",themeWidth),checker()}function checker(){switchRadioLight&&switchRadioDark&&(switchRadioLight.checked="light"==themeMode,switchRadioDark.checked="dark"==themeMode),switchRadioSquare&&switchRadioRound&&(switchRadioSquare.checked="square"==cardStyle,switchRadioRound.checked="round"==cardStyle),switchRadioFluid&&switchRadioBox&&(switchRadioFluid.checked="fluid"==themeWidth,switchRadioBox.checked="box"==themeWidth)}function resetThemeConfig(){localStorage.getItem("theme-mode")&&localStorage.removeItem("theme-mode"),localStorage.getItem("card-style")&&localStorage.removeItem("card-style"),localStorage.getItem("theme-width")&&localStorage.removeItem("theme-width"),location.reload()}themeMode="light",localStorage.getItem("theme-mode")?(themeMode=localStorage.getItem("theme-mode"),html.setAttribute("data-theme-mode",themeMode)):html.hasAttribute("data-theme-mode")&&(themeMode=html.getAttribute("data-theme-mode")),html.classList.add(themeMode),cardStyle="round",localStorage.getItem("card-style")?(cardStyle=localStorage.getItem("card-style"),html.setAttribute("data-card-style",cardStyle)):html.hasAttribute("data-card-style")&&(cardStyle=html.getAttribute("data-card-style")),themeWidth="fluid",localStorage.getItem("theme-width")?(themeWidth=localStorage.getItem("theme-width"),html.setAttribute("data-theme-width",themeWidth)):html.hasAttribute("data-theme-width")&&(themeWidth=html.getAttribute("data-theme-width")),checker();