Jump to content
GreenSock

athuillier

Members
  • Posts

    2
  • Joined

  • Last visited

athuillier's Achievements

Newbie

Newbie (1/14)

4

Reputation

  1. Thank you @Sahil for pointing that out. I did try staggerTo but it couldn't work. @PointC your second approach is super clear, thanks for that!
  2. Hello, I've created a set of 9 animations triggered by pressing keyboard keys [QWE][ASD][ZXC]. My question is about the animation triggered when pressing "C" key (i.e. the 14 small colorful rectangles arriving on the canvas). These elements are SVG <rect> grouped under a <g id="confettis">. I defined a function playConfettis() where I randomly move each <rect>. Here is a simplified version of this function : function playConfettis() { tl.set(theConfettis, { rotation:0, x:0, y:0 }) .to(theConfetti1, .3, { rotation:rand(-360,360), x:rand(-500,500), y:rand(0,-500) }) .to(theConfetti2, .3, { rotation:rand(-360,360), x:rand(-500,500), y:rand(0,-500) }) ...AND SO ON FOR EACH } I guess my code is not optimized, but I couldn't figure out how to loop through all those <rect>. Thank in advance for your suggestions
×