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 autoplay = autoplayOptions != 0
    const autoplayOptions = {
      delay: autoplayPause,
      pauseOnMouseEnter: true,
      disableOnInteraction: true,
    };

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

      // breakpoints: {
      //   320: {
      //     slidesPerView: 2,
      //     spaceBetween: 40,
      //     autoplay: {
      //       delay: 1000,
      //     },
      //   },
      //   480: {
      //     slidesPerView: 3,
      //     spaceBetween: 40,
      //     autoplay: {
      //       delay: 1,
      //     },
      //   },
      //   640: {
      //     slidesPerView: 4,
      //     spaceBetween: 40,
      //     autoplay: {
      //       delay: 1,
      //     },
      //   },
      //   768: {
      //     slidesPerView: slidesToView,
      //     spaceBetween: 50,
      //   },
      // },
    });
  });
};



