mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2025-08-11 16:20:15 -04:00
small js change
This commit is contained in:
parent
17fd82358d
commit
5737f8613c
1 changed files with 3 additions and 1 deletions
|
@ -43,7 +43,9 @@ function scrollToTop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function themeToggle() {
|
function themeToggle() {
|
||||||
document.getElementById("theme-toggle").addEventListener("click", () => {
|
var themeButton = document.getElementById("theme-toggle");
|
||||||
|
|
||||||
|
themeButton.addEventListener("click", () => {
|
||||||
if (document.body.className.includes("dark")) {
|
if (document.body.className.includes("dark")) {
|
||||||
document.body.classList.remove('dark');
|
document.body.classList.remove('dark');
|
||||||
localStorage.setItem("pref-theme", 'light');
|
localStorage.setItem("pref-theme", 'light');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue