mirror of
https://github.com/kognise/water.css.git
synced 2025-02-24 22:02:50 +01:00
11 lines
379 B
JavaScript
11 lines
379 B
JavaScript
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')
|
|
} else {
|
|
body.classList.add('light')
|
|
ph.src = ph.src.replace('theme=dark', 'theme=light')
|
|
}
|
|
}) |