"use client"; import React, { useEffect, useRef } from "react"; import gsap from "gsap"; import { ScrollTrigger } from "gsap/ScrollTrigger"; gsap.registerPlugin(ScrollTrigger); type HeadlineProps = { text: string; }; const Headline: React.FC = ({ text }) => { const headlineRef = useRef(null); useEffect(() => { if (!headlineRef.current) return; gsap.from(headlineRef.current, { y: 80, opacity: 0, duration: 1, ease: "expo.out", scrollTrigger: { trigger: headlineRef.current, start: "top 90%", toggleActions: "play none none none", }, }); }, []); return (
{text}
); }; export default Headline;