Modus UI

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.

Modus / Star Tunnel

Installation

CLI

npx @modus-ui/cli add star-tunnel

Manual

  1. Copy the code from the component tab.
  2. Create a file at components/ui/star-tunnel.tsx.
  3. Paste the code.

Usage

tsx
import { StarTunnel } from "@/components/ui/star-tunnel";

export default function Example() {
  return (
    <div className="relative h-[500px] w-full overflow-hidden">
      <StarTunnel />
      <div className="relative z-10 p-8">
        <h1>Content over the background</h1>
      </div>
    </div>
  );
}

Props

PropTypeDefaultDescription
variant"streaks" | "letters" | "keycaps" | "hyperspace""letters"Which corridor to fly through.
speednumber12Distance travelled per frame.
streakOpacitynumber0.6Opacity of the streaks (and keycap sparks).
tileOpacitynumber0.9Opacity of the tiles, letters, keycaps or tunnel.
fovnumber62Camera field of view in degrees.
brightnessnumber1CSS brightness filter.
huenumber0Hue rotation in degrees.
saturationnumber1CSS saturation filter.
colorsstring[]ramp of theme primary and foregroundStreak colours.
backgroundColorstringtheme backgroundScene and fog colour.

Comments

  • No comments yet.