Hello, I am building a website using Gatsby/react. I created a scroll parallax animation using ScrollTrigger (see simplified version in codepen)
The issue is... when the page is first-time loaded, all is good. But if I refresh the page, the animation is all messed up. More specifically, the starting point of the trigger is higher than it was (no longer at the center of the trigger div). And then, the animation ends up overlapping with the div that comes in front it. When animation ends, it jumps back down.
I was NOT able to recreate the issue in codepen and suspect that it is related to Gatsby's Scroll Restoration or caching behavior. I know it is hard to investigate when I can't reproduce the error in codepen.
I just wonder if anyone had experience dealing with Gatsby and scroll-related animation and dealt with similar issues, and maybe can point me to the right direction.
Secondly, does the start position of a ScrollTrigger re-calculated when a page refresh? According to the doc, it only does so on window/scroller resize.