import Swiper from 'swiper';
import SwiperCore, { Navigation, Pagination, Autoplay } from 'swiper/core';
SwiperCore.use([Navigation, Pagination, Autoplay]);

export default () => {
  const partnersSliders = $('.partners-swiper');

  partnersSliders.each(function() {
    const partnersSlider = $(this);
    const slidesToView = partnersSlider.data('slides-to-view') || 3;
    const transitionSpeed = partnersSlider.data('transition-speed');
    const autoplayPause = partnersSlider.data('autoplay-pause') || 3000;
    const autoplaySlides = partnersSlider.data('autoplay');
    const marquee = partnersSlider.data('marquee');
    const autoplayOptions = {
      delay: marquee ? 0 : autoplayPause,
      pauseOnMouseEnter: true,
      disableOnInteraction: false,
    };

    new Swiper(this, {
      modules: [Autoplay],  
      freeMode: false,
      loop: true,
      slidesPerView: slidesToView,
      speed: transitionSpeed,
      noSwiping: true,
      allowTouchMove: false,
      autoplay: autoplaySlides ? autoplayOptions : false,
      spaceBetween: 16,

      breakpoints: {
        320: {
          slidesPerView: 2,
        },
        480: {
          slidesPerView: 3,
        },
        640: {
          slidesPerView: 4,
        },
        768: {
          slidesPerView: slidesToView,
        },
      },
    });
  });
};



