unlumen

Horizontal Depth Fade

Galleries 90

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

    304
  • Side By Side Slide

    Side By Side Slide

    276
  • Scroll Reveal Image

    Scroll Reveal Image

    241
  • Count Up

    Count Up

    173
  • Pixel Liquid Background

    Pixel Liquid Background

    122
  • Animated Sidebar

    Animated Sidebar

    114
  • Glow Button

    Glow Button

    110
  • LED Dot Matrix Display

    LED Dot Matrix Display

    75

More in Galleries

View all
  • Scattered About

    Scattered About

    19
  • Animated Gallery

    Animated Gallery

    1.5K
  • Gallery Component

    Gallery Component

    5
  • Photo Deck

    Photo Deck

    7
  • Editorial Collage Hero

    Editorial Collage Hero

    507
  • Elastic Gallery

    Elastic Gallery

    1.1K
  • Folded Card

    Folded Card

    42
  • Image Gallery

    Image Gallery

    130