diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/images/favicon.png | bin | 0 -> 1162 bytes | |||
-rw-r--r-- | static/images/logo.png | bin | 0 -> 1162 bytes | |||
-rw-r--r-- | static/js/theme.js | 22 |
3 files changed, 22 insertions, 0 deletions
diff --git a/static/images/favicon.png b/static/images/favicon.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/static/images/favicon.png diff --git a/static/images/logo.png b/static/images/logo.png Binary files differnew file mode 100644 index 0000000..596fb43 --- /dev/null +++ b/static/images/logo.png diff --git a/static/js/theme.js b/static/js/theme.js new file mode 100644 index 0000000..be2a9d1 --- /dev/null +++ b/static/js/theme.js @@ -0,0 +1,22 @@ +const key = 'current_emily_zola_style'; + +function getTheme() { + let theme = document.getElementById('stylesheet'); + let current_style = localStorage.getItem(key); + if (current_style === null) { + localStorage.setItem(key, theme.href); + } + theme.href = localStorage.getItem(key); +} + +function changeTheme() { + let current_style = localStorage.getItem(key); + if (current_style.includes('dark')) { + localStorage.setItem(key, '/light.css'); + } + else { + localStorage.setItem(key, '/dark.css'); + } + let theme = document.getElementById('stylesheet'); + theme.href = localStorage.getItem(key); +}
\ No newline at end of file |