fix(fusion_clock): NFC kiosk — subtle logo glass, centered clock, AM/PM

This commit is contained in:
gsinghpal
2026-05-14 08:38:25 -04:00
parent bad73fcea8
commit 42e8fe3d21
2 changed files with 40 additions and 16 deletions

View File

@@ -365,16 +365,23 @@
}
// ──────────────────────────────────────────────────────────────
// Clock display (top-right time + date)
// Clock display (centered top: time with AM/PM + date)
// ──────────────────────────────────────────────────────────────
function updateClock() {
const now = new Date();
const hh = String(now.getHours()).padStart(2, "0");
let hours = now.getHours();
const ampm = hours >= 12 ? "PM" : "AM";
hours = hours % 12;
if (hours === 0) hours = 12; // 0 → 12 in 12-hour clock
const hh = String(hours).padStart(2, "0");
const mm = String(now.getMinutes()).padStart(2, "0");
const dateStr = now.toLocaleDateString([], { weekday: "short", month: "short", day: "numeric" });
const timeEl = document.getElementById("nfc_clock_time");
const dateEl = document.getElementById("nfc_clock_date");
if (timeEl) timeEl.textContent = `${hh}:${mm}`;
if (timeEl) {
// Render hh:mm + AM/PM as separate spans so SCSS can style them differently
timeEl.innerHTML = `${hh}:${mm}<span class="ampm">${ampm}</span>`;
}
if (dateEl) dateEl.textContent = dateStr;
}
updateClock();