document.addEventListener("DOMContentLoaded",function (){const testimonials=document.querySelectorAll(".testimonial");const prevBtn=document.querySelector(".prev-btn");const nextBtn=document.querySelector(".next-btn");let currentIndex=0;function showTestimonial(index){testimonials.forEach((testimonial,i)=>{testimonial.classList.toggle("active",i===index)})}prevBtn.addEventListener("click",()=>{currentIndex=(currentIndex>0) ? currentIndex - 1:testimonials.length - 1;showTestimonial(currentIndex)});nextBtn.addEventListener("click",()=>{currentIndex=(currentIndex < testimonials.length - 1) ? currentIndex + 1:0;showTestimonial(currentIndex)});// Auto-rotate testimonials every 5 seconds setInterval(()=>{currentIndex=(currentIndex < testimonials.length - 1) ? currentIndex + 1:0;showTestimonial(currentIndex)},5000);// Initialize the first testimonial showTestimonial(currentIndex)});