Use relative dirs
This commit is contained in:
parent
a88746075a
commit
7ec52b4cda
1 changed files with 6 additions and 7 deletions
13
js/theme.js
13
js/theme.js
|
|
@ -22,15 +22,15 @@ const toggle = () => {
|
||||||
if (mode == "dark") {
|
if (mode == "dark") {
|
||||||
window.localStorage.setItem("theme", "moonlight");
|
window.localStorage.setItem("theme", "moonlight");
|
||||||
mode = "moonlight";
|
mode = "moonlight";
|
||||||
css.href = "/css/themes/moonlight.css";
|
css.href = "../css/themes/moonlight.css";
|
||||||
} else if (mode == "moonlight") {
|
} else if (mode == "moonlight") {
|
||||||
window.localStorage.setItem("theme", "light");
|
window.localStorage.setItem("theme", "light");
|
||||||
mode = "light";
|
mode = "light";
|
||||||
css.href = "/css/themes/light.css";
|
css.href = "../css/themes/light.css";
|
||||||
} else {
|
} else {
|
||||||
window.localStorage.setItem("theme", "dark");
|
window.localStorage.setItem("theme", "dark");
|
||||||
mode = "dark";
|
mode = "dark";
|
||||||
css.href = "/css/themes/dark.css";
|
css.href = "../css/themes/dark.css";
|
||||||
}
|
}
|
||||||
updateIcon();
|
updateIcon();
|
||||||
};
|
};
|
||||||
|
|
@ -54,12 +54,11 @@ window.addEventListener("DOMContentLoaded", (evt) => {
|
||||||
mode = window.localStorage.getItem("theme");
|
mode = window.localStorage.getItem("theme");
|
||||||
|
|
||||||
if (mode == "dark") {
|
if (mode == "dark") {
|
||||||
css.href = "/css/themes/dark.css";
|
css.href = "../css/themes/dark.css";
|
||||||
} else if (mode == "moonlight") {
|
} else if (mode == "moonlight") {
|
||||||
css.href = "/css/themes/moonlight.css";
|
css.href = "../css/themes/moonlight.css";
|
||||||
} else {
|
} else {
|
||||||
css.href = "/css/themes/light.css";
|
css.href = "../css/themes/light.css";
|
||||||
}
|
}
|
||||||
|
|
||||||
updateIcon();
|
updateIcon();
|
||||||
});
|
});
|
||||||
Loading…
Reference in a new issue