Merge pull request #18 from ok2/codex/fix-analog-clock-angle-calculation

Fix analog clock rotation drift
This commit is contained in:
Kiyomichi Kosaka 2025-06-14 23:56:44 +02:00 committed by GitHub
commit 14a8b553a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,9 +89,10 @@
function updateClock() {
const now = new Date();
const cob = toCobiets(now);
const xf = cob / COBIE_UNITS.quantic;
const qf = cob / COBIE_UNITS.chronon;
const cf = cob / COBIE_UNITS.eonstrip;
// Use fractional progress within each unit so angles stay small
const xf = (cob % COBIE_UNITS.quantic) / COBIE_UNITS.quantic;
const qf = (cob % COBIE_UNITS.chronon) / COBIE_UNITS.chronon;
const cf = (cob % COBIE_UNITS.eonstrip) / COBIE_UNITS.eonstrip;
document.getElementById('handXeno').style.transform = `rotate(${xf * 360}deg)`;
document.getElementById('handQuantic').style.transform = `rotate(${qf * 360}deg)`;
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;