mirror of
https://github.com/peter-tanner/peter-tanner.github.io.git
synced 2024-11-30 20:10:18 +08:00
15 lines
246 B
JavaScript
15 lines
246 B
JavaScript
|
/**
|
||
|
* Add listener for theme mode toggle
|
||
|
*/
|
||
|
const toggle = document.getElementById('mode-toggle');
|
||
|
|
||
|
export function modeWatcher() {
|
||
|
if (!toggle) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
toggle.addEventListener('click', () => {
|
||
|
modeToggle.flipMode();
|
||
|
});
|
||
|
}
|