Infinite Drift 2

Fullscreen WebGL gallery: infinite tiled image atlas, radial dome distortion, multi-touch inertial drag, and optional auto drift. Bundled atlas photos install under components/3d/infinite-drift-2/images.

Default

Glass-rim tiles under a chromatic dome lens - drag or scroll to pan. Demo photos ship with the install.

Loading…

Installation

CLI
npx @sonojs/ui@latest add infinite-drift-2

Usage

page.tsx
"use client"

import { InfiniteDrift2 } from "@/components/3d/infinite-drift-2"

export default function Page() {
  return (
    <div className="h-[420px] w-full overflow-hidden rounded-[12px] bg-canvas sm:h-[520px]">
      {/* 16 atlas photos install under components/3d/infinite-drift-2/images */}
      <InfiniteDrift2 height="100%" />
    </div>
  )
}

Props

PropTypeDefaultDescription
imagesstring[]bundled atlas (16)Image URLs packed into a square atlas (up to 16 → 4×4 grid).
curvenumber0.35Lens distortion (0 = flat, higher = deeper dome / fisheye).
curveRadiusnumber1.5Radial reach of the dome curve.
zoomnumber0.08Zoom scale offset in the distortion formula.
tileWidthnumber220Tile width in pixels.
tileHeightnumber220Tile height in pixels.
gapnumber18Gap between tiles in pixels.
borderRadiusnumber12Rounded corner radius for each tile.
tileRotationnumber0Per-tile rotation in degrees.
grayscalenumber0Grayscale mix (0 = color, 1 = monochrome).
vignettenumber0.38Edge darkening intensity.
chromaticAberrationnumber0.55RGB fringe at the dome rim (0–1).
glassnumber0.85Specular glass rim on tiles (0–1).
depthFadenumber0.75How much edge tiles darken into the dome.
autoScrollXnumber0.35Continuous drift speed on X.
autoScrollYnumber0.15Continuous drift speed on Y.
enableDragbooleantruePointer drag panning.
enableWheelbooleantrueMouse wheel panning.
axis"both" · "x" · "y""both"Allowed pan axes.
dragSensitivitynumber1Drag pan multiplier.
wheelSensitivitynumber0.6Wheel pan multiplier.
frictionnumber0.92Inertia decay (0.80–0.98 typical).
heightstring · number420Stage height (mobile-friendly default).
widthstring · number"100%"Stage width.
backgroundColorstring"transparent"Container background behind the canvas.
dprnumber2Max device pixel ratio for rendering.
classNamestring-Classes on the stage.
childrenReactNode-Optional overlay content above the canvas.