Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var downloadLinksVisible = false;
  2. var animationCompleted = false;
  3.  
  4. $(document).ready(function() {
  5.  
  6.     $( window ).resize(function() {
  7.         if($( window ).width() > 380 && !downloadLinksVisible && animationCompleted){
  8.             TweenMax.to(['.download', '.OS', '.bits', 'span'], 1, {autoAlpha: 1, ease: Linear.easeNone});
  9.             downloadLinksVisible = true;
  10.         }
  11.     });
  12.  
  13.     setTimeout(function()
  14.     {
  15.         animateLogoInitial();
  16.     }, 500);
  17.  
  18.     function animateLogoInitial(){
  19.         var t = new TimelineMax();
  20.         t.to('#logo3', 3.5, {strokeDashoffset: 0, ease: Linear.easeNone})
  21.         t.set('#text', {autoAlpha: 1})
  22.         t.to('#gr-mask-opacity', 3, {attr: {x2:"140%", y2:"140%"}, ease: Power4.easeNone})
  23.         setTimeout(function(){
  24.             animatePageBody();
  25.         }, 5700);
  26.     }
  27.  
  28.     function animatePageBody(){
  29.         var t = new TimelineMax();
  30.         var windowWidth = $( window ).width();
  31.         if(windowWidth > 380){
  32.             t.to(['.download', '.OS', '.bits', 'span'], 1, {autoAlpha: 1, ease: Linear.easeNone})
  33.             downloadLinksVisible = true;
  34.         }
  35.  
  36.         t.to('.whitepaper', 1, {autoAlpha: 1, ease: Linear.easeNone})
  37.         .to('.slack', 1 , {autoAlpha: 1})
  38.         .fromTo(['.slackLogo'], 0.75, {y: 20, rotation: 90, }, {y: 0, autoAlpha: 1, rotation: -90, ease: Linear.easeNone, delay: -0.5})
  39.         .to('#logo, #logo3', 1, {autoAlpha: 1, delay: 0.5})
  40.         .to('#logo3', 1, {attr: {stroke:"transparent"}, delay: -2})
  41.         .to(['#logo1', '#logo2'], 1, {autoAlpha: 1, delay: -1, onComplete: animateLogo})
  42.     }
  43.  
  44.     function animateLogo(){
  45.         animationCompleted = true;
  46.         CSSPlugin.useSVGTransformAttr = false;
  47.         var t = new TimelineMax({repeat:-1, yoyo:true});
  48.         t.set(['#first', '#second', '#third', '#forth'], {x:20, y:20})
  49.         t.fromTo('#first', 2, {autoAlpha: 0, scale: 0.90}, { scale: 1, autoAlpha: 1, transformOrigin: '50% 50%', ease: Power4.easeNone, delay: 0.3}, 0)
  50.         t.fromTo('#second', 2, {autoAlpha: 0, scale: 0.90}, { scale: 1, autoAlpha: 1, transformOrigin: '50% 50%', ease: Power4.easeNone, delay: 0.3}, 0)
  51.         t.fromTo('#third', 2, {autoAlpha: 0, scale: 0.90}, { scale: 1, autoAlpha: 1, transformOrigin: '50% 50%',ease: Power4.easeNone, delay: 0.3}, 0)
  52.         t.fromTo('#forth', 2, {autoAlpha: 0, scale: 0.90}, { scale: 1, autoAlpha: 1, transformOrigin: '50% 50%', ease: Power4.easeNone, delay: 0.3}, 0)
  53.         t.fromTo('#logo1', 2, {autoAlpha: 1}, {autoAlpha: 0, delay: 0.3},0)
  54.     }
  55. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement