Skip to main content

organisms

HeroTriggers

Hero triggers module — supplies HERO_TRIGGER to AbstractSectionTriggers and overrides bind() to inject the intro timeline as the ScrollTrigger animation ONLY when scrubbed; pin and scrub are currently off, so the lifecycle (onEnter → playIntro) owns the reveal. bind() also creates a second, dedicated ScrollTrigger (hero-outro-pin) that pins the section root for HERO_OUTRO.pinRatio × viewport height and scrubs the outro timeline (line fade) to completion, snapping to each beat's label. bind() also creates one scrubbed hero-band-parallax-<index> trigger per band that holds an image (band-motion/parallax), and one unpinned hero-statement-<index> trigger per statement section (not the header) that plays the statement's SVG reveal when its top is 60% down the viewport. kill() tears them down.

HERO_TRIGGER extends SCROLL_DEFAULTS; start: "top top", end: "bottom bottom". pin/scrub currently false (ScrollTrigger complexity evaluation — kept).

bind() hands the intro timeline to the ScrollTrigger as animation only when scrub is truthy. Unscrubbed (current state), it omits animation so the lifecycle drives the reveal via onEnter → playIntro. Passing both while unscrubbed would double-drive the same timeline (jitter) — see AbstractSection.playIntro early-return on scrub.

To re-enable scrub: flip scrub: true in HERO_TRIGGER — the animation handoff then re-activates automatically.

Hero degrades cleanly without scrub: discrete intro fires once on enter.

Outro pin (hero-outro-pin)

Currently inert. The active split variant no longer supplies a buildOutro
(see hero-motion.js), so the outro
timeline is the base class’s empty one and _bindOutroPin() returns before
creating the trigger. No pin, no scrub. The wiring below is
retained and re-activates the moment a buildOutro is restored.

Separate from HERO_TRIGGER on purpose: flipping scrub on the base trigger would hand it the intro timeline (see bind() above), and its end: "bottom bottom" would pin the full section height, not a short exit beat. _bindOutroPin() instead creates its own ScrollTrigger:

Called at the end of bind(), re-entrant like the base trigger (_outroPin?.kill() first), and killed in kill()

The now-removed hero-aside-reveal ScrollTrigger (previously in split.js, fired once at top 80%) is gone: the aside’s entrance is now owned entirely by this pin’s fourth beat, since the old reveal’s trigger point was inside the scroll range this pin now occupies.

Band parallax (hero-band-parallax-<index>)

_bindBandParallax() runs at the end of bind(). It finds every [data-hero-el="band"] in the section and calls createBandParallax for each one, passing its [data-hero-el="band-image"], HERO_BAND_PARALLAX_TRIGGER (SCROLL_DEFAULTS plus top bottom → bottom top, scrub: true, once: false), and HERO_BAND_PARALLAX.yPercent. A band without an image gets a no-op handle. The handles are killed before every rebind and in kill().

Statement triggers (hero-statement-<index>)

_bindStatementTriggers() runs in bind(), right after the base trigger and before the outro pin and band parallax. It makes one ScrollTrigger per statement section ([data-hero-el="mission-statement"]) that holds a prepared SVG ([data-hero-el="statement-svg"]), in document order. The trigger element is the SVG’s <figure>, not the section. A statement with no SVG gets no trigger, and the header is deliberately left out. Each uses HERO_STATEMENT_TRIGGER: start: "bottom bottom" (the figure’s bottom at the bottom of the viewport, so the whole figure is in view; a figure taller than the viewport fires once its bottom scrolls in), end: "bottom top", pin: false, pinSpacing: false, once: false. Nothing is pinned: the statements scroll with the page.

Reduced motion