Hi,
I am new to greensock so please bear with! I am trying to get a basic gsap/scrolltrigger combo working on a vue spa. I have included the code in the mounted() section of the containing app.vue file and works as expected
.animin {
opacity:0;
}
gsap.defaults({
duration: 1,
ease: "power2"
})
ScrollTrigger.defaults({
toggleActions: "play none none reverse",
start: "top 95%",
})
if(document.querySelector('.animin')) {
gsap.set( ".animin", { visibility: "visible", opacity: 1 });
}
But when you navigate away from a page and back to it, the code no longer fires, so all the items with animin remain 'opacity: 0'. I put the code in the containing app.vue as want it to work across the site, but how do I set it in such a way that it is aware of the users movements between pages etc?