07.13 · Ambient & Background

Particle Constellation

Drifting dots link up with lines whenever they come close. Best for tech sites.

Watch it

It moves by itself, and the dots gather toward your pointer or finger. Pause it to look closely, or turn on slow motion.

Try it

Change a setting and see the difference as it moves.

Number of dots

More dots, more links; phones show at most 60.

How close two dots must be to link up.

Speed

Slow drifting stays calm.

More optionsFewer options

Color

The color of the dots and lines.

Dots gather where you point or touch.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add a particle constellation background to [the section you want it behind]. Scatter dots on a canvas, let each drift slowly in its own direction and bounce off the edges, and on every frame join any two dots that are close with a thin line that fades as they move apart, so a network keeps forming and breaking. When the settings include it, let the dots drift toward the pointer, or toward a finger on touch screens. Checking every pair of dots gets slow fast, so use fewer dots on phones. If the visitor has reduced motion turned on, show one still frame. Match the settings listed below.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Tech and data sites
  • Hero sections
  • Network and security products
  • Loading screens

Avoid on

  • Busy layouts
  • Long reading pages