mirror of
https://github.com/kognise/water.css.git
synced 2025-12-07 23:35:10 +01:00
Fix script
This commit is contained in:
parent
2b900b7e66
commit
a176146843
3 changed files with 17 additions and 2 deletions
|
|
@ -1,8 +1,11 @@
|
|||
document.getElementById('switch').addEventListener('click', () => {
|
||||
const stylesheet = document.getElementById('stylesheet')
|
||||
const ph = document.getElementById('ph')
|
||||
if (stylesheet.getAttribute('href') === 'dist/dark.css') {
|
||||
stylesheet.setAttribute('href', 'dist/light.css')
|
||||
ph.src = ph.src.replace('theme=dark', 'theme=light')
|
||||
} else {
|
||||
stylesheet.setAttribute('href', 'dist/dark.css')
|
||||
ph.src = ph.src.replace('theme=light', 'theme=dark')
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue