I'm trying to animate an image sequence using a canvas & ScrollTrigger in my CodePen. Out of the 600 frames, I have the first 200 mapped to the scroll position for 500vh. The last 400 frames can be seamlessly looped, which I've done in the loop animation.
What I'm ultimately trying to do, is seamlessly start playing the loop animation once the user scrolls to the bottom of the page/track element, but if the user scrolls back up enough (~10% offset), tween to the correct frame for scroll position, and re-enable the scroll based playback.
Currently I added some bottom margin to the track, and used onLeave and onEnterBack to start/stop the looping animation, but this requires the track element to scroll off the page first to start the animation.
I'm sure there's a more ideal way to do this, would appreciate some help here.