07.21 · Ambient & Background

Topographic Lines

Lines like those on a hiking map slowly bend and drift. Best for outdoor brands.

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.

Line spacing

How much the height changes from one line to the next.

Speed

How fast the hills swell and drift.

Color

The color of the lines.

More optionsFewer options

Hill size

Small hills make busy rings; large ones make long, lazy curves.

Every fifth line is drawn thicker, as on a printed map.

Copy the prompt

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

Add a topographic lines background to [the section you want it behind]. Build a smooth, hilly height map from layered noise and draw its contour lines on a canvas: sample the height on a grid, and in each grid square join the points where the height crosses each level, so every line follows one height, as on a hiking map. Make every fifth line bolder when the settings include it. Shift the noise slowly by elapsed time so the hills swell, shrink and drift, and redraw each frame. Sample a coarser grid on phones. If the visitor has reduced motion turned on, show the lines 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

  • Outdoor and travel brands
  • Hero sections
  • Maps and data products
  • Portfolio backgrounds

Avoid on

  • Busy layouts
  • Long reading pages