2019-04-05 09:09:13 -04:00
|
|
|
document.getElementById('switch').addEventListener('click', () => {
|
2019-04-06 14:33:18 -04:00
|
|
|
const stylesheet = document.getElementById('stylesheet')
|
2019-04-06 16:50:52 -04:00
|
|
|
const ph = document.getElementById('ph')
|
2019-04-06 15:07:11 -04:00
|
|
|
if (stylesheet.getAttribute('href') === 'dist/dark.css') {
|
|
|
|
|
stylesheet.setAttribute('href', 'dist/light.css')
|
2019-04-06 16:50:52 -04:00
|
|
|
ph.src = ph.src.replace('theme=dark', 'theme=light')
|
2019-04-05 09:09:13 -04:00
|
|
|
} else {
|
2019-04-06 15:07:11 -04:00
|
|
|
stylesheet.setAttribute('href', 'dist/dark.css')
|
2019-04-06 16:50:52 -04:00
|
|
|
ph.src = ph.src.replace('theme=light', 'theme=dark')
|
2019-04-05 09:09:13 -04:00
|
|
|
}
|
|
|
|
|
})
|