Skip to content
animorio
IT
Back to the library

Fluted glass background

Backgrounds, WebGL, HoverGSAP, WebGL, CSS onlyAdvancedCompressed weight: Demo 7.6 KBGSAP 28 KBFreeDownload the zip

An animated background for an AI app’s hero, on near black: behind the headline a pane of fluted glass with vertical ribs, and under the glass a soft violet light that drifts by itself and follows the pointer. Each rib turns the light over and squeezes it into a row of bright strips; where the pointer passes the ribs spread apart like under a lens, and on the button the light gathers into a bright core. A hand-written WebGL shader, in the Libraries.dev 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>
<!--
  "Fluted glass 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 fluted glass background that bends the light behind the headline</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 hero of an invented AI notes app, Halcyon, on near black: behind the words a pane of fluted glass, and under the
       glass a soft violet light that drifts by itself and follows the pointer; the ribs split it into bright strips, and
       where the pointer passes they bend apart like a lens and the light gathers -->
  <main class="stage" data-stage>
    <canvas class="glass" data-glass aria-hidden="true"></canvas>
    <span class="grain" aria-hidden="true"></span>

    <section class="hero" aria-labelledby="hero-title">
      <p class="pill" data-in>
        <span class="pill__tag">New</span>
        <span class="pill__text">Halcyon 2 reads your whole inbox</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>Clear thinking,<br>in any light</h1>
      <p class="lede" data-in>Notes, mail and documents in one quiet place. Ask, and Halcyon answers with the sources in view.</p>
      <div class="actions" data-in>
        <button class="cta" type="button" data-cta>
          <span class="cta__shine" aria-hidden="true"></span>
          <span class="cta__label">Start for free</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>
        <span class="note">No card needed</span>
      </div>
    </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.

23 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 “Fluted glass 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 an invented AI notes app, Halcyon, on near black: a pill «New · Halcyon 2 reads your whole inbox», the big two-line headline «Clear thinking, in any light», a lighter line of text and the button «Start for free» with «No card needed» beside it. Behind it there is a pane of fluted glass: on arrival the glass is flat and the violet light underneath is just a soft patch; then the ribs come up and the patch breaks into a row of bright strips, each with its dark edge, a thread of glint on one side and a sheen following the curve of the rib; the words rise one after another and settle with a one-pixel give. The light never stands still: a main body follows the pointer on a spring, two fainter ones drift slowly on their own. Where the pointer passes the ribs spread and bend as if under a lens, and the light there grows brighter. On the button the light narrows and gathers into a bright core right behind it, a violet blade crosses it and the arrow jumps forward; pressed, it squashes and springs back, and the light kicks and opens out again. If nobody moves the pointer, a drawn one moves around the page and presses the button.

How it works

One triangle covering the page

The WebGL canvas draws a single triangle bigger than the screen, and all the work is in the fragment shader: for every pixel it works out which rib it falls in and where inside the rib, from minus a half to plus a half.

The rib as a lens

Each rib does not show the light behind it but samples it shifted by its position inside the rib times REFRACT: above one the strip turns over and squeezes. A little vertical shift, growing towards the edges of the rib, gives the curve of the glass.

The pointer’s lens

Near the pointer the coordinates are squeezed with a Gaussian bell, so the ribs look wider, and the refraction grows with BEND: the glass bends and the light gathers.

The light under the glass

The light is the sum of three soft bells: one follows the pointer on a hand-written spring, two drift slowly on slow sines. A narrower bright core sits in the middle of the first, and on the button everything narrows and rises.

The shape of the rib

Each rib has cosine shading that makes it look round, a dark groove at the joint, a thread of glint near one edge and a wide sheen: the more light behind, the brighter they get.

The entrance and the drawn pointer

On arrival the ribs come up from flat glass in 1.8 seconds, and the words rise staggered with a one-pixel settle. After a few seconds without a pointer a looping timeline moves a drawn pointer that presses the button; the first real movement stops it.

Values to change

NameFileDefaultWhat it changes
RIBscript.js26Width of one rib of the glass, in pixels.
REFRACTscript.js1.7How much each rib turns the light over and squeezes it (0 flat glass).
BENDscript.js0.75How much the ribs spread under the pointer (0 not at all).
GLOWscript.js1How strong the light is.
DRIFTscript.js1How much the light drifts on its own (0 still).
FOLLOWscript.js0.9How much the light follows the pointer (0 not at all, 1 fully).
AUTO_PILOTscript.js4After how many seconds without a pointer the drawn one starts moving (0 never).

Try them in the Playground

When to use it

For the hero of an AI app or product, a launch page, a studio’s header: when you need a dark background with material and light that still leaves the headline in front.

On phones

Same animations: the ribs stay RIB pixels wide, the light is sized on the short side of the screen and follows the finger; the button and the text fit inside the box.

With reduced motion

With reduced motion the glass and the light are already in place, still, and the words only fade in.

Pitfalls

  • With a wide light the glass fills up and the headline gets lost: the light has to stay in a gathered patch, with a strong vignette, and the small text has a wide shadow in the night colour.
  • The glint of the ribs has to be multiplied by the light behind them: lit everywhere it draws white lines in the dark and the glass looks like a curtain.
  • gl_FragCoord starts from the bottom: the pointer and the lights must be passed with y flipped and in device pixels.
  • Without WebGL the CSS background stays: a radial violet light under thin lines.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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