Hyperspace

Stretch a starfield into radial streaks, tunnel forward through the scene and land on the next one through a white flash

Installation
$ pnpm dlx shadcn@latest add @remocn/hyperspace

Usage

hyperspace() is a Remotion transition presentation. Pass it to a TransitionSeries.Transition between two sequences. A starfield fades in over the outgoing scene, which dims and pushes forward. The stars drift slowly, then surge outward from the center as their streaks stretch with speed, and the frame ramps to flashColor at 62% of the transition. The incoming scene lands under the flash: the flash holds for a beat and dissolves while the scene eases out of a slight zoom and blur, with a few streaks still coasting past.

The star layout is deterministic. Each scene renders once; the stars are one SVG with up to stars lines, and the arrival adds a CSS blur for its first frames.

import { TransitionSeries, linearTiming } from "@remotion/transitions";
import { hyperspace } from "@/components/remocn/hyperspace";
 
export const MyVideo = () => (
  <TransitionSeries>
    <TransitionSeries.Sequence durationInFrames={90}>
      <SceneA />
    </TransitionSeries.Sequence>
    <TransitionSeries.Transition
      timing={linearTiming({ durationInFrames: 56 })}
      presentation={hyperspace()}
    />
    <TransitionSeries.Sequence durationInFrames={90}>
      <SceneB />
    </TransitionSeries.Sequence>
  </TransitionSeries>
);

Timing

ProgressWhat happens
0 to 0.62Stars fade in and spool up, the scene dims and pushes forward
0.45 to 0.62Flash ramps up to full
0.62Cut to the incoming scene under the flash
0.62 to 1Flash dissolves, the scene settles out of zoom and blur

Variations

  • flash: false swaps the white-out for a hard cut through the streaks at 62%.
  • accentRatio: 0 keeps every streak in streakColor; raise it to tint more stars with accentColor.
  • Fewer stars (80 to 120) gives a sparser, calmer jump.

Props

hyperspace(props) accepts:

PropTypeDefaultDescription
stars
number260Number of stars in the field.
streakColor
string"#FFFFFF"Main streak color.
accentColor
string"#E5322D"Color of the occasional tinted streak.
accentRatio
number0.14Share of stars drawn in accentColor, 0 to 1.
flash
booleantrueFlash at the cut. false gives a hard cut through the streaks.
flashColor
string"#FFFFFF"Flash color.