Spaces:
Running
Running
File size: 1,352 Bytes
833616b | 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 28 29 30 31 32 33 34 35 36 37 38 39 | document.addEventListener('DOMContentLoaded', function() {
// Mobile menu toggle functionality
const mobileMenuButton = document.querySelector('[data-menu-toggle]');
const mobileMenu = document.querySelector('[data-menu]');
if(mobileMenuButton && mobileMenu) {
mobileMenuButton.addEventListener('click', () => {
mobileMenu.classList.toggle('hidden');
});
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
document.querySelector(this.getAttribute('href')).scrollIntoView({
behavior: 'smooth'
});
});
});
// Testimonial slider
const testimonials = document.querySelectorAll('.testimonial-item');
let currentTestimonial = 0;
if(testimonials.length > 0) {
function showTestimonial(index) {
testimonials.forEach(testimonial => {
testimonial.classList.add('hidden');
});
testimonials[index].classList.remove('hidden');
}
setInterval(() => {
currentTestimonial = (currentTestimonial + 1) % testimonials.length;
showTestimonial(currentTestimonial);
}, 5000);
}
}); |