From cddac9184249d60934c82758b32c0366085aaa63 Mon Sep 17 00:00:00 2001 From: Frad LEE Date: Sat, 13 Apr 2024 21:41:04 +0800 Subject: [PATCH] fix(landing): dot circle animaiton - Refactored DotCircle component to use useState hook for managing hover state. - Updated arrow animation to use useState hook for hover effect. - Added animationCircleDelay and animationArrowDelay variables for better readability. --- components/Landing/Hero/DotCircle.tsx | 33 ++++++++++++++++----------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/components/Landing/Hero/DotCircle.tsx b/components/Landing/Hero/DotCircle.tsx index e2e6ffa..a26ff36 100644 --- a/components/Landing/Hero/DotCircle.tsx +++ b/components/Landing/Hero/DotCircle.tsx @@ -1,30 +1,37 @@ +import { useState } from 'react' + import { motion } from 'framer-motion' import { CursorProvider, CursorType } from '@/components/common/CursorProvider' -import { - primaryTransition, - secondaryTransition, -} from '@/utils/motion/springTransitions' +import { primaryTransition } from '@/utils/motion/springTransitions' interface IDotCircleProps { isInteractive?: boolean } function DotCircle({ isInteractive }: IDotCircleProps) { + let animationCircleDelay = 2.5 + let animationArrowDelay = 0.6 + const [hovered, setHovered] = useState(false) + return ( -
- setHovered(true)} + onHoverEnd={() => setHovered(false)} + className="absolute -bottom-20 -right-20 z-30 h-24 w-24 scale-75 hover:cursor-pointer lg:-bottom-20 lg:-right-24 lg:scale-100" + > + @@ -34,14 +41,14 @@ function DotCircle({ isInteractive }: IDotCircleProps) { -
+
) }