From 6fff7afabb9665b759866bf06073880ef9253674 Mon Sep 17 00:00:00 2001 From: imnyang Date: Thu, 23 Oct 2025 22:30:26 +0900 Subject: [PATCH] chore(ui): remove AnimatedTextCycle component --- src/components/ui/animated-text-cycle.tsx | 112 ---------------------- 1 file changed, 112 deletions(-) delete mode 100644 src/components/ui/animated-text-cycle.tsx diff --git a/src/components/ui/animated-text-cycle.tsx b/src/components/ui/animated-text-cycle.tsx deleted file mode 100644 index 9c00fef..0000000 --- a/src/components/ui/animated-text-cycle.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import * as React from "react"; -import { useState, useEffect, useRef } from "react"; -import { motion, AnimatePresence } from "framer-motion"; - -interface AnimatedTextCycleProps { - words: string[]; - interval?: number; - className?: string; -} - -export default function AnimatedTextCycle({ - words, - interval = 5000, - className = "", -}: AnimatedTextCycleProps) { - const [currentIndex, setCurrentIndex] = useState(0); - const [width, setWidth] = useState("auto"); - const measureRef = useRef(null); - - // Get the width of the current word - useEffect(() => { - if (measureRef.current) { - const elements = measureRef.current.children; - if (elements.length > currentIndex) { - // Add a small buffer (10px) to prevent text wrapping - const newWidth = elements[currentIndex].getBoundingClientRect().width; - setWidth(`${newWidth}px`); - } - } - }, [currentIndex]); - - useEffect(() => { - const timer = setInterval(() => { - setCurrentIndex((prevIndex) => (prevIndex + 1) % words.length); - }, interval); - - return () => clearInterval(timer); - }, [interval, words.length]); - - // Container animation for the whole word - const containerVariants = { - hidden: { - y: -20, - opacity: 0, - filter: "blur(8px)" - }, - visible: { - y: 0, - opacity: 1, - filter: "blur(0px)", - transition: { - duration: 0.4, - ease: "easeOut" - } - }, - exit: { - y: 20, - opacity: 0, - filter: "blur(8px)", - transition: { - duration: 0.3, - ease: "easeIn" - } - }, - }; - - return ( - <> - {/* Hidden measurement div with all words rendered */} - - - {/* Visible animated word */} - - - - {words[currentIndex]} - - - - - ); -} \ No newline at end of file