diff options
| author | Jieiku | 2023-05-22 23:24:44 -0700 |
|---|---|---|
| committer | Jieiku | 2023-05-22 23:24:44 -0700 |
| commit | 3af6d9131f6dfc138856d718ec96626344095ec8 (patch) | |
| tree | 1a8d75cf494d5333da2cb02506e04c9e0f576f6d /static/js/theme_button.js | |
| parent | 3ca36cc469e838cee7d3fdcdc6ff39b35313a293 (diff) | |
| download | abridge-3af6d9131f6dfc138856d718ec96626344095ec8.tar.gz abridge-3af6d9131f6dfc138856d718ec96626344095ec8.tar.bz2 abridge-3af6d9131f6dfc138856d718ec96626344095ec8.zip | |
Optimizations and Fixes
Diffstat (limited to 'static/js/theme_button.js')
| -rw-r--r-- | static/js/theme_button.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/static/js/theme_button.js b/static/js/theme_button.js new file mode 100644 index 0000000..34d1d78 --- /dev/null +++ b/static/js/theme_button.js @@ -0,0 +1,7 @@ +// Set lightmode +if (document.getElementById('mode')) { + document.getElementById('mode').addEventListener('click', () => { + document.documentElement.classList.toggle('light'); + localStorage.setItem('theme', document.documentElement.classList.contains('light') ? 'light' : 'dark'); + }); +} |
