From 0b69188997f7995e894a4aad3fe84f23e18514fe Mon Sep 17 00:00:00 2001 From: philipcheung Date: Sat, 1 Nov 2025 23:08:36 +0800 Subject: [PATCH] info component added animations with framer-motion --- src/components/new_ui/info.tsx | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/components/new_ui/info.tsx b/src/components/new_ui/info.tsx index 3967c5f..d8cd424 100644 --- a/src/components/new_ui/info.tsx +++ b/src/components/new_ui/info.tsx @@ -1,5 +1,11 @@ import { Box, Stack, Image, Flex, Text } from '@chakra-ui/react' import { useState } from 'react' +import { motion } from 'framer-motion' + +const MotionStack = motion.create(Stack) +const MotionImage = motion.create(Image) +const MotionFlex = motion.create(Flex) +const MotionBox = motion.create(Box) interface InfoData { id: number @@ -70,19 +76,27 @@ function Info() { justifyItems={'center'} > - - - {infoData.map((info) => ( + {infoData.map((info, index) => ( ))} - + - info.id === selectedInfo)?.image} @@ -140,7 +157,7 @@ function Info() { {renderDescription(infoData.find(info => info.id === selectedInfo)?.description || '')} - + )