07.07 · Ambient & Background
Starfield / Space Particles
Stars stream toward you out of the dark. Best for space themes.
Watch it
It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.
Inside, each line is a star's straight route out from the middle, and its arrow its speed: near the middle stars are small, dim and slow, near the edge big, bright and fast.
Without depth gives every star the same size, brightness and speed, so the field looks flat. With depth makes them grow, brighten and speed up toward you, so it looks deep.
Try it
Change a setting and see the difference as it moves.
Direction
Outward flies through space; sideways looks out a window.
Speed
Keep it slow for a calm background.
Number of stars
More stars feel deeper; phones show at most 300.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add a starfield background to [the dark section you want it behind]. Draw many small stars on a canvas and move them out from the center, or sideways past the viewer, so it feels like flying through space. Tie each star's size, brightness and speed to its distance from the center: small, dim and slow near the middle, bigger, brighter and faster toward the edge, which is what creates the depth. A slow speed keeps it calm. Draw fewer stars on phones. If the visitor has reduced motion turned on, show the stars still. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.