artemsemkin

Untitled

Oct 7th, 2020 (edited)
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ======================================================================== */
  2. /* 68. SliderFullscreenProjects */
  3. /* ======================================================================== */
  4. class SliderFullscreenProjects extends Slider {
  5.   constructor({
  6.     scope,
  7.     target
  8.   }) {
  9.     super({
  10.       target,
  11.       scope
  12.     });
  13.   }
  14.  
  15.   ...
  16.  
  17.   _getSliderImages() {
  18.     if (!this.$sliderImg.length) {
  19.       return false;
  20.     }
  21.  
  22.     return new Swiper(this.$sliderImg, {
  23.       simulateTouch: this.dragMouse ? true : false,
  24.       direction: this.$sliderImg.data('direction') || 'horizontal',
  25.       slidesPerView: this.$sliderImg.data('slides-per-view') || 1,
  26.       touchRatio: this.$sliderImg.data('touch-ratio') || 1,
  27.       /////////////////////////////////////////////////////
  28.       /////////////////////////////////////////////////////
  29.       effect: 'fade',
  30.       /////////////////////////////////////////////////////
  31.       /////////////////////////////////////////////////////
  32.       allowTouchMove: this.transitionEffect === 'distortion' ? false : true,
  33.       fadeEffect: {
  34.         crossFade: true
  35.       },
  36.       centeredSlides: true,
  37.       parallax: true,
  38.       speed: this.sliderSpeed,
  39.       preloadImages: false,
  40.       updateOnImagesReady: true,
  41.       grabCursor: true,
  42.       lazy: {
  43.         loadPrevNextAmount: 4,
  44.         loadPrevNext: true,
  45.         loadOnTransitionStart: true
  46.       },
  47.       slideToClickedSlide: true,
  48.       keyboard: {
  49.         enabled: true,
  50.         onlyInViewport: true
  51.       },
  52.       autoplay: {
  53.         disableOnInteraction: false,
  54.         enabled: this.$sliderImg.data('autoplay-enabled') || false,
  55.         delay: this.$sliderImg.data('autoplay-delay') || 6000,
  56.       },
  57.       mousewheel: this.$sliderImg.data('mousewheel-enabled') ? {
  58.         eventsTarged: this.$target.get(0),
  59.         eventsTarget: this.$target.get(0),
  60.         releaseOnEdges: true,
  61.       } : false,
  62.       pagination: {
  63.         el: this.$el.find('.js-slider__dots').get(0),
  64.         type: 'bullets',
  65.         bulletElement: 'div',
  66.         clickable: true,
  67.         bulletClass: 'slider__dot',
  68.         bulletActiveClass: 'slider__dot_active'
  69.       },
  70.       navigation: {
  71.         nextEl: this.$el.find('.js-slider__arrow-next').get(0),
  72.         prevEl: this.$el.find('.js-slider__arrow-prev').get(0),
  73.       },
  74.       controller: {
  75.         control: [],
  76.         by: 'container'
  77.       },
  78.     });
  79.   }
  80.  
  81.   ...
  82. }
Add Comment
Please, Sign In to add comment