Merge pull request #18 from ok2/codex/fix-analog-clock-angle-calculation
Fix analog clock rotation drift
This commit is contained in:
commit
14a8b553a4
7
clock.js
7
clock.js
@ -89,9 +89,10 @@
|
|||||||
function updateClock() {
|
function updateClock() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const cob = toCobiets(now);
|
const cob = toCobiets(now);
|
||||||
const xf = cob / COBIE_UNITS.quantic;
|
// Use fractional progress within each unit so angles stay small
|
||||||
const qf = cob / COBIE_UNITS.chronon;
|
const xf = (cob % COBIE_UNITS.quantic) / COBIE_UNITS.quantic;
|
||||||
const cf = cob / COBIE_UNITS.eonstrip;
|
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('handXeno').style.transform = `rotate(${xf * 360}deg)`;
|
||||||
document.getElementById('handQuantic').style.transform = `rotate(${qf * 360}deg)`;
|
document.getElementById('handQuantic').style.transform = `rotate(${qf * 360}deg)`;
|
||||||
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;
|
document.getElementById('handChronon').style.transform = `rotate(${cf * 360}deg)`;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user