peter-tanner.github.io/_javascript/modules/components/mode-watcher.js

15 lines
246 B
JavaScript
Raw Normal View History

2024-10-13 04:56:18 +08:00
/**
* Add listener for theme mode toggle
*/
const toggle = document.getElementById('mode-toggle');
export function modeWatcher() {
if (!toggle) {
return;
}
toggle.addEventListener('click', () => {
modeToggle.flipMode();
});
}