import
import { useEffect, useRef } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
const MyComponent = () => {
const boxRef = useRef(null);
useEffect(() => {
gsap.registerPlugin(ScrollTrigger);
gsap.from(boxRef.current, {
opacity: 0,
y: 50,
duration: 0.5,
scrollTrigger: {
trigger: boxRef.current,
start: "top 80%",
end: "bottom 20%",
toggleActions: "play none none reverse",
},
});
}, []);
return (
<section className="pt-2 pl-8 pr-5">
<ul className="flex flex-wrap w-full justify-between">
<li ref={boxRef} className="w-full lg:w-[49%] 2xl:w-[32.5%] bg-white mb-5 rounded-lg">
<MainCard />
</li>
</ul>
</section>
);
};
export default MyComponent;