fix: js
This commit is contained in:
parent
dc17d1557a
commit
d4fa311cac
13
script.js
13
script.js
@ -1,4 +1,5 @@
|
|||||||
const contentContainer = document.getElementById('content');
|
const contentContainer = document.getElementById('content');
|
||||||
|
const ageElement = document.getElementById('age');
|
||||||
const points = document.getElementById('points');
|
const points = document.getElementById('points');
|
||||||
|
|
||||||
const box = document.getElementById('box');
|
const box = document.getElementById('box');
|
||||||
@ -48,10 +49,12 @@ window.onload = async () => {
|
|||||||
await updateOpacity(contentContainer, true);
|
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
|
// update theme
|
||||||
if (currentTheme === 'dark')
|
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);
|
||||||
|
}
|
Reference in New Issue
Block a user