diff --git a/scripts/main_page.js b/scripts/main_page.js index 01b31e4..02462d7 100644 --- a/scripts/main_page.js +++ b/scripts/main_page.js @@ -5,6 +5,27 @@ if (lang == null) { if (lang != "en" && lang != "de") { lang = "en"; } + +const toggle = document.getElementById("themeToggle"); + +toggle.addEventListener("change", () => { + document.documentElement.classList.toggle("dark", toggle.checked); + if (toggle.checked) { + setCookie("theme", "dark", 60 * 60 * 24 * 7); + } + else { + setCookie("theme", "light", 60 * 60 * 24 * 7); + } + +}); + +const theme = getCookie("theme"); + +if (theme === "dark") { + document.documentElement.classList.add("dark"); + toggle.checked = true; +} + history.scrollRestoration = "manual"; function saveScroll() { @@ -288,23 +309,3 @@ function getCookie(name) { return null; } - -const toggle = document.getElementById("themeToggle"); - -toggle.addEventListener("change", () => { - document.documentElement.classList.toggle("dark", toggle.checked); - if (toggle.checked) { - setCookie("theme", "dark", 60 * 60 * 24 * 7); - } - else { - setCookie("theme", "light", 60 * 60 * 24 * 7); - } - -}); - -const theme = getCookie("theme"); - -if (theme === "dark") { - document.documentElement.classList.add("dark"); - toggle.checked = true; -} \ No newline at end of file diff --git a/styles/main_style.css b/styles/main_style.css index 443cd15..2c54c9f 100644 --- a/styles/main_style.css +++ b/styles/main_style.css @@ -18,7 +18,7 @@ --text: #FFFFFF; --surface: #3e3261; --muted: #C5C1D1; - --border: #20192a; + --border: #726684; } html { @@ -264,7 +264,6 @@ option { margin-top: auto; display: flex; flex-direction: column; - align-items: center; } #sidebar-bottom {