From 6392ee020ff7171ffec4dd556402a47f0d3a30a1 Mon Sep 17 00:00:00 2001 From: philipcheung Date: Sun, 2 Nov 2025 15:34:48 +0800 Subject: [PATCH] oilInfo component added animation --- src/components/new_ui/oilInfo.tsx | 51 +++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/src/components/new_ui/oilInfo.tsx b/src/components/new_ui/oilInfo.tsx index ec0ebe3..f393c4a 100644 --- a/src/components/new_ui/oilInfo.tsx +++ b/src/components/new_ui/oilInfo.tsx @@ -1,52 +1,79 @@ -import { Box, Stack, Image, Flex, Text, SimpleGrid } from '@chakra-ui/react' +import { Box, Image, SimpleGrid } from '@chakra-ui/react' +import { motion, useInView } from 'framer-motion' +import { useRef } from 'react' + +const MotionImage = motion.create(Image) +const MotionBox = motion.create(Box) +const MotionSimpleGrid = motion.create(SimpleGrid) function OilInfo() { + const mainRef = useRef(null); + const isMainInView = useInView(mainRef, { once: true }); return ( - - - - cooking methods - + - - - + - + - + ) }