185

Counter-Scroll Column Gallery

£7
or the whole Vault, £99

A pinned multi-column photo gallery where alternating columns glide in opposite directions as you scroll, with velocity-coupled column shear, inner image counter-parallax, hover spotlight focus and a full-resolution lightbox.

ScrollTrigger Lenis intermediate
8 more details
pinningscrubparallaxvelocity-reactivelightboxkeyboard-navigationreduced-motionprogressive-enhancement

Released

About this effect

A suite of photographs arranged in four vertical columns on desktop and two on phones, pinned while you scroll through the collection. Odd columns travel upward while even columns descend at the same time, and each column's travel adapts to its own height so every track begins and ends completely filled with zero empty gaps at either edge.

Read the full effect overview

Scroll speed adds a second physical layer: fast flicks lean each column slightly along its direction of travel and shift every photograph inside its cropped frame in counter-parallax, then smooth damping settles the wall back to dead level as soon as you pause. Hovering or focusing any plate lifts it subtly, dims the surrounding columns and reveals its caption; clicking, tapping or pressing Enter opens the full-resolution file in a keyboard-accessible lightbox.

Without JavaScript or under reduced motion, the same ordered list renders as a clean, unpinned responsive grid of linked photographs with captions visible below every image.

Counter-Scroll Column Gallery - GSAP animation effect preview

What's included

9 items
  • Alternating columns glide in opposite directions from one pinned ScrollTrigger, calibrated per column so no track ever leaves empty space at the start or end
  • Velocity-coupled opposing column shear and internal image counter-parallax that react to scroll speed and settle smoothly when scrolling pauses
  • Hover and keyboard focus spotlight that lifts the active photograph, reveals its caption plate and softly dims neighbouring columns
  • Built-in accessible lightbox with on-demand full-resolution loading, Previous/Next/Close controls, Escape and arrow-key navigation, focus trap and focus restoration
  • Progressive enhancement from a plain ordered list of linked photographs: no-JS and prefers-reduced-motion both show a readable multi-column grid
  • Responsive column count (four columns on desktop, two on phones) with automatic layout re-alignment on resize and font load
  • Viewport-gated animation loop that sleeps automatically at rest for zero idle CPU usage
  • Configurable columns, mobile columns, scroll distance, shear amplitude and inner parallax via data attributes
  • Small per-instance API (scrollToProgress, open, close, refresh, revert) plus open and close custom events; supports multiple galleries on one page

Perfect for

4 use cases
  • Architecture, interior design and photography portfolios presenting a curated suite of 16 to 36 plates in one pinned showcase
  • Editorial lookbooks and studio monographs that want opposing rhythm and depth while keeping every image clickable
  • Campaign archives and agency work walls where visitors scan many frames at once and inspect individual full-resolution pieces
  • Exhibition and museum digital catalogues with mixed portrait, square and landscape aspect ratios

How it works

2 sections

The gallery starts as an ordinary semantic ordered list where every item is a link to a full-size photograph wrapping a thumbnail and its caption. Without JavaScript or when reduced motion is preferred, CSS lays that list out as a clean responsive grid and nothing is pinned or moved.

When JavaScript runs with motion enabled, the script distributes the items round-robin across column tracks, measures each track's height against the viewport to find its exact travel span, and pins the stage with ScrollTrigger. A frame-rate-independent ticker eases toward the scroll progress so opposing columns glide smoothly, lean with scroll velocity and shift each inner photograph in counter-parallax, sleeping automatically whenever motion settles. Calling revert() restores every item back to the original list in order and removes all generated nodes, listeners and triggers.

Plugins ScrollTrigger
Difficulty Intermediate
Smooth scroll Lenis integration
Includes HTML + JS + CSS source, documentation, AI setup prompt, lifetime updates

Lighthouse, as measured

Google Lighthouse on this effect's demo, from the latest scan. A measurement of the demo as shipped, not a promise for your page.

Accessibility
100
Best practices
100

No performance score, on purpose. That figure depends on how you deploy: your server's compression and caching, your CDN, the connection and the device doing the test, none of which the code controls. The same page can score very differently on two consecutive runs, so measure it where it will live.

The Vault opens this source and the whole library.

Each product gives you the HTML, CSS and JavaScript source, the full documentation and an AI setup prompt, licensed for unlimited personal and commercial projects. Every paid product is tested for desktop and mobile layouts, reduced-motion handling, animation cleanup and keyboard controls wherever there is something to operate.

One payment, over 350 products, and future additions to the library.

Documentation

Quick Start

1. Add to your HTML <head>:

In your downloadThe working code for this step, in index.html.

2. Add before closing </body> tag:

In your downloadThe working code for this step, in index.html.

3. Add the gallery markup anywhere in your <body>:

In your downloadThe working code for this step, in index.html.

Using It With Your Own Design

What the effect needs from your markup:

  • A wrapper element with data-csg-gallery containing [data-csg-viewport] and an <ol> or <ul> with data-csg-list.
  • Direct children carrying .csg-item, each containing a .csg-card link (whose href points to the full-resolution image) and a .csg-media img thumbnail.
  • Optional [data-csg-count] and [data-csg-progress] elements inside the gallery for the live plate counter and progress bar.
  • Optional data-csg-caption and data-csg-detail attributes on .csg-card for the lightbox caption.

What is only the demo's styling:

  • The warm stone palette (--page, --surface, --ink, --accent), Mona Sans font loading, rounded pill HUD chrome, and top/bottom edge vignettes can all be replaced or removed without affecting the counter-scroll mechanic.
  • You can omit .csg-hud entirely if your page already has its own header or scroll indicator.

CSS the effect depends on:

  • .csg-gallery.is-enhanced .csg-viewport must have a constrained height (such as 100svh) and overflow: hidden so the columns clip cleanly at the top and bottom edges while pinned.
  • .csg-media must keep overflow: hidden and an explicit aspect-ratio (matching the image's natural dimensions) so column heights are exact before images decode and the overscaled img (scale(1.14)) never exposes gaps during inner counter-parallax.
  • .csg-columns uses grid-template-columns: repeat(var(--csg-cols, 4), minmax(0, 1fr)) and .csg-col keeps min-width: 0 so narrow columns never overflow horizontally.
  • .csg-lightbox relies on fixed positioning and .is-open visibility toggling; its data-lenis-prevent attribute is paired with window.lenis.stop() while open.

Options

Attribute Values Default Description
data-enabled true, false true Set to false to disable enhancement and keep the static grid
data-columns Integer >= 2 4 Number of opposing columns at viewports >= 769px
data-mobile-columns Integer >= 2 2 Number of opposing columns at viewports <= 768px
data-scroll-distance Number >= 0.8 2.4 Pinned scroll distance as a multiple of viewport height
data-skew Number >= 0 4.8 Maximum velocity-driven column shear angle in degrees
data-parallax Number >= 0 5.5 Internal image counter-parallax travel in percent

Accessibility

  • No-JS fallback: Every photograph lives inside a standard ordered list of <a href="..."> links; without JavaScript the gallery renders as a static multi-column grid with visible captions and direct links to full-size files.
  • Reduced motion: Under prefers-reduced-motion: reduce, pinning, column counter-scroll, velocity shear and Lenis are bypassed, leaving the static grid while keeping the accessible lightbox working on click or Enter.
  • Keyboard navigation: Tab moves through every plate with a high-contrast :focus-visible ring and triggers the same spotlight focus as hover. Inside the lightbox, ArrowLeft and ArrowRight step through the suite, Tab stays trapped within the dialog controls, and Escape closes the viewer and restores focus to the originating photograph.
  • Touch devices: Switches to a two-column counter-scroll layout with shorter scroll travel and reduced shear; tapping any plate opens the full-resolution viewer.

Dependencies

Required:

  • GSAP 3.12+ (demo built against 3.15.0)
  • ScrollTrigger plugin

Optional:

  • Lenis smooth scroll (1.3.17 in demo; integrates automatically if present, or uses an existing host window.lenis)

Also in your download: the full source, worked examples, the events and programmatic API, and the class reference.

£7