Hi @Skrypt — I've got an implementation working when navigating across pages — you have to declare the animation in the script setup, not bound to a ref, and then activate it on the onMounted hook, eg
<script setup>
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
gsap.registerPlugin(ScrollTrigger);
const animation = gsap.timeline({
scrollTrigger: {
start: "top top",
end: "center top",
scrub: 1,
},
});
const logo = ref(null);
onMounted(() => {
animation.to(logo.value, { yPercent: -100, opacity: 0, duration: 1 });
});
</script>