Cosmic & Space
Hyperspace Warp
110 star streaks radiate outward from a glowing center in a hyperspace tunnel effect; pressing and holding the canvas accelerates warp speed 2.6x.
canvasmedium complexityintense motionclickmobile-ready
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
1
When to use it
Dark-mode hero backgrounds, sci-fi or space-themed UIs, loading screens, or any ambient loop needing dramatic motion.
When not to
Light backgrounds (hardcoded dark navy), content-heavy layouts where motion competes with reading, or low-end devices sensitive to continuous canvas rendering.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Change star count to 180 by setting N=180, shift color palette to warm gold/orange (replace '#9fdcff' with '#ffd580' and '#ffd1f0' with '#ff9a5c'), and increase warp acceleration target to 4.0.
Safe to edit
- star count (N=110)
- warp acceleration target (target=2.6)
- color palette ('#9fdcff', '#ffd1f0', '#ffffff')
- streak trail opacity (0.34 in fillRect alpha)
- center glow radius (40) and color
Keep intact
- DPR-aware canvas sizing and setTransform
- visibilitychange stop/start guard
- prefers-reduced-motion freeze (single frame)
- IIFE wrapper
- demo-v1 preview lifecycle: initialize demoEnabled from window.__foreverPreview and stop attract work on the window forever:interactive event; retain manual feedback, settling, cleanup and explicit sessions
Known limitations
- Background color hardcoded in CSS (#02030a) — must edit separately to change
- Reduced-motion path still calls one frame() which runs the rAF loop — stars freeze only because z is not incremented, but the loop keeps running
- State remains local to each mounted instance; format/theme remount preserves takeover, not component values.
More Cosmic & Space components
- Orbiting Planet SystemFour glowing planets orbit a radiant sun on tilted elliptical rings with depth-sorted rendering; the system drifts subtly toward the pointer.
- Black-hole Accretion Swirl110 heat-colored particles spiral inward across a tilted accretion disk toward a glowing event horizon; pointer movement boosts swirl speed.
- Twinkling Starfield115 multicolor stars twinkle via sine waves; sparkle crosses appear on larger stars; stars brighten near cursor. Static fallback for reduced-motion.
- Spiral Galaxy Rotate115 stars form a two-armed spiral galaxy rotating around a violet radial-gradient core; pointer move briefly doubles spin speed.
- Comet Streak LoopCyan and violet comets with glowing heads and gradient tails streak diagonally across a twinkling dark starfield; click spawns an extra comet (up to 5).
- Ringed Planet RotateAmber gas giant with tilted Saturn-like rings slowly rotates over a twinkling starfield; pointermove adjusts ring tilt and light angle dynamically.