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

    271
  • Side By Side Slide

    Side By Side Slide

    227
  • Scroll Reveal Image

    Scroll Reveal Image

    221
  • Count Up

    Count Up

    145
  • Pixel Liquid Background

    Pixel Liquid Background

    105
  • Glow Button

    Glow Button

    97
  • Animated Sidebar

    Animated Sidebar

    95
  • LED Dot Matrix Display

    LED Dot Matrix Display

    70

More in Galleries

View all
  • Thumbnail image viewer

    Thumbnail image viewer

    43
  • Animated Gallery

    Animated Gallery

    1.4K
  • Hero Section 6

    Hero Section 6

    881
  • Editorial Collage Hero

    Editorial Collage Hero

    430
  • 3D Parallax Unfurling Gallery

    3D Parallax Unfurling Gallery

    980
  • Layout Grid

    Layout Grid

    825
  • Image Gallery

    Image Gallery

    90
  • File Upload

    File Upload

    18