it's hard to explain, I apologize.
I have this animation that is fixed with pin:true, once it ends (so I go to the section below), a second and different animation should start.
The problem is that the second anim during the scrolling of the first, in fact the markers are long before the actual section arrives. How can I do?
<section class="change-color" data-color="#7543ad">
..first animation
</section>
<section class="change-color" data-color="#076b49">
..second animation
</section>
//first is:
const composeTl = gsap.timeline({
scrollTrigger: {
trigger: ".active-compose.first",
start: "center center",
scrub: 1,
pinSpacing: true,
pin: true,
}
});
ecc....
//second anima (does not start correctly, -- he starts when the first one has yet to finish)
const borderLine = gsap.utils.toArray(".borderLine");
borderLine.forEach((line) => {
gsap.to(line, {
// x: 100,
scrollTrigger: {
trigger: line,
start: "top 70%",
markers: true,
onEnter: () => $(line).addClass('animated'),
}
})
});