Hi @Rodrigo,
Thanks for your reaction, that clarifies a LOT.
How would you initialize the scrolltrigger on a cold refresh then? With the composable. When you go to a subpage and then refresh, the watcher doesn't trigger so you can only initialize the scrolltrigger on the mounted right?
Or how would you do it?
I updated the pagetransition though: https://63e8c1da81d24b68a483a5f7--uebler.netlify.app . But some blocks are still not working after "page switch". Example when you go from "home" to "fietsendragers" the cards aren't animating. But when you refresh they do.
Modified the transitionhelper to this:
import gsap from 'gsap'
import { ScrollTrigger } from 'gsap/ScrollTrigger'
import { useTransitionComposable } from '../composables/transition-composable'
gsap.registerPlugin(ScrollTrigger)
const { toggleTransitionComplete } = useTransitionComposable()
const pageTransition = {
name: 'page-transiton',
mode: 'out-in',
onEnter: (el, done) => {
gsap.fromTo(
'.pagetransition',
{
y: 0,
},
{
y: '-100%',
duration: 0.8,
ease: 'power4.inOut',
force3D: true,
onComplete: () => {
toggleTransitionComplete(true)
done()
ScrollTrigger.refresh()
},
}
)
},
onLeave: (el, done) => {
toggleTransitionComplete(false)
gsap.fromTo(
'.pagetransition',
{
y: '100%',
},
{
y: 0,
duration: 0.8,
ease: 'power4.inOut',
force3D: true,
onComplete: () => {
done()
},
}
)
},
}
export default pageTransition
Without the "ScrollTrigger.refresh()" it ain't working at ALL after a page switch ... can't really find what's going wrong here. I can give you access to my git repo if you DM you your git credentials.