import gsap from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useLayoutEffect } from "react";
gsap.registerPlugin(ScrollTrigger);
function Home() {
useLayoutEffect(() => {
let tl = gsap.timeline({
defaults: {
immediateRender: false,
},
});
tl.to(".animaition-112", {
opacity: 1,
y: 0,
scrollTrigger: {
trigger: ".animaition-112",
start: "top center",
end: "center 30%",
markers: true,
},
});
return () => {
tl.kill();
};
}, []);
return <></>
}
why scrolltrigger animation is not working and triggering mechanism is worked and there is no transition.
if i leave timeline and use gsap.to() that will work what can i do there. help please.