Hey @nthpolygon how is going?? I leave here an example with 2 alternatives, but the onComplete should be doing the same thing.
Using onComplete:
const tween = gsap.from(["h1", "p"], {
yPercent: 30,
autoAlpha: 0,
stagger: 0.1,
paused: true
});
gsap.to("body", {
autoAlpha: 1,
duration: 0.5,
onComplete: () => {
tween.play();
}
});
Using .then():
const tween = gsap.from(["h1", "p"], {
yPercent: 30,
autoAlpha: 0,
stagger: 0.1,
paused: true
});
gsap
.to("body", {
autoAlpha: 1,
duration: 0.5
})
.then(() => {
tween.play();
});
I leave here the Codepen: https://codepen.io/nazarenooviedo/pen/mdXZMQg