mirror of
https://github.com/Crazyco-xyz/48hr.email.git
synced 2026-01-09 03:09:36 +01:00
[Chore]: Modify "Expired" timer to show accent-color
Someone really hates themselves today
This commit is contained in:
parent
f35df3cbc7
commit
9798cd47e9
1 changed files with 9 additions and 1 deletions
|
|
@ -30,7 +30,15 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
let diff = Math.floor((expiry - now) / 1000);
|
||||
if (diff <= 0) {
|
||||
el.textContent = 'Expired';
|
||||
el.style.color = '#b00';
|
||||
// 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue