A background component featuring an animated tunnel of rings with rising particles.
Installation
Usage
import { HoleBackground } from '@/components/animate-ui/backgrounds/hole';
export function Hero() {
return (
<section className="relative h-[480px] overflow-hidden">
<HoleBackground className="absolute inset-0" />
</section>
);
}Animation
- Rings slide down into a tunnel drawn on a canvas while particles rise out of it, under a glowing aurora that scrolls through its colors every 5s.
- The canvas is sized to its container at the device pixel ratio. The rings and particles advance one step per displayed frame, so they move faster on 120Hz screens.
- It pauses off screen and while the tab is hidden.
- Under reduced motion, the tunnel, the particles and the aurora hold still.
API Reference
HoleBackground
| Prop | Type | Default |
|---|---|---|
strokeColor? | string | '#737373' |
numberOfLines? | number | 50 |
numberOfDiscs? | number | 50 |
particleRGBColor? | [number, number, number] | [255, 255, 255] |
...props? | React.ComponentProps<'div'> | - |
Credits
- Credits to Antoine Wodniack for the inspiration