diff --git a/site/scripts/main.js b/site/scripts/main.js index 703b7ed..aaacfad 100644 --- a/site/scripts/main.js +++ b/site/scripts/main.js @@ -15,6 +15,7 @@ window.addEventListener("DOMContentLoaded", () => { /* Functions */ const changeToDarkTheme = () => { + window.localStorage.setItem("theme", "dark"); document.documentElement.classList.add("dark"); themeBtn?.setAttribute("title", "turn the light on"); Array.from(imgs).forEach((img) => { @@ -23,6 +24,7 @@ window.addEventListener("DOMContentLoaded", () => { } const changeToLightTheme = () => { + window.localStorage.setItem("theme", "light"); document.documentElement.classList.remove("dark"); themeBtn?.setAttribute("title", "turn the light off"); Array.from(imgs).forEach((img) => {