-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
27 lines (23 loc) · 862 Bytes
/
script.js
File metadata and controls
27 lines (23 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(function () {
// Mobile nav toggle
const navToggle = document.querySelector('.nav-toggle');
const navList = document.querySelector('.nav-list');
if (navToggle && navList) {
navToggle.addEventListener('click', () => {
const isOpen = navList.classList.toggle('is-open');
navToggle.setAttribute('aria-expanded', isOpen ? 'true' : 'false');
});
navList.addEventListener('click', (event) => {
const target = event.target;
if (target instanceof HTMLElement && target.tagName.toLowerCase() === 'a') {
navList.classList.remove('is-open');
navToggle.setAttribute('aria-expanded', 'false');
}
});
}
// Dynamic year in footer
const yearSpan = document.getElementById('year');
if (yearSpan) {
yearSpan.textContent = String(new Date().getFullYear());
}
})();