I am using React Spring for Parallax on a webpage however one of the components higher up on the page <Section2 /> uses flexbox to force 4 large horizontal icons to render as 2 x 2 icons on smaller screens.
When this happens it causes the offset value to be wrong for <Section3> in the mobile view. So the question I have is how do I change the offset value either by a media query or by other means.
Here is my code:
const Home = () => {
return (
<>
<Layout>
<SEO title="Home" />
<Parallax pages={4}>
<ParallaxLayer offset={0} speed={1} style={{ zIndex: '5' }}>
<Hero />
</ParallaxLayer>
<ParallaxLayer offset={0.7} speed={1.4} style={{ zIndex: '10' }}>
<HeroName />
</ParallaxLayer>
<ParallaxLayer
offset={0.8}
speed={0.7}
style={{ zIndex: '-1', backgroundColor: '#fcf7f0' }}
>
<Section1 />
</ParallaxLayer>
<ParallaxLayer offset={1} speed={0.8} style={{ zIndex: '3' }}>
<Section2 />
</ParallaxLayer>
<ParallaxLayer offset={1.2} speed={0.5} >
<Section3 />
</ParallaxLayer>
</Parallax>
</Layout>
</>
);
};
Many thanks