molecules
parallax
Band-Motion factory — scroll-scrubbed parallax for the image inside a clipping band, so the image drifts slower than the band. Returns { kill() }.
createBandParallax({ band, image, trigger, yPercent, index, reduceMotion }) scrubs the image from yPercent: -yPercent to +yPercent with ease: "none". Each band gets its own ScrollTrigger, built from trigger with id ${trigger.id}-${index} and the band as its trigger.
- Caller:
HeroTriggers._bindBandParallax()makes one per[data-hero-el="band"]that holds a[data-hero-el="band-image"]. It passesHERO_BAND_PARALLAX_TRIGGER(top bottom→bottom top,scrub: true,once: false) andHERO_BAND_PARALLAX.yPercent. - Bleed: the image has to extend past the band by more than the travel. band.njk gives it a quarter of the band’s height above and below.
- Lifecycle:
kill()kills the trigger and the tween, then resetsyPercentandwillChange. HeroTriggers calls it on rebind and in its ownkill(). - No image: returns a no-op handle.
The structure mirrors card-motion/parallax.js. The trigger config comes in as a parameter, so this module doesn’t import the organism (HeroTriggers already imports it).
Reduced motion
- The profile system disables hero’s triggers under reduced motion, so this isn’t called.
- The
isReducedMotionguard is a second line of defence. It resets the image and returns a no-op handle.