npm i react-scroll-parallax
The plugin itself provides many ways of usage, here we will only show you one of them.
type ParallaxSettingProps = {
children: React.ReactNode;
};
// Moving to left side
const ParallaxSettingLeft: React.FC<ParallaxSettingProps> = ({ children }) => {
return (
<Parallax translateX={[20, -20]} opacity={[0.6, 1]}>
{children}
</Parallax>
);
};
// Moving to right side
const ParallaxSettingRight: React.FC<ParallaxSettingProps> = ({ children }) => {
return (
<Parallax translateX={[-20, 20]} opacity={[0.6, 1]}>
{children}
</Parallax>
);
};
// Moving from low to up
const ParallaxSettingSlow: React.FC<ParallaxSettingProps> = ({ children }) => {
return <Parallax speed={-5}>{children}</Parallax>;
};
// Moving from up to low
const ParallaxSettingFast: React.FC<ParallaxSettingProps> = ({ children }) => {
return <Parallax speed={5}>{children}</Parallax>;
};
const ParallaxSettingRotate: React.FC<ParallaxSettingProps> = ({
children
}) => {
return <Parallax rotate={[-60, 60]}>{children}</Parallax>;
};
<ParallaxSettingSlow>
<Box
fontSize={{ base: '24px', md: isChinese ? '36px' : '26px' }}
mb={3}
>
{t('UnlimitedRebates')}
</Box>
<Box
textAlign="left"
fontSize={{ base: isChinese ? 'auto' : '12px', md: '16px' }}
>
{t('WCGMarketsDoesNotSet')}
</Box>
</ParallaxSettingSlow>
<ParallaxSettingFast>
<Box fontSize={isChinese ? '36px' : '26px'} mb={3}>
{t('ManagementToolsProvided')}
</Box>
<Box textAlign="left">{t('WCGMarketsWillProvide')}</Box>
</ParallaxSettingFast>
| | Amount | Calories | Protein | Fat| Fiber |
May 13, 202509:13/09:06離開機場, 搭乘S1或S8到München Hbf/ Ost車站旁邊的 EDEKA 跟 dm 採買10:55 Hbf/ 11:04 Ost 出發Salzburg, 12:42 抵達
Nov 26, 2024Generate AI
Jun 8, 2024You can later watch this video to recap
May 1, 2024or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up