mirror of
https://github.com/Crazyco-xyz/48hr.email.git
synced 2026-01-10 03:29: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);
|
let diff = Math.floor((expiry - now) / 1000);
|
||||||
if (diff <= 0) {
|
if (diff <= 0) {
|
||||||
el.textContent = 'Expired';
|
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';
|
el.style.color = '#b00';
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hours = Math.floor(diff / 3600);
|
const hours = Math.floor(diff / 3600);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue