unlumen

Horizontal Depth Fade

Galleries 96

About

A scroll-driven horizontal image strip that keeps the centered image in sharp focus while blurring, dimming and desaturating the others for a cinematic depth-of-field effect.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Horizontal Depth Fade to your project and fits it to your theme.

Code

How Horizontal Depth Fade is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { HorizontalDepthFade } from "@/components/ui/horizontal-depth-fade";
import { useMemo, useRef } from "react";

export default function HorizontalDepthFadeDemo() {
  const scrollContainerRef = useRef<HTMLDivElement>(null);

  const images = useMemo(
    () =>
      Array.from({ length: 12 }, (_, i) => ({
        src: `https://picsum.photos/seed/hbs${i + 1}/540/690`,
        alt: `Demo image ${i + 1}`,
      })),
    [],
  );

  return (
    <div
      ref={scrollContainerRef}
      className="relative h-screen w-full overflow-y-auto bg-background"
    >
      <HorizontalDepthFade
        images={images}
        scrollContainerRef={scrollContainerRef}
        brightnessBoost={55}
        focusSpread={0.14}
        scaleEffect={0.11}
        scrollLength={360}
      />
    </div>
  );
}

Dependencies

More by unlumen

View all
  • Motion Navigation Menu

    Motion Navigation Menu

    316
  • Side By Side Slide

    Side By Side Slide

    301
  • Scroll Reveal Image

    Scroll Reveal Image

    252
  • Count Up

    Count Up

    183
  • Pixel Liquid Background

    Pixel Liquid Background

    137
  • Animated Sidebar

    Animated Sidebar

    122
  • Glow Button

    Glow Button

    116
  • LED Dot Matrix Display

    LED Dot Matrix Display

    79

More in Galleries

View all
  • Scattered About

    Scattered About

    83
  • Product Hover Showcase

    Product Hover Showcase

    125
  • Photo Deck

    Photo Deck

    82
  • Gallery Component

    Gallery Component

    50
  • Morph Gallery

    Morph Gallery

    6
  • File Upload

    File Upload

    22
  • About 3

    About 3

    460
  • Cylinder Tunnel Gallery

    Cylinder Tunnel Gallery

    63