123movies-seo/resources/js/components/Slider.js

84 lines
2.2 KiB
JavaScript

export default {
optionsHome: {
slidesPerView: 1,
lazy: true,
lazy: {
loadPrevNext: true,
loadPrevNextAmount: 9,
},
// pagination: {
// el: '.swiper-pagination',
// },
// paginationClickable: true,
// preventClicks: !1,
loop: true,
autoplay: {
delay: 4000,
// pauseOnMouseEnter: true
},
speed: 800,
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
},
optionsContent: {
// freeMode:true,
slidesPerView: "auto",
// loopedSlides: 3,
//slidesPerView: 3,
spaceBetween: 5,
// longSwipesRatio: 0.1,
slidesPerGroup: 1,
slidesPerGroupAuto: true,
watchSlidesProgress: true,
watchSlidesVisibility: true,
// loop: true,
speed: 1200,
grabCursor: true,
preloadImages: false,
lazy: true,
lazy: {
loadPrevNext: true,
loadPrevNextAmount: 9,
loadOnTransitionStart: true,
checkInView: true,
},
// autoplay: {
// delay: 5000,
// disableOnInteraction: true,
// },
loopFillGroupWithBlank: true,
/*
pagination: {
el: '.swiper-pagination',
clickable: true,
},
*/
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
},
sliderClassHome: "slider-home",
sliderClassContent: "slider-content",
canInitialize(className) {
const slider = document.getElementsByClassName(className);
return slider.length > 0 && typeof Swiper !== "undefined";
},
initializeSlider() {
this.canInitialize(this.sliderClassContent)
? new Swiper("." + this.sliderClassContent, this.optionsContent)
: '';
this.canInitialize(this.sliderClassHome)
? new Swiper("." + this.sliderClassHome, this.optionsHome)
: '';
},
};