const swipecontainer = document.querySelector(".swipecontainer");
const likeBtns = document.querySelector(".like-btns");
        
var swiper = new Swiper(".swiper", {
    spaceBetween: 30,
    slidesPerView: "auto",
    loop: true,
    speed: 5000,
    freeMode: true,
    allowTouchMove: false,
    autoplay: {
        delay: 0,
        disableOnInteraction: false,
    },
});
        
        
function stopAutoPlay() {
    const swiperTranslate = swiper.getTranslate();
    swiper.setTranslate(swiperTranslate);
    swiper.autoplay.stop();
}
        
function startAutoPlay() {
    swiper.slideTo(swiper.activeIndex, 5000, false);
    swiper.autoplay.start()
}
        
swipecontainer.addEventListener("mouseenter", () => stopAutoPlay());
swipecontainer.addEventListener("mouseleave", () => startAutoPlay());