general cleanup
Some checks failed
Build and publish the docker image / build (push) Failing after 1m8s
Some checks failed
Build and publish the docker image / build (push) Failing after 1m8s
Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
@ -75,35 +75,3 @@ function getAnnotation(e) {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
window._currentTheme = localStorage.getItem("_theme") || (window.matchMedia("(prefers-color-scheme:dark)").matches ? "dark" : "light");
|
||||
setTheme(window._currentTheme);
|
||||
|
||||
const themeChooser = document.getElementById("choose-theme");
|
||||
themeChooser.addEventListener("click", function () {
|
||||
if (window._currentTheme === "dark") {
|
||||
setTheme("light");
|
||||
} else {
|
||||
setTheme("dark");
|
||||
}
|
||||
});
|
||||
|
||||
function setTheme(theme) {
|
||||
const toggler = document.getElementById(
|
||||
"ic_fluent_dark_theme_24_regular"
|
||||
);
|
||||
switch (theme) {
|
||||
case "dark":
|
||||
toggler.setAttribute("fill", "#fff");
|
||||
localStorage.setItem("_theme", "dark");
|
||||
document.body.classList.add("dark");
|
||||
window._currentTheme = "dark";
|
||||
return;
|
||||
case "light":
|
||||
toggler.setAttribute("fill", "#181d31");
|
||||
localStorage.setItem("_theme", "light");
|
||||
document.body.classList.remove("dark");
|
||||
window._currentTheme = "light";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user