Skip to content
animorio
IT
Back to the library

Coffee steam background

Backgrounds, WebGLGSAP, WebGL, Canvas, CSS onlyAdvancedCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

An animated background for the first page of an invented coffee house, Ferrow: a real photo of a white cup on a dark table, with beans scattered around, and over it the rising steam, drawn live in WebGL. The steam leaves the mouth of the cup in thin wisps that sway and open as they climb, and passes behind the headline. The pointer moves through it like a hand over the cup: it pushes the steam and turns it in small eddies that rise with it and slowly calm down. A tap on the page lets out a fresh puff; the button is the elastic pill.

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>
<!--
  "Coffee steam 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 coffee background with the steam the pointer swirls</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <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/fraunces@5.3.0/full-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the first screen of an invented coffee house, Ferrow: a real photo of a cup on a dark table, and over it the
       steam, drawn live in WebGL; the pointer moves through the steam and swirls it, the swirl rises with it and
       settles; a tap on the page lets the cup breathe out a fresh puff -->
  <main class="stage" data-stage>
    <div class="photo" data-photo>
      <img src="caffe.webp" alt="A white cup of hot coffee on its saucer, on a dark wooden table scattered with coffee beans" width="960" height="639" data-img>
    </div>
    <canvas class="steam" data-steam aria-hidden="true"></canvas>
    <span class="shade" aria-hidden="true"></span>
    <span class="grain" aria-hidden="true"></span>

    <header class="nav" data-in>
      <a class="brand" href="#" aria-label="Ferrow Coffee House">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
          <ellipse cx="12" cy="12" rx="7.2" ry="9.6" transform="rotate(28 12 12)"></ellipse>
          <path d="M9.1 4.6c3.2 2.6 1.9 5.6 1.9 7.4s-1.3 4.8 1.9 7.4" transform="rotate(28 12 12)"></path>
        </svg>
        <span class="brand__name">Ferrow</span>
      </a>
      <nav class="links" aria-label="Main">
        <a href="#">Menu</a>
        <a href="#">Beans</a>
        <a href="#">Visit</a>
      </nav>
      <a class="order" href="#">Order ahead</a>
    </header>

    <section class="head" aria-labelledby="hero-title">
      <p class="pill" data-in>
        <span class="pill__tag">Today</span>
        <span class="pill__text">Guji, Ethiopia, on the slow bar</span>
        <svg class="pill__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5"></path></svg>
      </p>
      <h1 class="title" id="hero-title" data-in>Slow mornings,<br><em>poured warm</em></h1>
    </section>

    <footer class="foot">
      <p class="lede" data-in>A small roastery on Wren Street. Single origins, pastries from seven, and a table that is yours for as long as the cup is.</p>
      <div class="actions" data-in>
        <button class="cta" type="button" data-cta>
          <span class="cta__fill" aria-hidden="true"></span>
          <span class="cta__label">Reserve a table</span>
          <svg class="cta__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9.5M8.5 4 12.5 8l-4 4"></path></svg>
        </button>
        <a class="ghost-btn" href="#">See the menu</a>
      </div>
    </footer>

    <p class="hint" data-hint>
      <svg viewBox="0 0 20 20" aria-hidden="true"><path d="M4 15c0-4 6-3.5 6-7.5S6.5 3 6.5 3"></path><path d="M10.5 16c0-3.4 5-3 5-6.4S12.8 5.6 12.8 5.6"></path></svg>
      <span>Move through the steam</span>
    </p>

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

28 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 “Coffee steam 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

The first screen of Ferrow, a small invented roastery: at the top the mark with a bean drawn in line, the links Menu, Beans and Visit and the glass pill ‘Order ahead’; in the middle the pill ‘Today: Guji, Ethiopia, on the slow bar’ and the big Fraunces headline ‘Slow mornings, poured warm’, the second line in cream italics; at the bottom a line about the shop and two buttons, the milk-coloured ‘Reserve a table’ and the glass ‘See the menu’. Behind it all is a real photo: a white cup on its saucer, a spoon, beans scattered on the dark wooden table. On arrival the photo settles with a hair of zoom, the words rise out of a blur with a one-pixel settle and the cup lets out a puff: the steam climbs in thin wisps, sways more and more as it rises, opens up and passes behind the headline, warm on the window side and whiter on the other. A pointer moving through it pushes the steam its way and turns it in small eddies; the disturbance rises with the steam and in a couple of seconds calms down. A tap on the page lets out a fresh puff from the cup, thicker and faster. On hover the ‘Reserve a table’ button swells with a bounce, its letters widen and its arrow steps forward; pressed, it squashes and the arrow slips out and back in. If nobody touches it, a drawn hand passes through the steam in an S, waits for it to calm, taps beside the cup and presses the button.

How it works

The photo is a photo

The cup is a plain img, anchored at the bottom: as tall as the page but never under 80 %, so on a narrow screen the wall goes on above and the top edge fades into the page colour with a mask. JavaScript measures where the mouth of the cup is (as fractions of the photo) and hands it to the shader.

Steam on a transparent canvas

The WebGL canvas draws a single triangle and only the steam, in premultiplied alpha: outside the column the shader leaves at once with an empty pixel. The canvas is under half the page pixels: steam is soft and the browser stretches it without it showing.

The wisps

A four-octave fbm noise, warped by two more fbm and moved up with time; folded into ridges with 1 − |2f − 1| and raised to a power it turns into a web of thin wisps. The column is a gaussian that widens as it climbs, sways more higher up and fades before the top of the page.

The hand in the steam

A small 2D canvas, an eighth of the page, holds the pointer's push: red and green the direction, blue the strength, on a neutral ground. Every frame it rises a few pixels with the steam and drifts back to neutral a little at a time. The shader takes the steam from where the hand came from and adds an eddy, so stirred steam turns and climbs.

The puff and the button

The puff is a value GSAP takes to 1 and lets fall over two and a half seconds: the steam gets thicker and climbs faster, and an upward push from the mouth makes it roll. The button swells its body with elastic.out and widens its letters on Mona Sans' wdth axis.

Values to change

NameFileDefaultWhat it changes
RISEscript.js1How fast the steam climbs.
DENSITYscript.js1How thick and bright the steam is.
SWIRLscript.js1How much the pointer pushes and swirls the steam.
CALMscript.js2.4How many seconds stirred steam takes to calm down.
HANDscript.js70The radius of the hand that stirs the steam, in pixels.
AUTO_PILOTscript.js3After how many seconds without a pointer the drawn one takes over (0 never).

Try them in the Playground

When to use it

For the first page of a bar, a coffee shop, a roastery, a tea room or a restaurant: when the product photo should stay the star but feel alive, and a small gesture should invite a touch.

On phones

Same animations: the finger stirs the steam (the page over the demo doesn't scroll) and a tap makes the puff. The photo anchors to the bottom and the wall carries on above, so the cup stays under the headline; the links and the line of text go and the two buttons sit in the middle.

With reduced motion

With reduced motion the steam is already there, still, with its wisps; no puffs, no drawn hand, no zoom on the photo, and the words only fade in.

Pitfalls

  • The push map can't start at zero: zero means a push left and up. The neutral ground is rgb(128,128,0), and when the map rises the row uncovered at the bottom must be repainted neutral.
  • The WebGL canvas must be created with premultipliedAlpha and the colour multiplied by alpha in the shader, otherwise the steam's edge leaves a dark halo over the photo.
  • A photo that always fills the screen puts the cup under the headline on a portrait phone: here the photo is at least 80 % tall and, when it is taller than the page, it is cut 40 % above and 60 % below.
  • Software WebGL (recordings, computers without a graphics card) is much slower: the canvas is under half the page pixels and the shader leaves at once outside the steam column.
  • Without WebGL the photo stays with its own still steam: the canvas isn't shown and the page still works.

Libraries

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

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

Testing

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