Flow Warp Image
motiq/flow-warp-imageFreeComponent
A media surface that liquefies under the pointer: a 32×20 spring mesh (k=90, c=8) displaces sub-rects of your image with a (1−d/R)² falloff and snaps back elastically, throws a radial splash on pointer exit, and swells on a Lissajous path while idle. One canvas, DPR capped at 2, arrow keys and Space as the keyboard equivalent.
Live preview
live · rendered by the registry
Rendered by motiq on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.motiq.dev/r/flow-warp-image.jsonSource
1"use client";23import * as React from "react";45import { cn } from "@/lib/utils";6import { useReducedMotion, useVisibilityPause } from "@/lib/motiq";78/* -------------------------------------------------------------------------- */9/* Types */10/* -------------------------------------------------------------------------- */1112/** Anything the canvas can sample from: a URL, or an already-painted surface. */13export type FlowWarpSource = string | HTMLCanvasElement | HTMLImageElement;1415export interface FlowWarpImageProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {16 /** Image URL (or a canvas/image element) sampled into the warping mesh. */17 src?: FlowWarpSource;18 /** Describes the picture for assistive tech. Empty string = purely decorative. */19 alt?: string;20 /** Mesh resolution as [columns, rows]. */21 grid?: [number, number];22 /** Per-node return spring stiffness. */23 stiffness?: number;24 /** Per-node damping. */25 damping?: number;26 /** Pointer push radius in CSS px. */27 radius?: number;28 /** Impulse gain multiplier (1 = the tuned default). */29 strength?: number;30 /** Throw a radial splash from the last pointer position on exit. */31 splashOnLeave?: boolean;32 /** Let a virtual pointer ride a Lissajous path after 3s of stillness. */33 idleWave?: boolean;34 /** Deterministic seed for the built-in fallback surface (used when `src` is unset). */35 seed?: number;36 /** Overlay content (labels, titles) rendered above the canvas. */37 overlay?: React.ReactNode;38 /** Force the still variant regardless of system preference. */39 reducedMotion?: boolean;40 /** Stop the rAF loop while scrolled offscreen or the tab is hidden. */41 pauseWhenHidden?: boolean;42}4344/* -------------------------------------------------------------------------- */45/* Physics constants (Motion Lab ship spec) */46/* -------------------------------------------------------------------------- */4748const DEFAULT_GRID: [number, number] = [32, 20];49const K_DEFAULT = 90;50const C_DEFAULT = 8;51const PUSH_RADIUS = 140;52/** Base impulse gain; pointer speed adds SPEED_GAIN · |v|. */53const BASE_GAIN = 260;54const SPEED_GAIN = 0.45;55/** Pointer speed is clamped so a flick can't blow the mesh apart. */56const MAX_POINTER_SPEED = 3200;57const SPLASH_RADIUS = 230;58const SPLASH_POWER = 300;59const KEY_SPLASH_POWER = 130;60const KEY_BURST_POWER = 340;61// … truncated
What it pulls in
Other registry items
Files it writes
More from motiq
All 100 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Activity Streamactivity-stream | motiq | Components | Free | 1 dep | |
| Adaptive Safe-Zone Gridadaptive-safe-zone-grid | motiq | Components | Free | no deps | |
| Agent Run Timelineagent-run-timeline | motiq | Components | Free | 1 dep | |
| AI Response Streamai-response-stream | motiq | Components | Free | 1 dep | |
| Animated Accordionanimated-accordion | motiq | Components | Free | 2 deps | |
| Animated Buttonanimated-button | motiq | Components | Free | 1 dep | |
| Animated Dialoganimated-dialog | motiq | Components | Free | 2 deps | |
| Animated Gridanimated-grid | motiq | Components | Free | 2 deps |
