aboutsummaryrefslogtreecommitdiff
path: root/src/scripts/darktheme.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts/darktheme.js')
-rw-r--r--src/scripts/darktheme.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/scripts/darktheme.js b/src/scripts/darktheme.js
index 66a3194..b44db9a 100644
--- a/src/scripts/darktheme.js
+++ b/src/scripts/darktheme.js
@@ -1,3 +1,4 @@
+const themeButton = document.getElementById('darkmodetoggle');
const theme = localStorage.getItem("theme");
var isDark = false;
@@ -11,9 +12,11 @@ if (theme) {
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;