diff --git a/assets/scss/style.scss b/assets/scss/style.scss index 039f738..0903d39 100644 --- a/assets/scss/style.scss +++ b/assets/scss/style.scss @@ -39,7 +39,7 @@ input[type="checkbox"]{ display: flex; align-items: center; justify-content: center; - content: "滛"; + content: ""; border-style: solid; } @@ -50,7 +50,7 @@ input:checked + label:after{ input:checked + label::after{ - content: ""; + content: "滛"; } .footer-nav-item{ diff --git a/static/js/darkmode.js b/static/js/darkmode.js index 466a466..89d8e86 100644 --- a/static/js/darkmode.js +++ b/static/js/darkmode.js @@ -1,20 +1,20 @@ const checkbox = document.getElementById("darkmode-toggle"); const colorswitchers = document.getElementsByClassName("colorswitch"); -if (localStorage.getItem("dark")) { - switchToDark(); -} else { +if (localStorage.getItem("light")) { switchToLight(); +} else { + switchToDark(); } checkbox.checked = localStorage.getItem("dark"); checkbox.addEventListener("change", function () { - localStorage.setItem("dark", this.checked); + localStorage.setItem("light", this.checked); if (this.checked) { - switchToDark(); - } else { - localStorage.removeItem("dark"); switchToLight(); + } else { + localStorage.removeItem("light"); + switchToDark(); } });