gsap.registerPlugin(ScrollTrigger, SplitText)
const fastestParallax = document.querySelectorAll('.fastest-parallax') //change this to whatever you want the class to be
fastestParallax.forEach(parallax3 => {
gsap.fromTo(
parallax3,
{ yPercent: 0.01 }, //the bigger the percentage change the faster the movement.
{
yPercent: -10,
ease: 'none',
scrollTrigger: {
trigger: parallax3,
start: 'top 10%',
end: 'bottom 70%',
scrub: true,
markers: false
},
}
);
});
const smallParallax = document.querySelectorAll('.small-parallax') //change this to whatever you want the class to be
smallParallax.forEach(parallax3 => {
gsap.fromTo(
parallax3,
{ yPercent: 6 }, //the bigger the percentage change the faster the movement.
{
yPercent: -40,
ease: 'none',
scrollTrigger: {
trigger: parallax3,
start: 'bottom 96%',
end: 'top 40%',
scrub: true,
markers: false
},
}
);
});