Hi. I've been stuck on this issue for 3 days now. I went through all the docs, StackOverflow answers, gsap docs, codepens, gpt 4 answers etc, but I still can't figure out what is going wrong with my component. Maybe I'm just too stupid.
Anyway. Here's the codesandbox (took me hours to figure out how to do this without bringing all the code and an entire nextjs app, so i just copied the styles and recreated the important components)
https://codesandbox.io/s/lingering-pine-rkgr79?file=/src/components/FrontPageScene.tsx
Unfortunately, i didn't use codepen.
The animation should work as such: brain model moves left, then stays there for the entirety of the pinned element, then goes right when the footer appears. This works, but if you resize the window (not even fully to mobile) you'll notice that it starts to break and it doesn't recover.
On mobile it should rotate the model, which doesn't work at all, but I'm guessing that's a threejs issue i also am trying to figure out....
It looks like when I resize, the pinned component "height" is completely ignored in the scrolltrigger calculations afterward.
Any help would be super appreciated and i apologize if somehow i made dumb mistakes.