diff --git a/src/app/_components/Animated/AnimateIn.tsx b/src/app/_components/Animated/AnimateIn.tsx index 5130df9..915abf9 100644 --- a/src/app/_components/Animated/AnimateIn.tsx +++ b/src/app/_components/Animated/AnimateIn.tsx @@ -8,7 +8,7 @@ import gsap from 'gsap' const AnimateTextIn = ({children,animation="type",position}:{children:ReactNode,animation?:"type"|"slide",position:gsap.Position}) => { const el = useRef(null) const gsapContext = useGsapContext(); - useEffect(() => { + useLayoutEffect(() => { console.log("aniamte text with:",position) const tl = gsap.timeline(); const chars = new SplitText(el.current,{type:'chars'}) diff --git a/src/app/_components/Animated/AnimatedPageTitle.tsx b/src/app/_components/Animated/AnimatedPageTitle.tsx index f99016b..850ebab 100644 --- a/src/app/_components/Animated/AnimatedPageTitle.tsx +++ b/src/app/_components/Animated/AnimatedPageTitle.tsx @@ -7,7 +7,7 @@ const AnimatedPageTitle = ( ) => { const el = useRef(null) const gsapContext = useGsapContext(); - useEffect(() => { + useLayoutEffect(() => { console.log("add animated title with:",position) const split = new SplitText(el.current, { type: "chars" }) gsapContext?.addAnimation(gsap.to(el.current, { opacity: 100 }),position)