From f0bdc8de3ea3333b02acf7dab54b456faecbe2c5 Mon Sep 17 00:00:00 2001 From: Kakabay <2kakabayashyrberdyew@gmail.com> Date: Wed, 8 Jan 2025 18:33:42 +0500 Subject: [PATCH] animated text added on lottery page --- components/common/AnimatedText.tsx | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/components/common/AnimatedText.tsx b/components/common/AnimatedText.tsx index 6e6947a..909bb0a 100644 --- a/components/common/AnimatedText.tsx +++ b/components/common/AnimatedText.tsx @@ -4,45 +4,47 @@ import { motion } from 'framer-motion'; interface AnimatedTextProps { text: string; className?: string; - wordClassName?: string; + characterClassName?: string; initialY?: number; - duration?: number; - wordDelay?: number; + exitY?: number; + duration: number; + characterDelay?: number; } const AnimatedText = ({ text, className = '', - wordClassName = '', + characterClassName = '', initialY = -100, - duration = 0.5, - wordDelay = 0.2, + exitY = 100, + duration, + characterDelay = 0, }: AnimatedTextProps) => { - const words = text.split(' '); + const characters = text.split(''); return (
- {words.map((word, i) => ( - + {characters.map((character, i) => ( + - {word} - + {character} + ))}