Merge pull request #12 from ok2/codex/fix-analog-clock-not-working

Fix analog clock initialization
This commit is contained in:
Kiyomichi Kosaka 2025-06-14 23:29:07 +02:00 committed by GitHub
commit a7d623f5ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,7 +87,7 @@
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`; document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;
} }
window.addEventListener('load', () => { function initClock() {
placeMarkers(); placeMarkers();
updateClock(); updateClock();
setInterval(updateClock, 1000); setInterval(updateClock, 1000);
@ -97,5 +97,11 @@
document.body.classList.toggle('fullscreen-clock'); document.body.classList.toggle('fullscreen-clock');
}); });
} }
}); }
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initClock);
} else {
initClock();
}
})(); })();