Counter Scrolling Image Bands
A centered statement sits above two full-bleed rows of frames that scroll continuously in opposite directions. Hovering either row pauses its scroll, and clicking any frame opens a framed lightbox with its caption, position in the set, and prev/next/close controls.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its media-slot dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/counter-scrolling-image-bands.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/gallery/gallery7.tsx instead.
Usage
The file also exports gallery7Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Gallery7, gallery7Demo } from "@/components/blocks/gallery/gallery7"; export default function Page() { return <Gallery7 {...gallery7Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Twelve years, one thread" | Heading above the bands. |
| statement | string | "Every frame here was shot on the same street, twelve years apart." | Short statement under the heading. |
| frames | GalleryFrame[] | none | Frames shown across both scrolling bands and the lightbox. |
| speedSeconds | number | 36 | Duration of one full scroll loop, in seconds. |
| className | string | none | Extra classes for the outer section element. |
Types
interface GalleryFrame { id: string; title: string; image?: MediaSlotImage; }
Behavior notes
- The two bands scroll via pure CSS @keyframes (no JS animation loop); hovering either band pauses it using Tailwind's hover: variant on animation-play-state, and motion-reduce:animate-none stops the scroll entirely for users who prefer reduced motion.
- Clicking any frame in either band opens a real client-side lightbox with useState; prev/next cycle through the underlying frame list and the "n / total" counter reflects real state, not the doubled/reversed arrays used to render the two bands.
- The lightbox scrim uses a literal bg-black/90 rather than a semantic token, the one documented exception in this repo's block conventions for a full-screen photo overlay.
More Gallery Blocks
View all →Plan Chest Sheet Stack
Ruled plan-chest drawer index that opens into a real stack viewer with a lift-and-rotate top sheet.
Wall Scale Viewer
Print grid with a wall-mockup viewer that scales the piece as you switch between size options.
Archive Record Cards
Text-first archive index that opens into a real 3D flip card of front image and back registrar notes.
Loupe Surface Studies
Square material/texture studies that open into a viewer with a real draggable magnifying loupe.
Paired Hang Compare
Two-to-a-bay staggered hang whose viewer can split into two real panes to compare a second work.
Dark Room Fade Viewer
Inverted low-light hang that opens into a chromeless viewer, the work fading up like a dimmer lamp.