[Chore]: Modify "Expired" timer to show accent-color

Someone really hates themselves today
This commit is contained in:
ClaraCrazy 2025-12-29 16:34:01 +01:00
parent f35df3cbc7
commit 9798cd47e9
No known key found for this signature in database
GPG key ID: EBBC896ACB497011

View file

@ -30,7 +30,15 @@ document.addEventListener('DOMContentLoaded', () => {
let diff = Math.floor((expiry - now) / 1000);
if (diff <= 0) {
el.textContent = 'Expired';
// why am I doing this to myself?
try {
const horse = document.querySelector('body');
const style = getComputedStyle(horse);
el.style.color = style.getPropertyValue('accent-color').trim();
} catch (_) {
el.style.color = '#b00';
}
return;
}
const hours = Math.floor(diff / 3600);