onMounted(() => {
ctx = gsap.context((self) => {
if (self.selector) {
const teasers = self.selector('.teaser');
ScrollTrigger.batch(teasers, {
onEnter: (batch) =>
gsap.to(batch, {
filter: 'blur(0px)',
autoAlpha: 1,
y: 0,
stagger: {
each: 0.1,
onComplete() {
console.log(this.targets[0]);
},
},
}),
});
}
}, main.value); // <- Scope!
});
onUnmounted(() => {
ctx.revert(); // <- Easy Cleanup!
});
onMounted(() => {
ctx = gsap.context((self) => {
if (self.selector) {
const teasers = self.selector('.teaser');
ScrollTrigger.batch(teasers, {
onEnter: (batch) =>
gsap.to(batch, {
filter: 'blur(0px)',
autoAlpha: 1,
y: 0,
stagger: {
each: 0.1,
onComplete() {
console.log(this.targets[0]);
},
},
}),
});
}
}, main.value); // <- Scope!
});
onUnmounted(() => {
ctx.revert(); // <- Easy Cleanup!
});