Add the class .gomo-parallax toa a cover block
require get_theme_file_path('/components/gsap/gsap.php') ;
// and in gsap.js
function initGomoParallax() {
gsap.utils.toArray(".gomo-parallax").forEach(function (coverParallax) {
var imageParallax = document.getElementsByClassName(
"wp-block-cover__image-background"
);
gsap
.timeline({
scrollTrigger: {
trigger: coverParallax,
scrub: true,
start: "top bottom",
end: "bottom top",
// markers: true,
},
})
.fromTo(
imageParallax,
{
y: -100,
scale: 1.5,
},
{ y: 100, scale: 1.5, ease: "none" },
0
);
});
}