From b5291caa6e7b2be98ed0265a0f51af8d05918823 Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Fri, 13 Mar 2026 22:24:12 +0100 Subject: [PATCH] working animations --- src/app/_components/Animated/AnimateIn.tsx | 2 +- src/app/_components/Animated/AnimatedPageTitle.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)