Hello, I've got a weird bug. When I've added ScrollTrigger for animating each sections I've also noticed that scrolling on mobile device by touching screen is really bugged after loading the page. ( I'm using IP11Pro, I just can't test the page on android device ).
Do you have an idea why is something like that happening?
This is deployed page:
https://olgajedrzejewska.netlify.app/
The page is created with GatsbyJS.
I've just put the code in global index.js and I'm returning each single component below the useEffect.
This is a simple animation for each first div in section with class .animated:
export default function Home({ data }) {
useEffect(() => {
const sections = document.querySelectorAll(".animated");
sections.forEach((section) => {
gsap.fromTo(
section.children,
{ y: "+=150", opacity: 0 },
{
y: 0,
opacity: 1,
stagger: 0.2,
duration: 0.8,
ease: "easeInOut",
scrollTrigger: {
trigger: section,
start: "-10% 76%",
},
}
);
});
});
return (
<Layout>
<Hero />
<Info />
<About />
<AboutSecond />
<History />
<Family />
<Science />
<School />
<Cards />
<Helping />
<Numbers />
<Hours />
<Pricing />
<Contact />
<Footer />
</Layout>
);
}