Advertisement
ArtSemkin

Untitled

Jul 22nd, 2020
955
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ======================================================================== */
  2. /* 67. SliderTextTransitions */
  3. /* ======================================================================== */
  4. class SliderTextTransitions {
  5.   constructor({
  6.     slider,
  7.     direction,
  8.     offset = 40,
  9.     staggerHeadings = 0.3,
  10.     staggerTexts = 0.2,
  11.     heading,
  12.     subheading,
  13.     description,
  14.     link
  15.   }) {
  16.     // slider
  17.     this.slider = slider;
  18.     this.$slides = $(this.slider.slides);
  19.  
  20.     // params
  21.     this.offset = offset;
  22.     this.direction = direction || this.slider.params.direction;
  23.     this.speed = parseFloat(this.slider.params.speed / 1000);
  24.  
  25.     // elements
  26.     this.$heading = heading;
  27.     this.$subheading = subheading;
  28.     this.$description = description;
  29.     this.$link = link;
  30.     this.elementsLength = this._countExistentElements();
  31.  
  32.     // animation
  33.     this.timeline = new gsap.timeline();
  34.     this.hideTimeline = new gsap.timeline();
  35.     this.ease = 'power4.out';
  36.     this.staggerHeadings = staggerHeadings;
  37.     this.staggerTexts = staggerTexts;
  38.     this.animationDirections = this._getAnimationDirections();
  39.     this._initialSet();
  40.     this._bindEvents();
  41.   }
  42.   ...
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement