mirror of
https://github.com/Speyll/anemone.git
synced 2024-12-26 10:57:21 +00:00
10 lines
No EOL
439 B
HTML
10 lines
No EOL
439 B
HTML
<div class="themeSwitch">
|
|
<button class="themeButton light" onclick="setTheme('light')" title="Light mode">◐</button>
|
|
<button class="themeButton dark" onclick="setTheme('dark')" title="Dark mode">◑</button>
|
|
</div>
|
|
|
|
<script>
|
|
const setTheme=(theme)=>{document.documentElement.className=theme;localStorage.setItem('theme',theme)}
|
|
const getTheme=()=>{const theme=localStorage.getItem('theme');theme&&setTheme(theme)}
|
|
getTheme()
|
|
</script> |