mirror of
https://github.com/Speyll/anemone.git
synced 2024-11-22 13:06:41 +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> |