import { Box, Stack, Image, Flex, useBreakpointValue, Text } from '@chakra-ui/react'
import { colors } from '../colors';
import {motion, useInView } from 'framer-motion'
import { useRef } from 'react'
// Create motion components from Chakra components
const MotionStack = motion(Stack);
const footerText = `守護您和家人的心臟健康,
食得安心,護心更放心!`
function Bestoil() {
const formatText = (text: string) => {
return text.split('\n').map((line, i) => (
{line.split('\t').map((segment, j) => (
j === 0 ? segment : {segment}
))}
{i < text.split('\n').length - 1 &&
}
));
};
const cook = useBreakpointValue({
base: "/images/cook_mb.webp",
sm: "/images/cook_mb.webp",
md: "/images/goldandhealthytext.webp",
});
// Create refs for elements we want to animate
const oilCubesRef = useRef(null);
// Check if elements are in view
const isOilCubesInView = useInView(oilCubesRef, { once: true });
const oilCube = [
{
bgColor: 'linear-gradient(to right,#00609E ,#008FD0,#00609E )',
title: '米糠油',
text: '含天然谷維素,具抗氧化作用,有助維持血管健康'
},
{
bgColor: 'linear-gradient(to right,#D44E2D ,#EAA72E,#D44E2D )',
title: '芥花籽油',
text: '富含多元不飽和脂肪酸Omega-3、6,有助降低心血管疾病風險'
},
{
bgColor: 'linear-gradient(to right,#7DAE3A ,#AFC226,#7DAE3A )',
title: '橄欖油',
text: '富含單元不飽和脂肪酸Omega-9,有助保護心臟健康'
},
{
bgColor: 'linear-gradient(to right,#0098D2 ,#00AFE6,#0098D2 )',
title: '亞麻籽油',
text: '是亞麻酸(Omega-3) 的良好來源,有助維持細胞健康'
},
{
bgColor: 'linear-gradient(to right,#D23431 ,#E28C24,#D23431 )',
title: '高油酸葵花籽油',
text: '低飽和脂肪,穩定性高,適合高溫烹調'
},
]
return (
{"不同食油的脂肪酸組合各有優勢,而長期使用單一油種則可能令營養失衡。營萃護心油融合5種優質食油,發揮更全面的健康效益:"}
{oilCube.map((item, index) => (
{item.title}
{item.text}
))}
{formatText(footerText)}
)
}
export default Bestoil