MenuClose

Terrain Ridge — React Animated Background

Layered ridged-fbm mountain silhouettes in parallax drift — ridgelines recede into haze, each scrolling at its own speed, under a low sun that rims the nearest crest.

View source
PreviewWEBGPU
Starting live preview

Usage

import { TerrainRidge, TERRAIN_RIDGE_PRESETS } from "@/components/TerrainRidge";

export function RangeHero() {
  return (
    <section style={{ position: "relative", minHeight: "100dvh" }}>
      <TerrainRidge {...TERRAIN_RIDGE_PRESETS.dusk}
        {...{
          interactive: true,
          speed: 1,
          intensity: 1,
          layers: 5,
          ruggedness: 0.8,
          from: "#1b2a4a",
          to: "#e8956b",
          accent: "#141a2e"
        }}
      />
      <div style={{ position: "relative", zIndex: 1, padding: "8rem 2rem" }}>
        <h1>Range after range</h1>
      </div>
    </section>
  );
}
Implementation notes & API

Purpose: parallax mountain-range backdrop; crests are sharpened ridged value noise (1-|2n-1|) and each layer carries its own scroll speed and parallax factor. Mount: full-bleed layer behind content; the sky gradient is opaque. Props: speed, intensity, layers (3-8), ruggedness (crest sharpness), from/to/accent (sky, sun, haze colors). Pointer: interactive is off by default; set it and the whole valley pans against the cursor. Guardrails: WebGPU required with fallback prop; reduced motion freezes the drift; place text in the sky band for contrast.

PropertyTypeNotes / default
interactivebooleanfalse in the library; enabled in this preview
fallbackReactNodeShown when the renderer is unavailable
className / stylestring / CSSPropertiesApplied to the outer container
View source on GitHubFree for commercial projects · MIT