diff --git a/static/main/js/lightmode.js b/static/main/js/lightmode.js index ac84052..11e5a52 100644 --- a/static/main/js/lightmode.js +++ b/static/main/js/lightmode.js @@ -1,11 +1,10 @@ let lightmode = localStorage.getItem("lightmode") const HTML = document.documentElement +const AUDIO = document.getElementById("flashbang") const ENABLE_LIGHT_MODE = () => { - const AUDIO = document.getElementById("flashbang") HTML.setAttribute("data-color-mode", "light") localStorage.setItem("lightmode", "enabled") - AUDIO.play() } const DISABLE_LIGHT_MODE = () => { @@ -21,6 +20,7 @@ document.querySelector("#color-mode-toggle").addEventListener("click", () => { lightmode = localStorage.getItem("lightmode") if (lightmode !== "enabled") { ENABLE_LIGHT_MODE() + AUDIO.play() } else { DISABLE_LIGHT_MODE() }