Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. var falling = true;
  2.  
  3. TweenLite.set("#container",{perspective:600})
  4. TweenLite.set("img",{xPercent:"-50%",yPercent:"-50%"})
  5.  
  6. var total = 30;
  7. var container = document.getElementById("container"), w = window.innerWidth , h = window.innerHeight;
  8.  
  9. for (i=0; i<total; i++){
  10. var Div = document.createElement('div');
  11. TweenLite.set(Div,{attr:{class:'dot'},x:R(0,w),y:R(-200,-150),z:R(-200,200)});
  12. container.appendChild(Div);
  13. animm(Div);
  14. }
  15.  
  16. function animm(elm){
  17. TweenMax.to(elm,R(6,15),{y:h+100,ease:Linear.easeNone,repeat:-1,delay:-15});
  18. TweenMax.to(elm,R(4,8),{x:'+=100',rotationZ:R(0,180),repeat:-1,yoyo:true,ease:Sine.easeInOut});
  19. TweenMax.to(elm,R(2,8),{rotationX:R(0,360),rotationY:R(0,360),repeat:-1,yoyo:true,ease:Sine.easeInOut,delay:-5});
  20. };
  21.  
  22. function R(min,max) {return min+Math.random()*(max-min)};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement