Skip to content
animorio
IT
Back to the library

Haze answer loader

WebGL, HoverWebGL, GSAPMediumCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

A WebGL loading animation for AI apps: the answer panel of an assistant for data, dark on a near black page. While the model thinks the answer is already there, but seen through hot air: a 2D shader bends, softens and splits the words into two colour fringes, with a glow of heat behind them. When the thinking ends a line of light sweeps down the text and leaves it sharp, the numbers roll in below, and Regenerate brings the heat back up from the bottom. With the pointer a small bubble of warm air rises over the words.

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>
<!--
  "Haze answer loader" 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 AI chat answer loader that clears from the haze</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">
    <!-- the reply panel of an AI analytics assistant. While the model thinks, its draft answer is already there but
         seen through hot air: a WebGL shader bends, blurs and splits the words with a rising flow of noise and a
         warm glow behind them. When the thinking ends a thin line of light sweeps down the answer and leaves it
         sharp; the numbers roll in under it. Regenerate brings the heat back up from the bottom. The pointer
         over the answer warms a small bubble of air of its own. -->
    <section class="chat" data-chat>
      <header class="chat__head">
        <svg class="chat__mark" viewBox="0 0 20 20" aria-hidden="true">
          <circle cx="10" cy="10" r="7.2"/>
          <path d="M10 2.8v14.4M4.2 6.6c3.6 2 8 2 11.6 0M4.2 13.4c3.6-2 8-2 11.6 0"/>
        </svg>
        <span class="chat__brand">Verra</span>
        <span class="chat__model">Deep 3</span>
      </header>

      <p class="chat__ask">How did churn move in Q3?</p>

      <div class="chat__reply">
        <div class="chat__status" data-status>
          <svg class="chat__spark" viewBox="0 0 16 16" aria-hidden="true">
            <path d="M8 1.6c.5 3.3 3.1 5.9 6.4 6.4-3.3.5-5.9 3.1-6.4 6.4-.5-3.3-3.1-5.9-6.4-6.4 3.3-.5 5.9-3.1 6.4-6.4z"/>
          </svg>
          <span class="chat__status-words" data-status-words>Thinking</span>
          <span class="chat__secs" data-secs>0s</span>
          <svg class="chat__chev" data-chev viewBox="0 0 16 16" aria-hidden="true"><path d="M6 4l4 4-4 4"/></svg>
        </div>

        <div class="chat__answer" data-answer>
          <canvas class="chat__haze" data-canvas aria-hidden="true"></canvas>
          <span class="chat__front" data-front aria-hidden="true"></span>
          <p class="chat__text" data-text>Churn fell to 3.1% in Q3, down 0.4 points from Q2. Most of the drop came from annual plans, right after the onboarding checklist shipped in July.</p>
        </div>

        <div class="chat__stats" data-stats>
          <div class="chat__skels" data-skels aria-hidden="true"><i></i><i></i><i></i></div>
          <div class="chat__stat">
            <span class="chat__num"><span data-count="3.1" data-dec="1">3.1</span>%</span>
            <span class="chat__label">churn</span>
          </div>
          <div class="chat__stat">
            <span class="chat__num chat__num--down">
              <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M6 2v8M2.6 6.6L6 10l3.4-3.4"/></svg><span data-count="0.4" data-dec="1">0.4</span>&nbsp;pt
            </span>
            <span class="chat__label">vs Q2</span>
          </div>
          <div class="chat__stat">
            <span class="chat__num">+<span data-count="12" data-dec="0">12</span>%</span>
            <span class="chat__label">annual kept</span>
          </div>
        </div>

        <div class="chat__actions" data-actions>
          <button class="chat__act" type="button" data-copy>
            <svg viewBox="0 0 16 16" aria-hidden="true"><rect x="5.2" y="5.2" width="8" height="8" rx="2"/><path d="M10.8 3.4A1.8 1.8 0 0 0 9 2.6H4.4a1.8 1.8 0 0 0-1.8 1.8V9a1.8 1.8 0 0 0 .8 1.5"/></svg>
            <span data-copy-words>Copy</span>
          </button>
          <button class="chat__act" type="button" data-regen>
            <svg class="chat__regen-icon" data-regen-icon viewBox="0 0 16 16" aria-hidden="true"><path d="M13 8a5 5 0 1 1-1.6-3.7"/><path d="M11.8 1.8v2.8H9"/></svg>
            <span>Regenerate</span>
          </button>
        </div>
      </div>
    </section>
    <p class="sr" aria-live="polite" data-live></p>
  </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.

38 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 “Haze answer loader” 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 near black page the dark panel of an AI assistant for data rises slowly, ‘Verra’, with the ‘Deep 3’ model in a label on the right. At the top the question in a bubble, ‘How did churn move in Q3?’; below it, with a small orange star, the word ‘Thinking’ with a light running through its letters and the seconds counting. The answer is already there, but it looks as if seen through the air over tarmac in summer: the words wave, rise in slow swells, are a little blurred, dimmer and split into a warm and a cool fringe, and behind them an orange and purple glow breathes. After three seconds the label turns into ‘Thought for 3s’ with a small chevron, and a thin line of light, white in the middle and orange around it, sweeps down the text: above it the words become sharp and still again, and the ones it just left catch its light for a moment. Below, three numbers roll in (3.1% churn, the green arrow of 0.4 pt against the quarter before, +12% annual kept) with the Copy and Regenerate buttons. After a while Regenerate is pressed: it gives and comes back on a spring, its arrow spins once, the numbers go and the heat rises again from the bottom, line by line, until the answer is back in the haze and the assistant thinks again. With the pointer over the answer a small bubble of warm air follows it on a spring and makes only the words it touches shimmer; while you read, the loop waits.

How it works

The words in a texture

The answer is a real paragraph (it can be read, copied and heard by screen readers). Each word goes into a span, and a 2D canvas draws them one by one exactly where the browser put them: that canvas becomes the shader's texture. When the answer is sharp and still the WebGL canvas hides and the real text comes back.

The hot air

The shader reads the texture moved by two fractal noises that rise with time (5 px sideways, 8 vertically), averages five samples for the blur and reads three times for red, green and blue, so the edge of the letters splits into a warm and a cool fringe.

The front

How hot the air is at each point is decided by a horizontal front: below it there is haze, above it none, with an 18 px fade. GSAP takes it from top to bottom to clear and from bottom to top for Regenerate; on the front a 1 px white gaussian and an orange halo make the line of light.

The heat behind

A third noise, wider and slower, tints the background where there is haze between the purple and the orange from the CSS, faded at the canvas edges; the words darken and warm by the same amount. With premultipliedAlpha the alpha is the larger of the words and the added light.

The bubble and the loop

The pointer carries a second source of heat, a 28 px gaussian, on a spring integrated by hand (stiffness 190, damping 19). A GSAP timeline runs the loop: think, clear, numbers roll, wait, Regenerate; if the pointer is on the panel it stops before Regenerate.

Values to change

NameFileDefaultWhat it changes
THINKscript.js3.2How many seconds the model thinks before the answer clears.
SWEEPscript.js1.4How long the line of light takes to clear the answer, in seconds.
HOLDscript.js3.4How long the clear answer stays before Regenerate, in seconds.
WOBBLEscript.js1How much the hot air bends the words.
BLURscript.js1How much it softens them.
FRINGEscript.js1How far the warm and the cool fringes split apart.
GLOWscript.js1How bright the heat behind the words and the line are.
BUBBLEscript.js28How big the bubble of warm air under the pointer is, in pixels.
SPEEDscript.js12 = the loop twice as fast, 0.5 = half.
LOOPscript.jstrueRepeats the loop: think, clear, regenerate.

Try them in the Playground

When to use it

For the chat of an AI app, a data analytics tool or a SaaS service: the ‘thinking’ state of an answer, showing that the text is already there and arriving instead of an empty loader.

On phones

The same animation with adapted sizes: the panel is as wide as the box, the gaps shrink with the height, the haze and the line of light are the same and with a finger the bubble of warm air goes where you touch.

With reduced motion

The words do not wave or split: while it thinks the answer is only blurred, then it clears all at once with a fade, without the sweeping line; the numbers appear already at their value and Regenerate blurs it again with a fade.

Pitfalls

  • The text drawn in the texture has to sit exactly where the real one is, or the lines jump when the WebGL canvas hands over to the paragraph: that is why every word has its own span and the canvas draws it at its position, on the font's baseline.
  • The texture has to be redrawn on every resize and after the font has loaded (document.fonts.ready), or the words come out in the system font.
  • A texture that is not a power of two in WebGL 1 needs CLAMP_TO_EDGE and no mipmaps, otherwise it comes out black.

Libraries

GSAP 3.15.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 1 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