Arch Parallax Columns: Sticky Text and Two Arch-Masked Photo Columns at Two Scroll Speeds
Goal
Build a white section with a sticky text column on the left (a short headline and one paragraph, vertically centred in the viewport) and, on the right, two columns of three photos each in round-arch masks (semicircular top, square bottom). As the section scrolls through the viewport the two columns rise at different speeds (scrubbed: the first by 0.55 of the viewport height, the second by 0.25), so they drift apart, and each photo zooms gently from 1.18 to 1.02 inside its arch. There is empty white space above and below the section so the page can scroll. On mobile the text stacks on top, the two columns sit side by side and the offsets halve.
Tech
Vanilla HTML/CSS/JS with ES module imports. gsap (npm) and gsap/ScrollTrigger. Font: Schibsted Grotesk (500 headline, 400 body).
Layout / HTML
<div class="ap">
<div class="ap-spacer" aria-hidden="true"></div>
<section class="ap-section" data-ap>
<div class="ap-left">
<div class="ap-sticky">
<h2 class="ap-title">Every project has a name and an address.</h2>
<p class="ap-text">Saplings on a hillside, a village workshop, a terraced garden. You see where the money goes before it goes.</p>
</div>
</div>
<div class="ap-right">
<div class="ap-col" data-ap-col="a">
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-1.jpg" alt="…" /></figure>
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-3.jpg" alt="…" /></figure>
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-5.jpg" alt="…" /></figure>
</div>
<div class="ap-col ap-col--b" data-ap-col="b">
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-2.jpg" alt="…" /></figure>
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-4.jpg" alt="…" /></figure>
<figure class="ap-arch"><img src="/c/arch-parallax-columns/proy-6.jpg" alt="…" /></figure>
</div>
</div>
</section>
<div class="ap-spacer" aria-hidden="true"></div>
</div>
Styling
:root: --ap-bg:#fff, --ap-ink:#0a0a0a, --ap-muted:#6b6b6b, --ap-arch-w:clamp(130px,18.5vw,270px).
.ap-spacer:height:70svh..ap-section:display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:200svh; overflow:clip(clip, nothidden, so the sticky child still sticks)..ap-sticky:position:sticky; top:0; height:100svh, flex column centred,gap:1.5rem,padding:0 clamp(1.25rem,5vw,4.5rem)..ap-title:max-width:14ch; font-size:clamp(2rem,4.4vw,4.2rem); font-weight:500; line-height:1; letter-spacing:-.04em..ap-text:max-width:32ch,clamp(1rem,1.3vw,1.2rem),line-height:1.45,--ap-muted..ap-right: flex, centred,gap:clamp(.75rem,4vw,3.75rem),padding:30svh clamp(1rem,3vw,3rem) 0..ap-col: flex column,gap:clamp(3rem,9vw,8rem),width:var(--ap-arch-w),will-change:transform..ap-col--b:margin-top:12svhso the columns start out of step..ap-arch:aspect-ratio:270/385; border-radius:calc(var(--ap-arch-w)/2) calc(var(--ap-arch-w)/2) 0 0; overflow:hidden; background:#eee. The image fills it withobject-fit:coverand starts atscale(1.12).- Under 720px: one grid column, sticky becomes static with padding, columns
calc(50vw - 1.6rem)wide and the arch radius follows that width. prefers-reduced-motion: reduce: images atscale(1.04).
GSAP effect (be exact)
Build in mount(config) → destroy().
const DEFAULTS = { fast: 0.55, slow: 0.25, zoomFrom: 1.18, zoomTo: 1.02 };
Inside gsap.matchMedia() with desk: "(min-width: 721px)" and mob: "(max-width: 720px)" (factor f = 1 on desktop, .5 on mobile):
- shared trigger
{ trigger: section, start: "top bottom", end: "bottom top", scrub: true, invalidateOnRefresh: true }; - column A:
fromTo({ y: 0 }, { y: () => -innerHeight * fast * f, ease: "none" }); - column B: same with
slow; - each image:
fromTo({ scale: zoomFrom }, { scale: zoomTo, ease: "none", scrollTrigger: { trigger: its arch, start: "top bottom", end: "bottom 40%", scrub: true } }).
ScrollTrigger.refresh() on load (images change heights). If prefers-reduced-motion: reduce matches, nothing is created.
destroy(): remove the load listener and mm.revert() (kills every tween and trigger and restores inline styles).
Assets / images
Six portrait photos (270 × 385 JPEG), root-absolute, split across the columns (odd in A, even in B): /c/arch-parallax-columns/proy-1.jpg … /c/arch-parallax-columns/proy-6.jpg.
Behavior notes
scrub: truewelds the columns to the scroll position: stop scrolling and they stop in the same frame.- Function-based
ywithinvalidateOnRefreshrecalculates the travel when the viewport height changes. - The zoom lives on the
<img>while the mask lives on the figure, so the arch outline never moves relative to its column. - Only the prefixed variables are global.
Using this outside its demo page
This component is written as a complete page: that is how the demo is meant to look. If you are dropping it into an existing project, or combining it with other components, these are the things it declares at document level and that you need to move or reconcile first.
- Palette on
:root:--ap-bg,--ap-ink,--ap-muted,--ap-arch-w. Generic names like--ink,--paperor--mutedare defined by many components in this catalogue with different values, and they will also collide with whatever your own project defines. Move them onto the component's wrapper (.my-section { --ink: … }) or keep the prefix. - **Rules on
*, *::before, *::after,html, body**: the demo owns the whole document, so these set the box model and resets. Dropped into an existing project they restyle the entire page, not just this section. Re-target them at the component's wrapper before using it.