diff --git a/public/images/new/button.webp b/public/images/new/button.webp new file mode 100644 index 0000000..4380231 Binary files /dev/null and b/public/images/new/button.webp differ diff --git a/public/images/new/buttons.webp b/public/images/new/button_focus.webp similarity index 100% rename from public/images/new/buttons.webp rename to public/images/new/button_focus.webp diff --git a/public/images/new/info_1.webp b/public/images/new/info_1.webp new file mode 100644 index 0000000..fc0f3bc Binary files /dev/null and b/public/images/new/info_1.webp differ diff --git a/public/images/new/info_2.webp b/public/images/new/info_2.webp new file mode 100644 index 0000000..6072764 Binary files /dev/null and b/public/images/new/info_2.webp differ diff --git a/public/images/new/info_3.webp b/public/images/new/info_3.webp new file mode 100644 index 0000000..ac8a893 Binary files /dev/null and b/public/images/new/info_3.webp differ diff --git a/public/images/new/info_4.webp b/public/images/new/info_4.webp new file mode 100644 index 0000000..efc4a1f Binary files /dev/null and b/public/images/new/info_4.webp differ diff --git a/src/components/new_ui/info.tsx b/src/components/new_ui/info.tsx new file mode 100644 index 0000000..ef33c1c --- /dev/null +++ b/src/components/new_ui/info.tsx @@ -0,0 +1,123 @@ +import { Box, Stack, Image, Flex, Text } from '@chakra-ui/react' +import { useState } from 'react' + +interface InfoData { + id: number + title: string + image: string + description: string +} + +const infoData: InfoData[] = [ + { + id: 1, + title: '膽固醇\n超標', + image: '/images/new/info_1.webp', + description: '長期攝取過多飽和脂肪及反式脂肪(例如牛油、加工食品、或重複使用煎炸油),會令體內壞膽固醇(LDL)上升、好膽固醇(HDL)下降,導致膽固醇積聚喺血管內壁,形成血塊塞血管,有機會引致中風、心肌梗塞,甚至心臟病等嚴重後果。' + }, + { + id: 2, + title: '中央肥胖\n脂肪肝', + image: '/images/new/info_2.webp', + description: '長期攝取過多飽和脂肪及反式脂肪(例如牛油、加工食品、或重複使用煎炸油),會令體內壞膽固醇(LDL)上升、好膽固醇(HDL)下降,導致膽固醇積聚喺血管內壁,形成血塊塞血管,有機會引致中風、心肌梗塞,甚至心臟病等嚴重後果。' + }, + { + id: 3, + title: '皮膚暗啞\n容易脫髮', + image: '/images/new/info_3.webp', + description: '長期攝取過多飽和脂肪及反式脂肪(例如牛油、加工食品、或重複使用煎炸油),會令體內壞膽固醇(LDL)上升、好膽固醇(HDL)下降,導致膽固醇積聚喺血管內壁,形成血塊塞血管,有機會引致中風、心肌梗塞,甚至心臟病等嚴重後果。' + }, + { + id: 4, + title: '經常容易\n覺得疲倦', + image: '/images/new/info_4.webp', + description: '長期攝取過多飽和脂肪及反式脂肪(例如牛油、加工食品、或重複使用煎炸油),會令體內壞膽固醇(LDL)上升、好膽固醇(HDL)下降,導致膽固醇積聚喺血管內壁,形成血塊塞血管,有機會引致中風、心肌梗塞,甚至心臟病等嚴重後果。' + } +] + +function Info() { + const [selectedInfo, setSelectedInfo] = useState(1) + + return ( + + + + + + {infoData.map((info) => ( + // buttons + setSelectedInfo(info.id)} + bg={selectedInfo === info.id ? '#3D6741' : '#D4D4D4'} + border="4px solid #99BF35" + borderRadius={{ base: '20px', sm: '20px', md: '18px', lg: '16px', xl: '14px' }} + display="flex" + alignItems="center" + justifyContent="center" + textAlign="center" + className="font-melle font-xbold" + fontSize={{ base: '4vw', sm: '4vw', md: '1.8vw', lg: '1.2vw', xl: '1vw' }} + color={selectedInfo === info.id ? '#FFFFFF' : '#333333'} + whiteSpace="pre-line" + lineHeight="1.2" + transition="all 0.3s ease" + px={2} + > + {info.title} + + ))} + + + + info.id === selectedInfo)?.image} + w="100%" + transition="all 0.3s ease" + /> + + + {infoData.find(info => info.id === selectedInfo)?.description} + + + + + + ) +} + +export default Info; \ No newline at end of file diff --git a/src/pages/main.tsx b/src/pages/main.tsx index 8441ee8..496270d 100644 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -2,6 +2,7 @@ import Hero1 from '../components/new_ui/hero1' import Hero2 from '../components/new_ui/hero2' import Wraning from '@/components/new_ui/wraning' +import Info from '@/components/new_ui/info' @@ -12,6 +13,7 @@ function MainPage() { + ) }