For anyone that wonders, it works! But it took me a few tries to make the bot learn what i wanted it do do.
Sure, i might have confused it a couple of times, but it's an AI. So hopefully it learns by each creation we assign it to.
If anyone wanna see the conversation i had with it, check it out here. Although it's a pretty long read. (i noticed that i couldn't paste the url itself without it generating the image inside the post, so you might have to right click and open it yourself).
Either way, try it out for yourself!
Here is the working example it eventually generated for me, as i wanted it to work.
// Trigger the animation when the .test element is in view
gsap.to(".test", {
scale: 1.1,
duration: 1,
yoyo: true,
ease: "power1.inOut",
repeat: 1, // Repeat the animation once on enter and once on re-entry
scrollTrigger: {
trigger: ".test",
start: "top center",
end: "bottom center",
scrub: true, // Smoothly progress through the animation while scrolling
onEnter: () => {
gsap.to(".test", {
scale: 1,
duration: 1,
ease: "power1.inOut",
});
},
onEnterBack: () => {
gsap.to(".test", {
scale: 1,
duration: 1,
ease: "power1.inOut",
});
},
},
});