working animations

This commit is contained in:
2026-03-13 22:18:44 +01:00
parent d71bb5d26e
commit 4293eef824
8 changed files with 44 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
import { useGSAP } from "@gsap/react";
import { useLayoutEffect,
import { useEffect,
useLayoutEffect,
useRef, type ReactNode } from "react";
import { useGsapContext } from "~/app/_providers/GsapProvicer";
import { SplitText } from "gsap/SplitText";
@@ -7,7 +8,7 @@ import gsap from 'gsap'
const AnimateTextIn = ({children,animation="type",position}:{children:ReactNode,animation?:"type"|"slide",position:gsap.Position}) => {
const el = useRef<HTMLDivElement>(null)
const gsapContext = useGsapContext();
useGSAP(() => {
useEffect(() => {
console.log("aniamte text with:",position)
const tl = gsap.timeline();
const chars = new SplitText(el.current,{type:'chars'})