Hello,
I'm having an issue with SvelteKit and ScrollTrigger. On the second route it's not correctly calculating where the stop and start needs to be, on top of that if I navigate from the homepage but don't active the scrollbar the ScrollTrigger doesn't work at all.
https://www.loom.com/share/11ef7e8080ec4c439d7dee48d32ce6e8
In this instance I'm using `use:`
import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger';
export function fadeUp(node: HTMLElement) {
gsap.registerPlugin(ScrollTrigger);
const gsapContext = gsap.context(() => {
gsap.fromTo(
node,
{ y: 50, autoAlpha: 0 },
{
y: 0,
autoAlpha: 1,
scrollTrigger: {
trigger: node,
start: 'top bottom',
end: 'top 70%',
scrub: true
}
}
);
});
return {
destroy: () => {
gsapContext.revert();
}
};
}
I've tried doing `ScrollTrigger.refresh()` when the page is mounted using `onMount()` but that doesn't fix it either.
I'm really confused what is happening here. Has anyone else come across this before?