Hello,
I import timelines from an external animations.js file to one of my Svelte components but I don't know where should I pause the imported timelines so that I can control them from from the master.
Importing the timelines: import { islandsRevealTL, islandsZoomTL } from '../lib/js/animations';
Creating master timeline: masterTL = gsap.timeline();
masterTL.add(islandsRevealTL(), "islands-reveal");
masterTL.add(islandsZoomTL(), "islands-zoom");
Playing the animations on click event:
<button on:click={() => {masterTL.play("islands-reveal")}}>Reveal</button>
<button on:click={() => {masterTL.play("islands-zoom")}}>Zoom</button>
Now the timelines just play all at once from the master timeline.
masterTL.pause()
Pausing the masterTL doesnt work.
Pausing the imported timelines when adding like this: masterTL.add(islandsRevealTL().pause(), "islands-reveal");
works, but I can't play them with buttons.
How can I pause all the added timelines and control them with a .play() method with the buttons?
Thank you for any help.