Skip to content
animorio
IT
Back to the library

Water ripple photo

Images, Physics, HoverCanvas, GSAPAdvancedCompressed weight: Demo 7.8 KBGSAP 28 KBFreeDownload the zip

The opening of Lindmoor Lake House, a made-up hotel on a lake, on a real photo of a misty lake: wherever you click or tap a drop falls and the water in the photo really ripples, the rings spreading, bouncing off the edges and dying out; the pointer passing over the water leaves a light wake and the crests catch a thread of light. The sky and the headline stay still. Minimal style.

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 ripple photo" 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>Lindmoor Lake House, still water</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>
  <!-- the opening of a made-up lake house on a real photo of a misty lake: where you click or tap, a drop falls and
       the water of the photo ripples for real, rings spreading, bouncing off the edges and dying out; the pointer
       moving over the water leaves a light wake. The words stay still above the sky. -->
  <section class="stage" data-stage>
    <img class="photo" src="lago.webp" width="1024" height="602" alt="A still lake in the mist, hills reflected in the water" data-photo>
    <canvas class="water" aria-hidden="true" data-water></canvas>
    <div class="veil" aria-hidden="true"></div>

    <header class="bar" data-in>
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
          <path d="M2.5 13.5 8 7.5l3.4 3.6L14.5 8l7 5.5"/>
          <path class="brand__water" d="M4 17.2h16M7 20.2h10"/>
        </svg>
        Lindmoor Lake House
      </span>
      <span class="bar__links"><span>Rooms</span><span>The jetty</span></span>
    </header>

    <div class="hero">
      <p class="eyebrow" data-in>Twelve rooms on the shore</p>
      <h1 class="title">
        <span class="title__mask"><span class="title__line" data-line>Still water,</span></span>
        <span class="title__mask"><span class="title__line" data-line>slow mornings.</span></span>
      </h1>
      <p class="lede" data-in>Breakfast on the jetty, mist until ten, and nothing to do but watch the lake.</p>
      <a class="pill" href="#" data-pill>
        <span class="pill__fill" aria-hidden="true"></span>
        <span class="pill__words">Check availability</span>
        <svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.5M8.8 4.6 12.2 8l-3.4 3.4"/></svg>
      </a>
    </div>

    <footer class="foot" data-in>
      <span class="foot__data">Water 11&nbsp;&deg;C <span class="foot__sep" aria-hidden="true"></span> Wind calm</span>
      <span class="foot__hint" data-hint>
        <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 2.2c2.6 3.3 3.9 5.6 3.9 7.3a3.9 3.9 0 0 1-7.8 0c0-1.7 1.3-4 3.9-7.3Z"/></svg>
        Touch the water
      </span>
    </footer>
  </section>

  <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.

25 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 ripple photo” 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

A real full-screen photo: a calm lake in the mist, blue hills mirrored in the water, a light grey sky. At the top the Lindmoor Lake House mark, a hill and two lines of water drawn in line, and Rooms and The jetty on the right. In the sky, in small capitals, Twelve rooms on the shore; the large headline Still water, / slow mornings., rising from its line; a line about breakfast on the jetty and mist until ten; the pill button Check availability. At the bottom, over the water, Water 11 °C and Wind calm, and on the right a drawn drop with Touch the water. Wherever you click or tap the water a drop falls: the picture really ripples, the rings spread, bend the mirrored hills, bounce off the edges of the photo and cross each other, then slowly die out. Drops near the horizon are smaller and softer, as if far away. Passing the pointer over the water leaves a light wake; a thread of light runs along the crests. The sky, the real hills and the headline stay still. Now and then the lake makes a tiny ripple on its own. At the first real touch the Touch the water invitation goes away. Passing over the button widens the words and swells the pill with a bounce.

How it works

The photo on a canvas

The photo is drawn once on a canvas as big as the screen, like object-fit: cover with the same object-position as the CSS, at a capped resolution (at most 1.5 per pixel and 1.3 million pixels). The same measurement gives where the horizon falls, HORIZON of the photo’s height: above it nothing is touched again, below it the water is redrawn.

The wave rule

Below the horizon there is a grid of heights, one cell every three pixels. At every step, a fixed 1/60 of a second, each point becomes the average of its four neighbours times two minus its previous value, multiplied by CALM: it is the discrete wave equation, and with the edges held at zero the rings bounce on their own. A drop adds a soft, cosine-shaped bump, smaller and lighter near the horizon.

The photo bent

For every point of the grid the slope (the difference with its neighbours) tells how far to move the pixel read from the photo: that is the refraction. Slopes are interpolated row by row and pixel by pixel, the shifted photo is read and written with putImageData; the slope facing the light brightens the crests. Near the horizon the shift fades and is squashed vertically, as in perspective.

When the lake is still

If for a moment no point goes over a tiny threshold, the grid is cleared, the clean photo is drawn again and the loop stops drawing until another drop falls: with a still lake the work is zero.

Values to change

NameFileDefaultWhat it changes
DROPscript.js1How strong a drop is.
SIZEscript.js1How wide a drop is.
CALMscript.js0.985How slowly the rings die out (closer to 1, the further they travel).
BENDscript.js1How much the waves bend the photo.
SHINEscript.js1How much light the crests catch.
WAKEscript.js1How strong the pointer’s wake is.
BREEZEscript.js1The tiny ripples the lake makes on its own.
HORIZONscript.js0.545Where the water starts in the photo (0 at the top, 1 at the bottom).

Try them in the Playground

When to use it

As the opening screen of a lake hotel, a lodge, a holiday home, a spa, a yoga retreat or a brand tied to water: wherever the photo should stay the star but answer the first touch.

On phones

The same water at adapted sizes: the canvas is capped at 1.3 million pixels, drops are sized on the shorter side, and a finger touching the water drops a drop; dragging leaves the wake.

With reduced motion

No waves: the photo stays still and the words fade in.

Pitfalls

  • getImageData on a photo from another domain, or opened from file://, taints the canvas and throws: the photo must sit in the same folder, and a fallback leaves it still.
  • If the viewer scales the demo down, getBoundingClientRect returns scaled sizes: the click point is divided by rect.width / offsetWidth.
  • The wave rule needs a fixed step: with each frame’s real time the waves would run differently at 120 Hz; time is accumulated and at most three steps of 1/60 are taken.
  • With the edges held at zero the horizon would reflect the waves like a wall: the shift fades near the horizon, so the bounce up there is not seen.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 20 November 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