Cosmic & Space
Spiral Galaxy Rotate
115 stars form a two-armed spiral galaxy rotating around a violet radial-gradient core; pointer move briefly doubles spin speed.
canvasmedium complexitysubtle motionpointer
Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited
Worth keeping?
Votes steer what gets built next — sign in to cast one, free to read
When to use it
Dark-mode hero backgrounds, space or sci-fi themes, ambient screensaver loops.
When not to
Light backgrounds (hardcoded dark fill). Layouts where constant rotation competes with readable content.
Working with an AI agent
Every component ships agent-ready metadata. An example instruction for this one:
Increase star count to 200, change arm count to 3, and shift the outer star color from #D8C197 to #ffe066.
Safe to edit
- star count (N=115)
- arm count (arms=2)
- base spin speed (t += 0.0055)
- spin boost on pointer (spin=2.4)
- core glow colors and size (55*scale)
- star color palette (c assignment)
Keep intact
- DPR-aware canvas sizing
- visibilitychange pause/start
- prefers-reduced-motion guard
- IIFE wrapper
Known limitations
- Background color hardcoded in CSS and canvas fill — must change both to retheme
- Reduced-motion path still renders one frame but does not fully stop animation loop
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.
- 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.
- Constellation Connect46 drifting star nodes auto-connect with faint magenta lines when close; cursor draws lines to nearby stars and brightens them on hover.