Skip to content
animorio
IT
Back to the library

Liquid glass icons

HoverCanvas, GSAPAdvancedCompressed weight: Demo 8.3 KBGSAP 28 KBFreeDownload the zip

Three liquid glass app icons in a row on a light grey background, with a violet light behind them and a fine grid: the rim of the glass bends the lines behind it, a lens follows the pointer and magnifies the symbol, the rim light turns with the tilt and, pressed, the icon squashes like jelly, ripples and springs back while its name gives way to Opening.

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>
<!--
  "Liquid glass icons" 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 liquid glass icon under the pointer</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>
  <main class="stage" data-stage>
    <!-- the page behind the glass: a soft light and a fine grid, painted on a canvas so the icons can bend it -->
    <canvas class="stage__bg" data-bg aria-hidden="true"></canvas>

    <!-- three app icons of liquid glass: the glass bends what is under it, a lens follows the pointer,
         the rim light turns with the tilt and a press squashes the icon like gel -->
    <ul class="row" data-row aria-label="Apps">
      <li class="app" data-app data-glyph="spark">
        <span class="app__shadow" data-shadow aria-hidden="true"></span>
        <button class="app__icon" type="button" data-icon><canvas class="app__glass" data-glass aria-hidden="true"></canvas></button>
        <span class="app__name"><span class="app__line" data-name></span><span class="app__line app__line--open">Opening</span></span>
      </li>
      <li class="app" data-app data-glyph="bars">
        <span class="app__shadow" data-shadow aria-hidden="true"></span>
        <button class="app__icon" type="button" data-icon><canvas class="app__glass" data-glass aria-hidden="true"></canvas></button>
        <span class="app__name"><span class="app__line" data-name></span><span class="app__line app__line--open">Opening</span></span>
      </li>
      <li class="app" data-app data-glyph="rings">
        <span class="app__shadow" data-shadow aria-hidden="true"></span>
        <button class="app__icon" type="button" data-icon><canvas class="app__glass" data-glass aria-hidden="true"></canvas></button>
        <span class="app__name"><span class="app__line" data-name></span><span class="app__line app__line--open">Opening</span></span>
      </li>
    </ul>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></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.

15 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 “Liquid glass icons” 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 very light grey background, with a soft violet light in the middle and a fine grid fading towards the edges, there are three glass app icons, shaped like squircles, with their names in grey below: Sorrin, an assistant with a four-pointed star, Ondra, a music app with four bars, and Pyxa, a photo app with three overlapping circles. The glass really bends what is behind it: towards the rim the lines of the grid curve and split into a thread of colours, and a bright reflection runs along the edge. The icons float by a hair, each at its own pace. With the pointer over it the icon lifts, its shadow widens, it tilts towards the pointer and the rim light turns with it; under the pointer a lens magnifies the symbol and warps it like a liquid, with a white glow. Pressed, the icon squashes like jelly as its shadow tightens, a ripple spreads from the point touched and, on release, it springs back up with an elastic bounce while the name slides away and Opening takes its place, then comes back. A drawn pointer visits the three icons, wanders over each one and presses it, then leaves and starts again.

How it works

The glass is a canvas that reads the background

The page background, the light and the grid, is painted on a canvas. Each icon copies the piece behind it, with a margin all round, and adds its symbol: from this still image the glass picks, pixel by pixel, the colour to show, shifted a little. That shift is what makes the glass.

The rim that bends

The shape is a superellipse with exponent 5, the squircle of app icons. For each pixel the distance from the edge and the direction the edge faces are worked out once: in the last fifth the pixel picks further and further out, so the background lines beyond the rim come into the glass curved. Red, green and blue pick at slightly different distances: the thread of colours.

The lens and the ripple

Under the pointer the shift goes towards the pointer itself, along a Gaussian bell: a magnifying lens. On press a ring spreads and dies out in a second and a half, while a slight sinusoidal wobble makes the glass look liquid. The canvas is redrawn only while the icon is alive.

The light on top

Over the shifted pixels there are a white haze from the top, a soft sheen and the rim: a very thin dark line and, over it, a specular light on a linear gradient whose angle follows the icon’s tilt, read with gsap.getProperty. The pointer carries a white glow with it.

The jelly and the autopilot

GSAP tilts the icon towards the pointer, squashes it wide and low on press with its origin at the bottom and lets it go with elastic.out, while the shadow tightens and widens. The name and Opening sit in one window and slide together. A drawn pointer follows a timeline that visits, strokes and presses each icon; a real touch stops it, and after six quiet seconds it starts again.

Values to change

NameFileDefaultWhat it changes
APPSscript.jsSorrin, Ondra, PyxaThe names of the three apps, separated by commas.
ACCENTscript.js#5b63f5The colour of the symbols and of the light behind the glass.
LENSscript.js1How much the lens following the pointer magnifies.
EDGEscript.js1How much the rim of the glass bends what is behind it.
RIPPLEscript.js1How much the glass ripples when you press it.
TILTscript.js1How far the icon tilts towards the pointer.
SQUASHscript.js1How much it squashes like jelly when pressed.
PRISMscript.js1How far the colours split where the glass bends.

Try them in the Playground

When to use it

For the home screen of a site presenting an app or a suite of apps, a studio’s «our apps» section, a dashboard’s quick links, or any icon that should feel like a real glass object under the finger.

On phones

The icons are sized on width and height together, so all three fit in a row in the box; each icon’s canvas is rebuilt at its real size and the background grid is redrawn. Touch does what the mouse does: it rests, lifts and tilts the icon, presses it, and lets it go after a moment.

With reduced motion

The icons stay still, without floating, tilting or squashing, and there is no drawn pointer; the glass still bends the background, the lens does not move and on press the name gives way to Opening with a fade.

Pitfalls

  • If the glass only picks inside the icon, at the rim it has nothing to bend and looks like plastic: it needs a margin of background around it, which is where the lines are taken and curved.
  • The position to copy the background from must be read with offsetLeft and offsetTop, not getBoundingClientRect: an icon floating or scaling in would get a shifted piece of background.
  • Working out the shape every frame costs too much: edge distance, mask and rim shift are prepared once and redone only on resize.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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