changed javascript loading order

This commit is contained in:
2026-04-28 01:05:44 +02:00
parent d8ed423df2
commit c163bb78d7
2 changed files with 22 additions and 22 deletions
+21 -20
View File
@@ -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;
}
+1 -2
View File
@@ -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 {