unlumen

Horizontal Depth Fade

Galleries 78

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

    278
  • Side By Side Slide

    Side By Side Slide

    240
  • Scroll Reveal Image

    Scroll Reveal Image

    230
  • Count Up

    Count Up

    156
  • Pixel Liquid Background

    Pixel Liquid Background

    109
  • Glow Button

    Glow Button

    99
  • Animated Sidebar

    Animated Sidebar

    97
  • LED Dot Matrix Display

    LED Dot Matrix Display

    71

More in Galleries

View all
  • Animated Gallery

    Animated Gallery

    1.5K
  • Editorial Collage Hero

    Editorial Collage Hero

    457
  • Image Gallery

    Image Gallery

    1.4K
  • Thumbnail image viewer

    Thumbnail image viewer

    63
  • Elastic Gallery

    Elastic Gallery

    955
  • Img Sphere

    Img Sphere

    2.1K
  • 3D Parallax Unfurling Gallery

    3D Parallax Unfurling Gallery

    1K
  • Shared Element Gallery

    Shared Element Gallery

    444