I know this might me a dumb question, but I have 2 animation.
- First one animate a fade-in scale-up animation, which I have it like this:
- The second one, I attach it to a scrollTrigger time line, which will scale the element up when scroll
animation.current = gsap.timeline({
scrollTrigger: {
trigger: "#image-box",
start: "top center",
end: "+=300",
scrub: 1,
markers: true
}
})
animation.current.to(
"#image-box", {
scale: 4,
duration: 1,
ease: "Sine.easeInOut"
}
)
My guess what went wrong is, when it's running the second animation, it's getting the first scale value from the first animation (0.2) as a starting value,
which is why when the second animation experiences a little "hiccup" (it's scale down to 0.2 immediately, then start scaling up to 4).
I'm still making a demo on codesandbox but just gonna put this here incase it's an easy fix.