Compare commits
No commits in common. "52786bd8d27508577e87499bfdb5f79c51209450" and "63e00968e0edea973c7cc8c00c0ea451ac19059d" have entirely different histories.
52786bd8d2
...
63e00968e0
@ -308,11 +308,6 @@
|
|||||||
if (localStorage.getItem("theme") == "light") {
|
if (localStorage.getItem("theme") == "light") {
|
||||||
toggleDarkMode();
|
toggleDarkMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set age correctly (cuz sbatti farlo ogni
|
|
||||||
// anno, toi meme tu sais)
|
|
||||||
let age_span = document.querySelector("#age");
|
|
||||||
age_span.textContent = calculateAge("1999-10-15");
|
|
||||||
})();
|
})();
|
||||||
|
|
||||||
function toggleDarkMode() {
|
function toggleDarkMode() {
|
||||||
@ -326,17 +321,3 @@ function toggleDarkMode() {
|
|||||||
document.documentElement.style.setProperty("color-scheme", theme);
|
document.documentElement.style.setProperty("color-scheme", theme);
|
||||||
localStorage.setItem("theme", theme);
|
localStorage.setItem("theme", theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateAge(birthDate) {
|
|
||||||
const today = new Date();
|
|
||||||
const birth = new Date(birthDate);
|
|
||||||
let age = today.getFullYear() - birth.getFullYear();
|
|
||||||
const monthDifference = today.getMonth() - birth.getMonth();
|
|
||||||
|
|
||||||
// Check if the birthday has not occurred yet this year
|
|
||||||
if (monthDifference < 0 || (monthDifference === 0 && today.getDate() < birth.getDate())) {
|
|
||||||
age--;
|
|
||||||
}
|
|
||||||
|
|
||||||
return age;
|
|
||||||
}
|
|
||||||
|
Binary file not shown.
@ -115,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<ul>
|
<ul>
|
||||||
<li><i class="bi bi-chevron-right"></i> <strong>Age:</strong> <span id="age">23</span>
|
<li><i class="bi bi-chevron-right"></i> <strong>Age:</strong> <span>23</span>
|
||||||
</li>
|
</li>
|
||||||
<!-- <li><i class="bi bi-chevron-right"></i> <strong>Degree:</strong> <span>Master in -->
|
<!-- <li><i class="bi bi-chevron-right"></i> <strong>Degree:</strong> <span>Master in -->
|
||||||
<!-- Software and Data Engineering </span> -->
|
<!-- Software and Data Engineering </span> -->
|
||||||
|
Loading…
Reference in New Issue
Block a user