window.onload=function(){const wrapEl=document.querySelector(".longines-cvd-2025");const keys=["love","men","women","recommend"];const getElGroup=function(){return keys.reduce(function(prev,item){prev[item]=["tab-bg","swiper-wrap"].map(function(key){return wrapEl.querySelectorAll(".".concat(item," .").concat(key," .show-item"))});return prev},{})};const elGroup=getElGroup();const setImg=function(els,index){els.forEach(function(el,i){el.classList["".concat(i===index?"add":"remove")]("show")})};const maskTabEl=wrapEl.querySelectorAll(".child-tab");maskTabEl.forEach(function(itemEl){itemEl.onclick=function(e){const{index,field}=e.target.dataset;elGroup[field].forEach(function(el){setImg(el,+index)})}});const autoplay=function(){keys.forEach(function(item){const els=[...wrapEl.querySelectorAll(".".concat(item," .tab-bg .show-item"))];let index=els.findIndex(function(el){return el.classList.contains("show")});index++;if(index===els.length){index=0}elGroup[item].forEach(function(el){setImg(el,index)})})};let start=null;const step=function(timestamp){if(start===null){start=timestamp}const elapsed=timestamp-start;const temVal=elapsed-5500;if(Math.abs(temVal)===temVal){autoplay();start=null}window.requestAnimationFrame(step)};window.requestAnimationFrame(step)};