Some checks failed
Build and Deploy Container / build_and_deploy (push) Failing after 33s
28 lines
943 B
JavaScript
28 lines
943 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
const mobileToggle = document.querySelector('.mobile-toggle');
|
|
const navLinks = document.querySelector('.nav-links');
|
|
|
|
if (mobileToggle) {
|
|
mobileToggle.addEventListener('click', () => {
|
|
navLinks.classList.toggle('active');
|
|
});
|
|
}
|
|
|
|
// Smooth scroll for anchor links
|
|
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
anchor.addEventListener('click', function (e) {
|
|
e.preventDefault();
|
|
const target = document.querySelector(this.getAttribute('href'));
|
|
if (target) {
|
|
target.scrollIntoView({
|
|
behavior: 'smooth'
|
|
});
|
|
// Close mobile menu on click
|
|
if (navLinks.classList.contains('active')) {
|
|
navLinks.classList.remove('active');
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|