Prompt library

Stacking Sticky Cards

Category: Scroll sections · Interaction: pin and overlap on scroll · Stack: Next.js / React or vanilla, with GSAP ScrollTrigger and smooth scrolling


Prompt

Build a section of full-screen cards that stack as you scroll. Each card pins in place while the next card slides up over it, and the covered card recedes into the background.

Content

  • 4–5 cards for my services or values. Each has a large number, a title, an image and a short paragraph with a small uppercase label. Use my own text and images.
  • A full-screen intro panel before the cards and an outro panel after them, each with one bold statement.

Look and feel

  • Contrast between page and cards: for example a dark page (#141414) with cards in a warm light tone (#f2ede4) and dark text. Or invert, to match my brand.
  • One geometric sans-serif in heavy weights for headings, regular weight for body.
  • Card layout on desktop: number in a narrow left column; title, wide image (around 16:9) and a two-column caption in a wider right column. On tablet and mobile, stack everything in one column.

Behaviour

  • Smooth scrolling across the page (Lenis or similar).
  • Each card except the last pins at the top of the viewport until the stack finishes. No extra spacing is added, so the next card slides directly over it.
  • As the next card rises, the covered card scales down a little (to about 85–90%), tilts a few degrees (alternate left and right per card) and dims under a dark overlay. All three changes track the incoming card's progress exactly.
  • After the last card, the outro scrolls in normally.

Implementation notes

  • In React or Next.js, run the animation only on the client with proper cleanup (for example useGSAP with a scoped ref) so there are no hydration or double-run issues.
  • Drive the overlay with a CSS custom property so it updates without re-rendering.
  • Card data should come from an array so cards are easy to add or remove.

Accessibility

  • With prefers-reduced-motion, keep pinning but remove the tilt and scale.
  • Keep text contrast readable even under the overlay.

Deliverable: a reusable StackingCards component plus page and styles, documented with the props or data shape.