diff options
author | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-09 13:41:04 -0400 |
---|---|---|
committer | Zach Berwaldt <zberwaldt@tutamail.com> | 2023-10-09 13:48:07 -0400 |
commit | 4e30ae95eaf52a7f427bdf020d118f40e00ab291 (patch) | |
tree | a270827b339c8c40274b41fabedcb0ec3b4afb3b /assets/js/darkmode.js | |
parent | 93a4ba55f2159e69aa1fcdaa1cf87c09e7455017 (diff) |
add some homemade svg, wpartials, and darkmode
Diffstat (limited to 'assets/js/darkmode.js')
-rw-r--r-- | assets/js/darkmode.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/assets/js/darkmode.js b/assets/js/darkmode.js new file mode 100644 index 0000000..c6094d0 --- /dev/null +++ b/assets/js/darkmode.js | |||
@@ -0,0 +1,11 @@ | |||
1 | // get with web apis #fullscren element and on click toggle fullscreen | ||
2 | const darkmode = document.getElementById('darkmode'); | ||
3 | const html = document.querySelector('html'); | ||
4 | darkmode.addEventListener('click', () => { | ||
5 | if (html.dataset.theme === 'dark') { | ||
6 | html.dataset.theme = 'light'; | ||
7 | } else { | ||
8 | html.dataset.theme = 'dark'; | ||
9 | } | ||
10 | }); | ||
11 | |||