0002 | Pastor Andrew Nguyen
& Mrs. Tu Uyen

document.addEventListener('DOMContentLiteSpeedLoaded',function(){
const slider=document.querySelector('.customer-logos-vanilla');
let allSlides=document.querySelectorAll('.slide-vanilla');
const wrapper=document.querySelector('.logo-slider-wrapper');
if(!slider||allSlides.length===0)return;
const TRANSITION_DURATION_SECONDS=0.5;
const AUTOPLAY_SPEED=3000;
const SLIDES_TO_SCROLL=1;
const ORIGINAL_SLIDE_COUNT=allSlides.length;
let currentSlideIndex=0;
let slideDimension=0;
let autoScrollInterval;
let isHorizontal=!1;
function checkOrientation(){
isHorizontal=window.innerWidth<=768}
const MAX_CLONE_COUNT=Math.max(3+1,4+1);for(let i=0;i
setTimeout(()=>{
slider.style.transition='none';
currentSlideIndex=0;
if(isHorizontal){
slider.style.transform=`translateX(0px)`;
}else{
slider.style.transform=`translateY(0px)`;
}
},TRANSITION_DURATION_SECONDS*1000);
}
}
calculateSliderDimensions();
autoScrollInterval=setInterval(moveSlider,AUTOPLAY_SPEED);
window.addEventListener('resize',()=>{
clearInterval(autoScrollInterval);
calculateSliderDimensions();
currentSlideIndex=0;
slider.style.transition='none';
if(isHorizontal){
slider.style.transform=`translateX(0px)`;
}else{
slider.style.transform=`translateY(0px)`;
}
autoScrollInterval=setInterval(moveSlider,AUTOPLAY_SPEED);
});
wrapper.addEventListener('mouseenter',()=>{
clearInterval(autoScrollInterval);
});
wrapper.addEventListener('mouseleave',()=>{
autoScrollInterval=setInterval(moveSlider,AUTOPLAY_SPEED);
});
});














