diff --git a/public/images/new/1.webp b/public/images/new/1.webp new file mode 100644 index 0000000..bb12f1a Binary files /dev/null and b/public/images/new/1.webp differ diff --git a/public/images/new/2.webp b/public/images/new/2.webp new file mode 100644 index 0000000..c09749a Binary files /dev/null and b/public/images/new/2.webp differ diff --git a/public/images/new/3.webp b/public/images/new/3.webp new file mode 100644 index 0000000..61dc2be Binary files /dev/null and b/public/images/new/3.webp differ diff --git a/public/images/new/4.webp b/public/images/new/4.webp new file mode 100644 index 0000000..b88c197 Binary files /dev/null and b/public/images/new/4.webp differ diff --git a/public/images/new/adv1.webp b/public/images/new/adv1.webp new file mode 100644 index 0000000..579cefc Binary files /dev/null and b/public/images/new/adv1.webp differ diff --git a/public/images/new/adv2.webp b/public/images/new/adv2.webp new file mode 100644 index 0000000..d511731 Binary files /dev/null and b/public/images/new/adv2.webp differ diff --git a/public/images/new/adv3.webp b/public/images/new/adv3.webp new file mode 100644 index 0000000..dc317a0 Binary files /dev/null and b/public/images/new/adv3.webp differ diff --git a/public/images/new/adv4.webp b/public/images/new/adv4.webp new file mode 100644 index 0000000..a90fb04 Binary files /dev/null and b/public/images/new/adv4.webp differ diff --git a/public/images/new/adv_img1.webp b/public/images/new/adv_img1.webp new file mode 100644 index 0000000..002a285 Binary files /dev/null and b/public/images/new/adv_img1.webp differ diff --git a/public/images/new/adv_img2.webp b/public/images/new/adv_img2.webp new file mode 100644 index 0000000..2d733e9 Binary files /dev/null and b/public/images/new/adv_img2.webp differ diff --git a/public/images/new/adv_img3.webp b/public/images/new/adv_img3.webp new file mode 100644 index 0000000..d2cf310 Binary files /dev/null and b/public/images/new/adv_img3.webp differ diff --git a/public/images/new/adv_img4.webp b/public/images/new/adv_img4.webp new file mode 100644 index 0000000..94b967b Binary files /dev/null and b/public/images/new/adv_img4.webp differ diff --git a/src/components/new_ui/advantages.tsx b/src/components/new_ui/advantages.tsx new file mode 100644 index 0000000..57e9a3f --- /dev/null +++ b/src/components/new_ui/advantages.tsx @@ -0,0 +1,149 @@ +import { Box, Stack, Image, Flex, Text, SimpleGrid } from '@chakra-ui/react' +import { useState } from 'react' +import { motion } from 'framer-motion' + +const MotionImage = motion.create(Image) +const MotionFlex = motion.create(Flex) +const MotionBox = motion.create(Box) + +interface InfoData { + id: number + title: string + image: string + titleImage: string + titleImage2: string + description: string +} + +const info = [ + { + id: 1, + title: "減少壞膽固醇", + description: `**根據世界衛生組織數據,高反式脂肪攝取可令全因死亡率上升34%,**冠心病發病率上升21%,及死亡率上升24%。全球每年因反式脂肪導致心血管疾病死亡病例已高達54萬人1。 + +獅球嘜營萃護心油每食用份量含0克反式脂肪,有助減少壞膽固醇,減低患心臟病嘅風險。`, + image: "/images/new/1.webp", + titleImage: "/images/new/adv_img1.webp", + titleImage2: "/images/new/adv1.webp" + }, + { + id: 2, + title: "黃金比例脂肪酸調配", + description: `根據世衛建議,脂肪攝取應以不飽和脂肪為主,當中包括多元與單元不飽和脂肪酸,同時應減少飽和脂肪攝取,以維持整體健康比例。 + +獅球嘜營萃護心油就係根據呢個原則調配出符合黃金比例嘅配方,幫助身體攝取每日必需嘅脂肪酸,並促進脂溶性維他命A、D、E、K嘅吸收,全面支援日常健康所需。 `, + image: "/images/new/2.webp", + titleImage: "/images/new/adv_img2.webp", + titleImage2: "/images/new/adv2.webp" + }, + { + id: 3, + title: "比一般食油", + description: `Omega-3有助降低三酸甘油脂水平,並喺一定程度上減少血管發炎反應,從而支援血管彈性及正常血液循環,為心臟健康打好基礎。 + +獅球嘜營萃護心油內嘅Omega-3比例較一般花生油及粟米油高,特別有助經常外出用餐嘅都市人平衡脂肪酸攝取比例,從而支援心血管健康。 `, + image: "/images/new/3.webp", + titleImage: "/images/new/adv_img3.webp", + titleImage2: "/images/new/adv3.webp" + }, + { + id: 4, + title: "功效更全面", + description: "", + image: "/images/new/4.webp", + titleImage: "/images/new/adv_img4.webp", + titleImage2: "/images/new/adv4.webp" + } +]; + + +const renderDescription = (text: string) => { + const parts = text.split(/(\*\*.*?\*\*)/) + + return parts.map((part, index) => { + if (part.startsWith('**') && part.endsWith('**')) { + return ( + + {part.slice(2, -2)} + + ) + } + return {part} + }) +} + + +function Advantages() { + + + return ( + + + + {info.map((item) => ( + + + + + + + {item.title} + + + + + {renderDescription(item.description)} + + + + ))} + + + + + + ) +} + +export default Advantages; \ No newline at end of file diff --git a/src/components/new_ui/info.tsx b/src/components/new_ui/info.tsx index d8cd424..d74ed48 100644 --- a/src/components/new_ui/info.tsx +++ b/src/components/new_ui/info.tsx @@ -2,7 +2,6 @@ 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) @@ -96,7 +95,7 @@ function Info() { viewport={{ once: true, amount: 0.3 }} transition={{ duration: 0.8, delay: 0.2, ease: "easeOut" }} > - {infoData.map((info, index) => ( + {infoData.map((info) => ( + ) }