diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2022-01-10 22:37:25 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2022-01-10 22:37:45 -0500 |
commit | 340d024e5fc09d1ab89062ece7b8788786ba564b (patch) | |
tree | 594d7e1f695b25ca24084474dd00f4a6927bd100 /scripts/light-dark.js | |
parent | 972392448a8c14bf896516268d304baf961c1648 (diff) |
Testing theme changer
Diffstat (limited to 'scripts/light-dark.js')
-rw-r--r-- | scripts/light-dark.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/light-dark.js b/scripts/light-dark.js new file mode 100644 index 0000000..0e23d98 --- /dev/null +++ b/scripts/light-dark.js @@ -0,0 +1,24 @@ +'use strict'; + +(function() { + lightDark = document.getElementById("light-dark"); + + function setButtonText() { + if(Theme.get() == BASE_THEMES[0][0]) + lightDark.innerText = BASE_THEMES[1][1] + " Mode"; + else + lightDark.innerText = BASE_THEMES[1][0] + " Mode"; + } + + function changeTheme(e) { + if(Theme.get() == BASE_THEMES[0][0]) + Theme.set(BASE_THEMES[0][1]); + else + Theme.set(BASE_THEMES[0][0]); + + setButtonText(); + } + + lightDark.addEventListener("click", changeTheme); + setButtonText(); +})(); |