1
0
mirror of https://github.com/kognise/water.css.git synced 2025-02-24 22:02:50 +01:00
css-water.css/script.js
2019-04-05 12:47:56 -04:00

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')
}
})