Advertisement
ArtSemkin

Untitled

Jun 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* ======================================================================== */
  2. /* 34. SectionContent */
  3. /* ======================================================================== */
  4. var SectionContent = function ($scope) {
  5.  
  6.     var $target = $scope.find('.section-content[data-os-animation]');
  7.  
  8.     if (!$target.length) {
  9.  
  10.         return;
  11.  
  12.     }
  13.  
  14.     $target.each(function () {
  15.  
  16.         var
  17.             tl = new TimelineMax(),
  18.             $current = $(this),
  19.             $headline = $current.find('.section__headline'),
  20.             $headlineProperty = $current.find('.figure-property__headline'),
  21.             $heading = $current.find('h2'),
  22.             $subheading = $current.find('h3'),
  23.             $property = $current.find('.figure-property');
  24.  
  25.         prepare();
  26.         animate();
  27.  
  28.         function prepare() {
  29.  
  30.             hideWords($heading, 0.6, 0.02, '50px');
  31.  
  32.             TweenMax.set($headlineProperty, {
  33.                 scaleX: 0,
  34.                 transformOrigin: 'left center'
  35.             });
  36.  
  37.             TweenMax.set($headline, {
  38.                 scaleX: 0,
  39.                 transformOrigin: 'left center'
  40.             });
  41.  
  42.         }
  43.  
  44.         function animate() {
  45.  
  46.             if ($heading.length) {
  47.  
  48.                 tl.add(animateWords($heading));
  49.  
  50.             }
  51.             if ($headline.length) {
  52.  
  53.                 tl.to($headline, 1.2, {
  54.                     scaleX: 1,
  55.                     ease: Expo.easeInOut
  56.                 }, '0');
  57.  
  58.             }
  59.  
  60.             if ($subheading.length) {
  61.  
  62.                 tl.add(animateLines($subheading, 1.2, 0.01), '-=0.8')
  63.  
  64.             }
  65.  
  66.             if ($property.length) {
  67.  
  68.                 $property.each(function () {
  69.                     tl.add(animateLines($(this), 1.2, 0.01), '-=1.8');
  70.                     tl.to($(this).find($headlineProperty), 1.2, {
  71.                         scaleX: 1,
  72.                         ease: Expo.easeInOut,
  73.                         transformOrigin: 'left center'
  74.                     }, '0');
  75.                 });
  76.  
  77.             }
  78.  
  79.             createOSScene($current, tl);
  80.  
  81.         }
  82.  
  83.     })
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement