06.04 · 3D & Advanced

Canvas Particle Effect

Dots drift, link up when close, and dodge your pointer. Best for tech sites.

Watch it

It moves by itself, and the dots move away from 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.

Pointer effect

What your pointer or finger does to nearby dots.

Number of particles

More dots make more links; phones and tablets draw fewer.

How close two dots must be to join with a line.

More optionsFewer options

Speed

Slow drifting feels calm; fast looks busy.

Color

The color of the dots and lines.

Each dot leaves a fading streak behind it.

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 background to [the section you want it behind]. Draw small dots on a canvas, give each its own direction, and bounce them off the edges. When the settings include lines, join any two dots that come close with a thin line that fades as they move apart, so a network keeps forming and breaking. Dots near the pointer, or a finger on touch screens, can be pushed away or pulled in. Checking every pair of dots gets slow quickly, so draw far fewer dots on phones and tablets, and stroke the lines in a few batches rather than one at a time. If the visitor has reduced motion turned on, show the dots still. 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

  • Hero sections
  • Tech sites
  • Loading screens
  • Dark backgrounds

Avoid on

  • Long reading pages
  • Busy layouts