change path to better one

This commit is contained in:
fuomag9
2025-11-15 11:44:45 +01:00
parent 515ef21f12
commit a4916b04da
7 changed files with 0 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
const yearEl = document.getElementById('year');
if (yearEl) {
yearEl.textContent = new Date().getFullYear();
}
const navLinks = document.querySelectorAll('a[href^="#"]');
navLinks.forEach((link) => {
link.addEventListener('click', (event) => {
const targetId = link.getAttribute('href');
if (!targetId || targetId === '#') {
return;
}
const target = document.querySelector(targetId);
if (!target) {
return;
}
event.preventDefault();
target.scrollIntoView({ behavior: 'smooth' });
});
});