mirror of
https://github.com/kognise/water.css.git
synced 2025-12-07 23:35:10 +01:00
Fixed demo page references/theme switcher
This commit is contained in:
parent
7bce456f26
commit
522fd8e41e
2 changed files with 5 additions and 8 deletions
11
script.js
11
script.js
|
|
@ -1,11 +1,8 @@
|
|||
document.getElementById('switch').addEventListener('click', () => {
|
||||
const { body } = document
|
||||
const ph = document.getElementById('ph')
|
||||
if (body.classList.contains('light')) {
|
||||
body.classList.remove('light')
|
||||
ph.src = ph.src.replace('theme=light', 'theme=dark')
|
||||
const css = document.getElementById('watercss');
|
||||
if (css.getAttribute('href') == 'dist/water-dark.css') {
|
||||
css.setAttribute('href', 'dist/water-light.css')
|
||||
} else {
|
||||
body.classList.add('light')
|
||||
ph.src = ph.src.replace('theme=dark', 'theme=light')
|
||||
css.setAttribute('href', 'dist/water-dark.css')
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue