2023-03-13 15:20:59 +03:00
|
|
|
/**
|
|
|
|
* Add listener for theme mode toggle
|
|
|
|
*/
|
2024-04-17 01:10:01 +03:00
|
|
|
const toggle = document.getElementById('mode-toggle');
|
2023-03-13 15:20:59 +03:00
|
|
|
|
|
|
|
export function modeWatcher() {
|
2024-04-17 01:10:01 +03:00
|
|
|
if (!toggle) {
|
2023-03-13 15:20:59 +03:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2024-04-17 01:10:01 +03:00
|
|
|
toggle.addEventListener('click', () => {
|
|
|
|
modeToggle.flipMode();
|
2023-03-13 15:20:59 +03:00
|
|
|
});
|
|
|
|
}
|