1
0
mirror of https://github.com/kognise/water.css.git synced 2025-02-24 13:52:56 +01:00
css-water.css/script.js
2019-04-06 16:50:52 -04:00

11 lines
469 B
JavaScript

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