07.14 · Ambient & Background

Flow Field

Particles ride invisible currents, leaving fading trails. Best for art pages.

Watch it

It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.

Try it

Change a setting and see the difference as it moves.

Swirl size

Large swirls look calm; small ones look stormy.

Trail length

How long each particle's trail lingers.

Speed

How fast each particle moves.

More optionsFewer options

Number of particles

More particles fill the currents; phones show at most 500.

Color

Rainbow changes color across the stage and over time.

Copy the prompt

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

Add a flow field background to [the section you want it behind]. Fill a canvas with many particles and give every point a direction that changes smoothly from spot to spot (smooth random noise does this). Each frame, move each particle a small step along the direction under it, scaled by the time since the last frame so it runs at the same speed on every screen. Instead of clearing the canvas, cover it with a see-through dark layer once for every 60th of a second that passes, so each particle leaves a fading trail. Let the directions change slowly over time, and use fewer particles on phones. If the visitor has reduced motion turned on, show one still frame of trails. 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

  • Art and creative sites
  • Hero sections
  • Loading screens
  • Data art

Avoid on

  • Busy layouts
  • Long reading pages