diff options
| author | verdant <im@verdant.ee> | 2026-05-31 16:33:36 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-05-31 16:33:36 +0800 |
| commit | 172adfb014596423d7cc3043f2a288ac01884cba (patch) | |
| tree | f788b0b10f330daf8c3a6d1a8ed656a1d1253390 /static/js/color-scheme-switcher.js | |
| parent | f9869a2cf060976c69aeade3d3f231bf1fbdddd3 (diff) | |
| download | blog-172adfb014596423d7cc3043f2a288ac01884cba.tar.gz blog-172adfb014596423d7cc3043f2a288ac01884cba.zip | |
Add minify configuration, modify favicon url
Diffstat (limited to 'static/js/color-scheme-switcher.js')
| -rw-r--r-- | static/js/color-scheme-switcher.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/static/js/color-scheme-switcher.js b/static/js/color-scheme-switcher.js deleted file mode 100644 index 9166e29..0000000 --- a/static/js/color-scheme-switcher.js +++ /dev/null @@ -1,27 +0,0 @@ -console.log("Loaded") -const modes = { - Dark = "dark", - Light = "light", -} - -function getCurrentMode() { - return localStorage.getItem("theme"); -} - -const toggleColorSchemeBtn = document.getElementById("toggle-theme-btn"); -const body = document.body; -const currentMode = getCurrentMode() -if (currentMode === modes.Light) { - body.classList.toggle("dark-mode"); - -} - -toggleColorSchemeBtn.addEventListener("click", () => { - body.classList.toggle("dark-mode"); - - if (body.classList.contains("dark-mode")) { - localStorage.setItem("theme", modes.Dark); - } else { - localStorage.setItem("theme", modes.Light); - } -}) |
