Why my GSAP code not working after use view transitions.
Now I have an component:
HTML elements...
<script>
gsap.to('h1 > span', {
y: 0,
stagger: 0.2,
duration: 0.5,
ease: 'back.inOut',
delay: 0.2,
})
</script>
When I insert <ViewTransitions /> in layout.astro, the code works when I first appear on the page, but when I switch to other pages and then switch back to this page, the code not working.