Staaarter

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.

By Staaarter Team
Gallery
Docs
Live preview

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.json

Prefer 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

PropTypeDefaultDescription
headingstring"Twelve years, one thread"Heading above the bands.
statementstring"Every frame here was shot on the same street, twelve years apart."Short statement under the heading.
framesGalleryFrame[]noneFrames shown across both scrolling bands and the lightbox.
speedSecondsnumber36Duration of one full scroll loop, in seconds.
classNamestringnoneExtra 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.