From 28fbb2a85e15525292a3651f6f9d23d786de6f37 Mon Sep 17 00:00:00 2001 From: adam <56338480+adastx@users.noreply.github.com> Date: Tue, 30 Aug 2022 18:41:42 +0200 Subject: Removed generated html from repo --- dst/scripts/darktheme.js | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 dst/scripts/darktheme.js (limited to 'dst/scripts') diff --git a/dst/scripts/darktheme.js b/dst/scripts/darktheme.js deleted file mode 100644 index b44db9a..0000000 --- a/dst/scripts/darktheme.js +++ /dev/null @@ -1,27 +0,0 @@ -const themeButton = document.getElementById('darkmodetoggle'); -const theme = localStorage.getItem("theme"); -var isDark = false; - -if (theme) { - setTheme(theme === "dark"); -} else if (window.matchMedia - && window.matchMedia("(prefers-color-scheme: dark)").matches) { - setTheme(true); -} - -function setTheme(dark) { - if (dark) { - document.body.classList.add("dark-mode"); - themeButton.className = "fa fa-sun-o"; - localStorage.setItem("theme", "dark"); - } else { - document.body.classList.remove("dark-mode"); - themeButton.className = "fa fa-moon-o"; - localStorage.setItem("theme", "light"); - } - isDark = dark; -} - -function switchTheme() { - setTheme(!isDark); -} -- cgit v1.2.3-70-g09d2