From 77f4aa8d1f818169490a35bf2ec3eb43e60166b4 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 22 Mar 2026 09:43:36 +0000 Subject: feat: color clock based on build version hash Embeds the build version as a data attribute on #last-updated and derives an HSL hue from the first 6 hex chars, matching the claudomator logo color technique. Co-Authored-By: Claude Sonnet 4.6 --- web/static/js/app.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'web/static') diff --git a/web/static/js/app.js b/web/static/js/app.js index 954dc8c..37d2a30 100644 --- a/web/static/js/app.js +++ b/web/static/js/app.js @@ -3,6 +3,16 @@ // Constants const AUTO_REFRESH_INTERVAL = 5 * 60 * 1000; // 5 minutes in milliseconds +// Color the clock based on the build version hash +(function applyVersionColor() { + const el = document.getElementById('last-updated'); + if (!el) return; + const ver = el.dataset.buildVersion || ''; + const hex = ver.replace(/[^0-9a-f]/gi, '').slice(0, 6).padEnd(6, '0'); + const hue = Math.round((parseInt(hex, 16) / 0xffffff) * 360); + el.style.color = `hsl(${hue}, 70%, 65%)`; +})(); + // Timeline Calendar Initialization function initTimelineCalendar(calendarId, nowLineId, untimedSectionId) { const calendar = document.getElementById(calendarId); -- cgit v1.2.3