This commit is contained in:
sador 2023-09-15 20:16:54 +02:00
parent dc17d1557a
commit d4fa311cac

View File

@ -1,4 +1,5 @@
const contentContainer = document.getElementById('content');
const ageElement = document.getElementById('age');
const points = document.getElementById('points');
const box = document.getElementById('box');
@ -48,10 +49,12 @@ window.onload = async () => {
await updateOpacity(contentContainer, true);
}
// update age
const difference = (Date.now() - 1182722400000) / (1000 * 60 * 60 * 24 * 365);
document.getElementById('age').innerText = difference.toFixed(4);
// update theme
if (currentTheme === 'dark')
document.body.classList.add('dark');
document.body.classList.add('dark');
// update age
if (typeof ageElement !== 'undefined') {
const difference = (Date.now() - 1182722400000) / (1000 * 60 * 60 * 24 * 365);
ageElement.innerText = difference.toFixed(4);
}