Skip to content
animorio
IT
Back to the library

Words out of the fog

Text, WebGL, ScrollWebGL, Canvas, GSAPAdvancedCompressed weight: Demo 11 KBGSAP 28 KBFreeDownload the zip

Scroll inside the preview

The scrolling story of the page of a made-up school that teaches by working on real projects, Ashlar School of Practice: five short sentences composed like a poster, one big Playfair Display word, one mint italic with a thin flourish and two or three small words set off to the side. Each sentence is drawn on a canvas and handed to a hand-written WebGL plane with the shader of the Why Zero site: a cloudy noise front runs from left to right, the letters come out of a blur and get sharp, and right on the front the colour flares, more saturated and brighter. The scroll decides when a sentence lights up or goes out, backwards too; time decides how: 4 seconds on outExpo to come in, 0.3 to go.

Rebuilt from scratch studying why.zero.university by Sindhur Dutta, Zero: the idea is theirs; code, copy and images are ours. Read how it’s made

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>
<!--
  "Words out of the fog" 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>Ashlar School of Practice: learn by doing real work</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/playfair-display@5.3.0/wght.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/playfair-display@5.3.0/wght-italic.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/instrument-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the scrolling story of the page of a made-up school, Ashlar School of Practice: five short sentences, each drawn
       on a canvas and passed to a hand-written WebGL plane. Each one lights up out of a noisy fog, from blur to sharp,
       with a bright front, when the scroll reaches it, and goes out when the scroll leaves it, backwards too -->
  <div class="story" data-story>
    <div class="stage" data-stage>
      <div class="tone" data-tone aria-hidden="true"></div>
      <canvas class="gl" data-gl aria-hidden="true"></canvas>
      <div class="dom-words" data-dom aria-hidden="true"></div>
      <div class="grain" data-grain aria-hidden="true"></div>

      <header class="bar" data-bar>
        <a class="brand" href="#" aria-label="Ashlar School of Practice">
          <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true">
            <path d="M4.5 7.5 12 3.5l7.5 4v9L12 20.5l-7.5-4Z"/>
            <path d="M4.5 7.5 12 11.5l7.5-4M12 11.5v9"/>
          </svg>
          <span>Ashlar</span>
        </a>
        <nav class="links" aria-label="Main">
          <a href="#">Programs</a>
          <a href="#">Mentors</a>
          <a href="#">Outcomes</a>
        </nav>
        <a class="apply" href="#" data-apply>
          <span class="apply__fill" aria-hidden="true"></span>
          <span class="apply__shine" aria-hidden="true" data-shine></span>
          <span class="apply__text">Apply</span>
          <svg class="apply__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h8.5M8.6 4.4 12.2 8l-3.6 3.6"/></svg>
        </a>
      </header>

      <h1 class="sr">Ashlar School of Practice</h1>
      <ol class="sr" data-lines>
        <li>You learned all the theory,</li>
        <li>but nobody let you build.</li>
        <li>So here you make real things</li>
        <li>for real clients, with mentors who still ship,</li>
        <li>and you leave hired, with work to show.</li>
      </ol>

      <p class="hint" data-hint aria-hidden="true"><span class="hint__line"><i></i></span><span>Scroll to read</span></p>

      <dl class="facts" data-facts>
        <div><dt>Next cohort</dt><dd>12 January</dd></div>
        <div><dt>Seats</dt><dd>40</dd></div>
        <div><dt>Length</dt><dd>14 weeks</dd></div>
        <div><dt>Hired in six months</dt><dd>91%</dd></div>
      </dl>
    </div>
  </div>

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

39 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 “Words out of the fog” 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 green ground, with a soft light in the middle and a barely visible film grain, a dark glass bar at the top holds the Ashlar mark, three links and the Apply button. In the middle the first sentence lights up, «You learned all the Theory»: from left to right, with a cloudy edge that changes every time, the letters move from fog to a sharp shape, and on the front the colour flares, the italic turns a vivid mint and the ivory gets brighter, then it all settles. Scrolling, the sentence goes out in three tenths of a second and the next lights up in its place, leaning slightly left or right: «but nobody let you Build», «so here you Make real things», «for real clients, with Mentors who still ship», «and you leave Hired with work to show». Between one sentence and the next the ground shifts tone a touch; once arrived, the sentence breathes by a pixel. Under the last one four facts about the next cohort appear one after the other. Scrolling back up the sentences light up again backwards. Over Apply the mint rises from below, the label widens and the arrow steps forward; pressing sinks the button.

How it works

A sentence composed on a canvas

Each sentence is a list of pieces: the text, the kind (big, italic, small) and the position of its baseline in units of the big word. measureText gives the box of each, and the box of the sentence sets the size, measured on both the width and the height of the page like a min(vw, vh). First the mint halo is drawn with shadowBlur, then the crisp letters with a light gradient, and under the italics a thin flourish made of two Bézier curves.

One plane per sentence, in hand-written WebGL

The canvas becomes a premultiplied texture and a two-triangle rectangle puts it in place, in pixels. In the fragment shader, like the site: p = progress * 1.3; mask = uv.x * 0.5 + vnoise(uv * 4 + seed) * 0.5, so the front runs from left to right with a cloudy edge, and the seed changes at every entrance. Alpha is smoothstep(p + 0.3, p - 0.1, mask).

The blur that melts

blurFactor = smoothstep(p - 0.5, p + 0.3, mask): behind the front the letters are already sharp, ahead of it still blurred. The radius is blurFactor * 6 * 0.003 and there are seven samples, the centre counted twice and six on a hexagon; below 0.03 a single sample is read, and at full progress the texture passes through untouched.

The flare on the front

flare = smoothstep(p - 0.85, p + 0.1, mask), switched off between 0.8 and 1 of progress. The colour is un-premultiplied, pushed away from the grey of its luminance up to four times and brightened by 25%, then premultiplied again: the mint italic glows, the ivory picks up a hint of green.

Scroll decides when, time decides how

Each sentence has a scroll window and four states: hidden, appearing, visible, disappearing. Going down it lights up when the scroll enters its window and goes out when it passes it; going up, the other way round. The entrance takes 4 s on outExpo, 1 - 2^(-10t), the exit 0.3 s on smoothstep, whatever the scroll does.

The finer touches and the fallback

The light of the ground slides towards the tone of the lit sentence, the grain moves eleven times a second, an arrived sentence breathes by a pixel, the facts under the last one come in staggered on a spring. Without WebGL the same canvases sit in the DOM and fade in from a CSS blur; the real text is in a list for screen readers.

Values to change

NameFileDefaultWhat it changes
APPEAR_TIMEscript.js4Seconds a sentence takes to light up, on outExpo (the site uses 4).
DISAPPEAR_TIMEscript.js0.3Seconds a sentence takes to go out when the scroll leaves it (the site uses 0.3).
MAX_BLURscript.js6How blurred the words are before the front reaches them (the site uses 6).
NOISE_SCALEscript.js4How cloudy the front is: higher means smaller clouds (the site uses 4).
FLAREscript.js1How bright and saturated the front is: 0 none, 1 like the site.
STORY_LENGTHscript.js1How much scroll the story takes: 2 is twice as long.
GRAINscript.js0.06How visible the film grain is: 0 none.
BREATHscript.js1Pixels a sentence breathes up and down once it has arrived: 0 still.

Try them in the Playground

When to use it

For the scrolling story of the landing page of a school, a course, a startup or a brand manifesto: when every sentence should get its moment and arrive like a thought coming into focus, in a high-contrast typeface. The real text stays on the page for Google and screen readers.

On phones

The same animation with adapted sizes: each sentence is sized on both width and height, the sentences stay centred without leaning, the bar keeps only the mark and Apply, and the facts under the last sentence wrap onto two rows. Everything is redrawn at every resize, even halfway through an entrance.

With reduced motion

No front, no blur, no flare and no breathing: each sentence simply fades in and out when the scroll reaches it, the ground changes tone without sliding and the grain stays still.

Pitfalls

  • The texture must be uploaded premultiplied (UNPACK_PREMULTIPLY_ALPHA_WEBGL): with straight alpha the six blur samples mix in the black of the transparent pixels and a dark halo shows around the letters.
  • The flare is computed on the un-premultiplied colour: applied to a premultiplied colour it saturates the semi-transparent edges too and turns them into coloured fringes.
  • The blur radius in uv must be corrected for the shape of the plane (r and r * aspect): a sentence four times wider than tall, without the correction, blurs only vertically.
  • The typeface must be loaded before drawing on the canvas (document.fonts.load for roman and italic), otherwise the sentences stay in Georgia.
  • The Why Zero site keeps its sentences only in a texture atlas and has no prefers-reduced-motion on them: here the real text is on the page and with reduced motion the sentences only fade.

Libraries

GSAP 3.15.0, Playfair Display (font variabile) 5.3.0, Instrument Sans (font variabile) 5.3.0.

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

Testing

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