A tunnel of rings with particles rising toward the camera.
Installation
Install the packages
npm install @prequelui/react motion@prequelui/react reuses the primitive library your components already depend on.
Add the component
npx shadcn@latest add https://animate.prequelui.terravidhal.me/r/hole.jsonnpx shadcn@latest add https://animate.prequelui.terravidhal.me/r/hole.json
Turn on the motion
npx @prequelui/cli@latest animate holeThe CLI finds the component through components.json, swaps the import and removes the CSS animation classes that Motion replaces.
Usage
Import the component and compose it exactly like the primitive it wraps. Motion is enabled by default; the tempo prop scales every duration and softens every spring.
import { HoleBackground } from "@/components/prequelui/backgrounds/hole";
export default function Demo() {
return (
<div className="relative h-96 overflow-hidden rounded-xl">
<HoleBackground />
</div>
);
}import { Hole } from "@/components/prequelui/hole";
export function Variant() {
return (
<Hole tempo={1.2}>
…
</Hole>
);
}Animation
A tunnel is drawn on canvas: elliptical rings travel toward the camera while shrinking, particles rise inside the same cone, and a vertical colour wash sits behind them. The whole scene is a single compositor-friendly canvas.
- Rings follow a non-linear phase so they accelerate as they approach.
- Particles reset above the top edge with a fresh size and opacity.
- The canvas is capped at 2× device pixel ratio and redrawn at most once per frame.
- Reduced motion paints one composed frame and stops the loop.
API Reference
Each part accepts the usual HTML props in addition to the motion props below. No accessibility prop is hidden behind the animation layer.
HoleBackground
| Prop | Type | Default |
|---|---|---|
| rings | number | 34 |
| particles | number | 80 |
| strokeColor | string | "255,255,255" |
| speed | number | 1 |
| paused | boolean | false |
| className | string | — |