Rotate RPG clock: 6:00 real at bottom (0°), midnight at left

This commit is contained in:
Richard Zink committed 2026-10-07 07:52:24 +02:00
1 parent 1b5fcf74b5
commit 79ceaa1673
1 file changed
+2 -1
+2 -1
View File
@@ -338,7 +338,8 @@
} }
function angleForTime(date) { function angleForTime(date) {
var hours = date.getHours() + date.getMinutes() / 60; // Rotate so 6:00 real = bottom (0°), 12:00 = right (90°), 18:00 = top (180°), 0:00 = left (270°)
var hours = (date.getHours() + date.getMinutes() / 60 - 6 + 24) % 24;
return ((hours / 24) * 360 - 90) * Math.PI / 180; return ((hours / 24) * 360 - 90) * Math.PI / 180;
} }