1st of, I want to say that I did alot of research on this one, and the solutions I found weren't the best, so I was hoping somebody could help me here.
I'm also aware that ScrollMagic is not made by Greensock, and that people try to keep forum focused on GSAP, but I had no better place to ask, since scrollmagic issue page is very inactive. I hope you wont mind my question.
I use GSAP(TimelineLite) and ScrollMagic to animate element once it gets triggered by ScrollMagic's TriggerElement. And that works fine,
if I keep scrolling, element will stay in animated state, unless I scroll up again, way about trigger element, and then the animation will reverse (usually not visible because of tiggerElement position). And then it plays again once i scroll down to triggerElement, this also works fine, just as I wanted.
But another thing that I want, is also, when I scroll down past the animated element, I want it to do reverse animation (or just fades out, doesnt matter as it wont be visible since we scrolled out of viewport). And then i want animation to run again once I scroll up.
TL;DR: I want animation to play on both, scroll down and scroll up ways, once it is in triggerElement.
The solutions I have found:
The solutions I found were the make 2 scenes one for animate in and other to overwrite it, however, Jan Paepke said this can be glitchy and not working properly depending how fast user scrolls, and here is his look at this problem: https://github.com/janpaepke/ScrollMagic/wiki/WARNING:-tween-was-overwritten-by-another
(My CodePen doesn't have this solution included)
Now, this solution is from 2014, and I dont think it's very clean one, so I was hoping that someone can help me find better solution.
Im also aware that Blake has solution without ScrollMagic, but Im JS noob so I would rather not.
Thanks in advance for your time