working animations
This commit is contained in:
@@ -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'})
|
||||
|
||||
Reference in New Issue
Block a user