Skip to content
animorio
IT
Back to the library

Pool reflections background

Backgrounds, WebGLWebGL, GSAPMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

A WebGL animated background for the hero of a small island hotel, on a whitewashed wall in the shade of the eaves: the pool below throws the sun back onto the plaster as a net of bright caustics, fine and sharp near the water, wider and softer as they climb, with the turquoise bounce of the water and a thread of colour on their edges. A slice of direct sun comes in across the top. The pointer touches the water: it leaves rings that travel through the light and tilts the reflection a little. Pressing Check dates sends a ring out from the button and the rooms left for June go down by one.

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>
<!--
  "Pool reflections 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>Albedo</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <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 hero of a small island hotel on a whitewashed wall in the shade of the eaves. A WebGL shader draws the light
       that the pool below throws onto the wall: a net of bright caustics, stretched and softened the higher it climbs,
       with a cool bounce from the water and a slice of direct sun across the top. The pointer touches the water: it
       leaves rings that travel through the light and tilts the reflection a little -->
  <section class="stage" data-stage>
    <canvas class="wall" aria-hidden="true" data-canvas></canvas>
    <div class="glow" aria-hidden="true"></div>

    <header class="bar" data-in>
      <span class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
          <circle cx="12" cy="9" r="4.2"/><path d="M3.5 16.2c2.1-1.4 4.2-1.4 6.3 0s4.3 1.4 6.4 0 4.2-1.4 4.3 0"/><path d="M5.5 19.6c1.7-1 3.4-1 5.1 0s3.4 1 5.1 0"/>
        </svg>
        Albedo
      </span>
      <nav class="nav">
        <a class="nav__link nav__link--wide" href="#">Rooms</a>
        <a class="nav__link nav__link--wide" href="#">Journal</a>
        <a class="book" href="#">Book</a>
      </nav>
    </header>

    <div class="hero">
      <a class="chip" href="#" data-in>
        <span class="chip__new">Now booking</span>
        <span class="chip__words">Summer 2027</span>
        <svg class="chip__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>
      </a>
      <h1 class="title" data-title><span class="title__line">Slow days</span> <span class="title__line">by the water.</span></h1>
      <p class="lede" data-in>Eleven whitewashed rooms around a spring-fed pool, on the quiet side of the island.</p>
      <div class="actions" data-in>
        <button class="btn" type="button" data-btn data-autoclic>
          <span class="btn__face" data-face>
            <span class="btn__shine" aria-hidden="true"></span>
            <span class="btn__words" data-words>Check dates</span>
            <svg class="btn__icon" viewBox="0 0 16 16" aria-hidden="true">
              <path class="btn__arrow" data-arrow d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/>
              <path class="btn__check" data-check pathLength="1" d="M3.4 8.4l3 3 6.2-6.6"/>
            </svg>
          </span>
        </button>
        <a class="ghost" href="#">See the rooms</a>
      </div>
      <p class="note" data-in><span class="note__count" aria-hidden="true"><span class="note__roll" data-roll><span>4</span><span>3</span></span></span> rooms left for June</p>
    </div>

    <p class="hint" data-in>Move the pointer to touch the water</p>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

34 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 “Pool reflections 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 whitewashed wall in the shade of the eaves the hero of Albedo appears, an invented small hotel on an island: at the top the name with its mark of the sun on the water, ‘Rooms’, ‘Journal’ and the ‘Book’ pill, in the middle the ‘Now booking, Summer 2027’ label, the heading ‘Slow days by the water.’ with its second half in italics, a line that tells the story, the deep teal ‘Check dates’ button, ‘See the rooms’ and below ‘4 rooms left for June’. Behind, the pool below the page throws the sun onto the wall: a net of lines of light that widen and tighten like real caustics, fine and sharp at the bottom near the water, wider and softer as they climb, until they fade with a wavy edge before reaching the top. Where two nets cross the light makes whiter knots, around them a turquoise glow remains, and on the edges of the lines a touch of warm shows on one side and cool on the other. Across the top a slice of direct sun passes with a slanted edge and a warm rim, the plaster shows its relief where the light catches it and the heading's shadow trembles with the water. Every loop a long swell makes the net race and brighten, then a ring opens from the left, then the button is pressed: it gives and comes back on a spring, a band of light slides over it, two rings go out from the button through the light, the label turns into ‘Dates held’ with a checkmark that draws itself and the 4 rolls to 3. With the pointer you touch the water: moving it makes rings, stronger when the gesture is fast, the water stays stirred for a while and the reflection tilts gently the other way.

How it works

The wall is a shader

The whole background is a WebGL shader on a single triangle covering the canvas, full page under the words: the wall, the slice of sun, the caustics, the rings, the plaster and the grain. Without WebGL a turquoise CSS glow remains.

Caustics: the edges between moving cells

Each net is an animated Voronoi diagram: for every point the difference between the nearest cell and the second one is measured, which is almost zero on the edges. Two nets of different size, bent by a slow noise, join with the minimum; where the edges of both cross, the light makes a whiter knot.

The perspective of the reflection

A reflection on a wall is stretched sideways and squeezed in height: the coordinates are multiplied by 0.72 and 1.55. The cells grow and the lines widen as they climb, because further from the water the light spreads; a mask with a wavy edge turns it off before the top. Red and blue are read at slightly different scales, and there is the thread of colour.

Rings in the water

Each ring is a wave that starts from the touched point and runs outward: it shifts the coordinates of the nets along the radius and brightens the front. Six live at most; the pointer leaves one every so often, stronger when it moves fast, and the button sends two.

The rhythm of the water

The shader's time does not run at a fixed pace: a current that slowly returns to 1, raised by the swell (a GSAP tween) and by the pointer. The reflection tilts against the pointer on a soft spring, and the heading's shadow is a text-shadow with two CSS variables that tremble with the same time.

Values to change

NameFileDefaultWhat it changes
DRIFTscript.js1How fast the water moves (0 = still).
LIGHTscript.js1How bright the caustics are.
SHARPscript.js1How fine the lines of light are: higher is thinner and crisper.
SIZEscript.js1How big the cells of the net are.
RIPPLEscript.js1How strong the rings are, from the pointer and the button.
SWELLscript.js1How strong the swell is that passes on its own.
TINTscript.js0.35How much turquoise is in the light (0 = white sun).
FOLLOWscript.js0.04How much the reflection tilts with the pointer.
GRAINscript.js0.03How strong the grain is.
SPEEDscript.js12 = the walk on its own twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the loop of the swell, the ring and the button.

Try them in the Playground

When to use it

As the background of the first screen of a hotel, a holiday home or a resort with a pool, a swimwear brand, a spa, a travel agency or a summer app: wherever a lively, calm light is wanted instead of a gradient. The colours are --wall, --sun, --water and --teal in the CSS.

On phones

The same animations at adapted sizes: the net is measured on width and height, so a phone sees cells like a large screen, the slice of sun and the light are measured on the height, the heading on width and height; on short screens the bottom line and the rooms line go. With a finger you touch the water and the rings appear.

With reduced motion

The water stays still and no rings appear: the light and the caustics fade in; pressing the button the light brightens slightly and the label, the checkmark and the rooms digit change without motion.

Pitfalls

  • A single Voronoi net looks like a tiled mosaic: it takes two nets of different size joined with the minimum and bent by a noise, otherwise the straight polygons show.
  • Adding the light to the wall colour burns the white flat: with screen blending (one minus the product of the two inverses) the knots reach white without a flat edge.
  • With time running at a fixed pace the swell cannot be felt: the time itself speeds up (a current that returns to 1), not the light, so the net really races and then calms down.

Libraries

GSAP 3.15.0, Fraunces (font variabile) 5.3.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 3 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