Added website
This commit is contained in:
22
docs/scripts.js
Normal file
22
docs/scripts.js
Normal 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' });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user