So I want to view available small animation options first and have the ability to create a final animation by adding these small children animations to a parent timeline. Something like:
Available Small Animations: 1. <move up 100px> (2s) 2. <move down 100px> (2s)
Final animation can be a combination of small animation in any order and frequency: <move down 100px> <move down 100px> <move up 100px> <move down 100px> (8s)
I need to use temporary variable to view an animation, and add button will then add the last viewed i.e. child timeline stored in temp variable(lastAnimation).
When I preview animation when another animation is playing, I want to stop playing the previous animation and start the new one. The problem is killing the temp variable animation is also removing it from the final timeline if it was added. Even if I add 10 child animations, the final animation timeline only has the last animation that was added. This problem is not occurring if I don't kill the animations and wait until the animation is complete and then add it.
The demo is simplified for CSS but my use case is for three.js animation so I need to use timelines to create simple animation that require position and rotation animation simultaneously.
What am I missing?