Motion Lab / Heroes / parallax layers / editorial
// Mechanisme: hero-parallax-layers-editorial import gsap from 'https://esm.sh/[email protected]'; // Pas toe op je eigen selector — geen stijlkeuzes hier. import gsap from 'https://esm.sh/[email protected]'; import{ScrollTrigger}from 'https://esm.sh/[email protected]/ScrollTrigger'; gsap.registerPlugin(ScrollTrigger); if(window.matchMedia('(prefers-reduced-motion: reduce)').matches)return; gsap.to('.parallax-bg',{yPercent:-25,ease:'none',scrollTrigger:{trigger:'.parallax-section',start:'top bottom',end:'bottom top',scrub:0.8}}); gsap.to('.parallax-fg',{yPercent:-10,ease:'none',scrollTrigger:{trigger:'.parallax-section',start:'top bottom',end:'bottom top',scrub:1.2}});
<!-- Skeleton: hero-parallax-layers-editorial --> <div class="demo-block"> <!-- DOM-structuur hier --> </div>
/* Styling: hero-parallax-layers-editorial */
:root {
--block-bg: ;
--block-fg: ;
--block-accent: ;
}