Thanks Cassi for your fast response
When I look in the code the approch is complete different i looks to me
in The gsap example
gsap.to(playhead, {
frame: animation.totalFrames - 1,
ease: 'none',
onUpdate: () => animation.goToAndStop(playhead.frame, true),
scrollTrigger: st
});
});
You use scrolltrigger inside a gsap.to animation of the whole Lottie animation
But in Chris code
ScrollTrigger.create({
trigger: obj.target,
scrub: true,
pin: true,
start: "top top",
end: endString,
onUpdate: self => {
if(obj.duration) {
gsap.to(timeObj, {
duration: obj.duration,
currentFrame:(Math.floor(self.progress * (anim.totalFrames - 1))),
onUpdate: () => {
anim.goToAndStop(timeObj.currentFrame, true)
},
ease: 'expo'
})
} else {
anim.goToAndStop(self.progress * (anim.totalFrames - 1), true)
}
}
});
He create a scrolltiger and do a lot of small gsap.to animations
I'm very keen to understand the diffrent approches for those two way to code this task?