forever components

Cosmic & Space

Comet Streak Loop

Cyan and violet comets with glowing heads and gradient tails streak diagonally across a twinkling dark starfield; click spawns an extra comet (up to 5).

canvasmedium complexitymoderate motionclick

Open on the canvas to copy the code → Free account · 3 copies a day · membership goes unlimited

Live demo — the real component, running in a sandbox. One self-contained HTML file, zero dependencies. Open it on the canvas →
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/sci-fi themes, ambient looping screensavers, loading screens.

When not to

Light-background UIs (background hardcoded #030a14). Content-heavy layouts where diagonal motion competes with reading.

Working with an AI agent

Every component ships agent-ready metadata. An example instruction for this one:

Change comet colors to warm gold and orange by replacing the hue array values '#7fe8ff' and '#c9b6ff' with '#ffe066' and '#ff9a3c', and increase comet speed by raising sp from 0.0045 to 0.008.

Safe to edit

  • comet color palette (hue values '#7fe8ff'/'#c9b6ff')
  • comet speed range (sp: 0.0045 + random*0.004)
  • tail length (len: 0.20 + random*0.13)
  • max comet count cap (comets.length < 5)
  • travel direction vector (dx=-0.78, dy=0.62)
  • star count and twinkle speed (60 stars, t*0.02)

Keep intact

  • DPR-aware canvas sizing (cv.width = W*DPR)
  • visibilitychange pause/resume
  • reduced-motion guard (single static frame)
  • IIFE wrapper

Known limitations

  • Background color hardcoded in CSS (#030a14) — must edit to change dark navy
  • Reduced-motion mode renders one static frame only — comets are frozen, not removed
  • Click spawns comets but they auto-respawn on exit anyway, making click feel optional

cometspacecanvasstreakambientloopbackground

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.
  • 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.