Skip to content
animorio
IT
Back to the library

Water lines background

Backgrounds, HoverGSAP, Canvas, CSS onlyMediumCompressed weight: Demo 6.6 KBGSAP 28 KBFreeDownload the zip

An animated background to put behind a headline: a warm white sheet ruled with thin horizontal lines, still like the water of a pond. The pointer crossing it leaves a V-shaped wake that spreads and fades, the lines lift with the water and turn blue where they move the most; a tap drops a ripple and the headline in the middle floats on the same water.

The code

A folder that runs on its own: index.html, style.css, script.js and the libraries from a CDN. The React and Vue tabs hold the same demo as a ready component, which switches its animations off when it leaves the page.

<!doctype html>
<!--
  "Water lines background" from Animorio · https://animorio.com
  License: free on your own sites and your clients’ sites, paid work included.
  Not for resale, redistribution, templates or code collections · https://animorio.com/en/license/
-->
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>The background of lines rippling in the pointer's wake</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- a warm white page ruled with thin horizontal lines, still like water; the pointer crossing it leaves a wake that
       spreads and settles, a tap drops a ripple, and the headline in the middle floats on the same water -->
  <main class="stage" data-stage>
    <canvas class="water" data-water aria-hidden="true"></canvas>

    <section class="hero" aria-labelledby="hero-title">
      <h1 class="title" id="hero-title" data-title>Still water</h1>
      <p class="note" data-note>Cross the page to leave a wake</p>
    </section>

    <svg class="ghost" data-ghost viewBox="0 0 20 20" aria-hidden="true"><path d="M4 2.5v13.2l3.5-3.3 2.4 5.3 2.3-1-2.4-5.2 4.8-.2z"></path></svg>
  </main>

  <script src="https://cdn.jsdelivr.net/npm/gsap@3.15.0/dist/gsap.min.js"></script>
  <script src="script.js"></script>
</body>
</html>

Playground

Change values, colours and text with the controls and watch the animation respond live. Or write in the code yourself. Then download the folder with your changes.

13 values to change

Or ask your AI assistant for it

With the Animorio connector, Claude Code, ChatGPT, Cursor or VS Code take it from here, guide included, and fit it into your project. Paste this request:

Take “Water lines background” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a warm white ground the horizontal lines, very thin and grey, one every thirteen pixels, stretch from the centre towards the sides, first the middle one and then the others upwards and downwards, so at the start they form a diamond that opens until it fills the page. In the middle the headline Still water rises letter by letter, from thin to full, with a small bounce, and below it a grey line: Cross the page to leave a wake. As soon as the headline has landed, a first drop falls behind it and a ring runs through all the lines to the edges. Then the water is still again. The passing pointer pushes the water down along its way: behind it a V-shaped wake opens, like a boat’s, spreading, moving away and fading in a few seconds; the faster it goes, the longer the wake. The lines rise and fall with the water, and the stretches that move the most turn blue, darker and a touch thicker the higher they lift. A tap drops a ripple: a ring that runs to the edges and comes back weaker. Behind the words the lines fade gently, so the headline always reads, but the letters float on the same water: when the wave passes under them they rise, sink and tilt by a few degrees, each on its own. If nobody moves the pointer, a drawn one arrives: it crosses the page in a long S, comes back lower from the other side, stops under the headline and taps, then leaves from the bottom, and after a few seconds starts again.

How it works

The water under the lines

Under the canvas there is an invisible grid of heights, one cell every seven pixels, in two Float32Arrays: the current height and the previous one. At each step every cell becomes half the sum of its four neighbours minus its previous height, times the damping: it is the wave equation in its shortest form, and that alone gives rings that spread, bounce off the edges and fade. The steps are fixed at sixty per second, whatever the screen.

The wake

Between one pointer position and the next the water is pushed down in steps of less than a cell, with a small bell five cells wide. The force grows with the pointer’s speed, up to a maximum: a pointer passing slowly barely ripples, a fast one leaves a boat’s V behind it, which emerges by itself from the sum of the many small rings along the way.

The lines that lift and turn blue

Each line is drawn with a point every six pixels, lifted by the height of the water at that point, read between the four nearest cells. All the grey lines are one single path; the stretches lifted by more than half a pixel go into five steps of blue, each drawn with one stroke, darker and a touch thicker at every step. When the water has been still for half a second the canvas stops redrawing.

The floating headline

The headline is split into one span per letter, with a second span inside: the outer one is moved by GSAP for the entrance, the inner one floats. In the ticker each letter reads the height and slope of the water under its baseline, rises or sinks a few pixels and tilts a few degrees, chasing the value with a little delay. Behind the words a halo in the ground colour fades the lines, so the headline stays readable.

Values to change

NameFileDefaultWhat it changes
GAPscript.js13The pixels between one line and the next.
AMPscript.js10How many pixels the lines lift for each unit of water.
DAMPINGscript.js0.982How long the wave lasts: closer to 1, the longer it ripples.
WAKEscript.js1How strong the pointer’s wake is.
DROPscript.js1How strong the drop of a tap is.
FLOATscript.js0.4How much the headline’s letters float on the water (0 keeps them still).
AUTO_PILOTscript.js3After how many seconds without a pointer the drawn one moves (0 never).

Try them in the Playground

When to use it

For the opening of a calm site: a spa, a lakeside hotel, a design studio, a meditation or notes app, a portfolio. When you need a background that invites a touch but leaves the headline alone in the middle.

On phones

Same animations: the finger leaves the wake and a tap drops a ripple (the page doesn’t scroll over the demo); the headline is sized on the height too and fits inside the box.

With reduced motion

With reduced motion the water stays still: the lines and the headline fade in, no wake, no drop, no floating letters and no drawn pointer; under the real pointer the lines only take on the blue, fading in.

Pitfalls

  • The cell wave equation must run in fixed steps: tied to frames, on a 120 Hz screen the waves run twice as fast.
  • Pushing the water only where the pointer is leaves gaps when it moves fast: it has to be pushed in small steps along the whole way.
  • Thousands of stretches in different colours slow the canvas down: they are gathered into a few steps and each step is one stroke.
  • With round caps the neighbouring blue stretches overlap and leave darker dots at every joint: flat caps.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 6.6 KB; the libraries: GSAP 28 KB.

Testing

Tested on 30 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

Use it in your own projects and in your clients’ projects. Do not resell it or redistribute it as is. GSAP stays under its own Standard license. Full license.

All animations