Star Tunnel
Web (React)
A WebGL flight down a corridor of letters, streaks, keycaps or rings, coloured from a ramp of the theme primary and foreground.
A WebGL flight down a corridor of letters, streaks, keycaps or rings, coloured from a ramp of the theme primary and foreground. It fills its positioned parent, follows the active theme and palette in light and dark mode, pauses when off screen and renders a still frame when the user prefers reduced motion.
Installation
CLI
npx @modus-ui/cli add star-tunnelManual
- Copy the code from the component tab.
- Create a file at
components/ui/star-tunnel.tsx. - Paste the code.
Usage
tsx
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "streaks" | "letters" | "keycaps" | "hyperspace" | "letters" | Which corridor to fly through. |
speed | number | 12 | Distance travelled per frame. |
streakOpacity | number | 0.6 | Opacity of the streaks (and keycap sparks). |
tileOpacity | number | 0.9 | Opacity of the tiles, letters, keycaps or tunnel. |
fov | number | 62 | Camera field of view in degrees. |
brightness | number | 1 | CSS brightness filter. |
hue | number | 0 | Hue rotation in degrees. |
saturation | number | 1 | CSS saturation filter. |
colors | string[] | ramp of theme primary and foreground | Streak colours. |
backgroundColor | string | theme background | Scene and fog colour. |
Comments