Skip to content
animorio
IT
Back to the library

Font tester

Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 10 KBGSAP 28 KBFreeDownload the zip

The type tester on the page of a typeface by a made-up foundry, Halden Type Foundry: a big line you can type in a real variable font, three hairline sliders for weight, width and size with rolling values, style pills that carry the sliders on a spring, and the letter under the pointer drawn large in a panel with its lines (ascender, cap height, x-height, baseline, descender), its Unicode name and its advance width. The letters near the pointer widen a breath. Minimal, premium 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>
<!--
  "Font tester" 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>Halden Grotesk, type tester</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/jetbrains-mono@5.3.0/index.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- the type tester on the page of a typeface by a made-up foundry: a big editable line, three hairline sliders
       (Weight, Width, Size) with values that roll, style pills that carry the sliders on a spring, and the letter under
       the pointer shown large in a panel with its metric lines, its Unicode name and its advance width -->
  <main class="prova" data-prova>
    <header class="testa">
      <div class="testa__marchio">
        <span class="mono">Halden Type Foundry</span>
        <h1 class="testa__nome">Halden Grotesk</h1>
      </div>
      <p class="mono testa__nota">Variable &middot; 2 axes &middot; Latin</p>
    </header>

    <section class="banco">
      <div class="colonna">
        <div class="campione-box">
          <p class="campione" data-campione contenteditable="true" spellcheck="false" role="textbox" aria-label="Type to test Halden Grotesk">Quiet letters, set with care.</p>
        </div>

        <div class="stili" role="group" aria-label="Styles" data-stili>
          <span class="stili__fondo" data-stili-fondo aria-hidden="true"></span>
          <button type="button" class="stile" data-stile data-wght="300" data-wdth="100">Light</button>
          <button type="button" class="stile is-on" data-stile data-wght="420" data-wdth="100" aria-pressed="true">Regular</button>
          <button type="button" class="stile" data-stile data-wght="780" data-wdth="100">Bold</button>
          <button type="button" class="stile" data-stile data-wght="560" data-wdth="76">Condensed</button>
          <button type="button" class="stile" data-stile data-wght="520" data-wdth="122">Wide</button>
        </div>

        <div class="cursori">
          <label class="cursore" data-cursore="wght">
            <span class="cursore__nome mono">Weight</span>
            <span class="cursore__pista"><span class="cursore__pieno" data-pieno></span><span class="cursore__manico" data-manico></span>
              <input type="range" min="200" max="900" step="1" value="420" data-input></span>
            <span class="cursore__valore mono" data-valore><span class="riga" data-riga>420</span></span>
          </label>
          <label class="cursore" data-cursore="wdth">
            <span class="cursore__nome mono">Width</span>
            <span class="cursore__pista"><span class="cursore__pieno" data-pieno></span><span class="cursore__manico" data-manico></span>
              <input type="range" min="75" max="125" step="1" value="100" data-input></span>
            <span class="cursore__valore mono" data-valore><span class="riga" data-riga>100</span></span>
          </label>
          <label class="cursore" data-cursore="size">
            <span class="cursore__nome mono">Size</span>
            <span class="cursore__pista"><span class="cursore__pieno" data-pieno></span><span class="cursore__manico" data-manico></span>
              <input type="range" min="24" max="120" step="1" value="72" data-input></span>
            <span class="cursore__valore mono" data-valore><span class="riga" data-riga>72</span></span>
          </label>
        </div>
      </div>

      <figure class="glifo" data-glifo aria-live="polite">
        <svg class="glifo__tela" data-tela aria-hidden="true">
          <g data-linee></g>
          <g data-guance></g>
          <text class="glifo__lettera" data-lettera>Q</text>
        </svg>
        <figcaption class="glifo__dati">
          <span class="mono glifo__nome" data-nome-u>U+0051 Latin capital letter Q</span>
          <span class="mono glifo__largo" data-largo>Advance 742</span>
        </figcaption>
      </figure>
    </section>
  </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.

31 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 “Font tester” 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 test page of Halden Grotesk, a typeface by a made-up foundry, Halden Type Foundry. At the top the names of the foundry and the face. On the left a big line, «Quiet letters, set with care.», that you can retype: it is set in a real variable font (Mona Sans, weight and width axes). Below, five styles in pills (Light, Regular, Bold, Condensed, Wide), with an ink pill sliding under the chosen one, and three hairline sliders: Weight, Width and Size, with a vermilion handle and the value rolling to the new number. Choosing a style carries the sliders there on a spring, and the line changes weight and width on the way. On the right a paper-coloured panel: passing the pointer over the letters, the one under it turns vermilion and appears large in the panel, on its hairlines (ascender, cap height, x-height, the baseline in vermilion, descender) with the two dashed sidebearings moving to its width; underneath, its Unicode name and its advance in thousandths of an em. The letters near the pointer widen a breath on the width axis, only them. Left alone, the tester shows itself: the pointer runs over the letters, picks Bold, narrows and widens the width, changes the size and goes back to Regular; the first real touch stops it.

How it works

One letter, one span

The line is a contenteditable split into one span per character; on every input it is rebuilt and the text caret goes back to its place (the position is counted with a Range before and put back after). Enter leaves the line and paste inserts plain text only.

The neighbours widen

Every frame each letter has its own extra width: NEAR_WIDEN times a Gaussian of the distance from the pointer (radius NEAR_REACH em), chased at FOLLOW per frame and corrected for the frame time. It is written into its font-variation-settings, on top of the slider’s width.

The letter panel

The lines come from the face’s metrics measured once on a canvas (H for cap height, x for x-height, d for ascender, p for descender); the letter’s width from a hidden ruler with the same axes. The old letter leaves upwards, then the new one rises onto the baseline; the dashed sidebearings glide to the new width.

Rolling numbers

Each value is a window: first the old row leaves upwards and disappears, then the new one comes in from below, so two are never read at once. Dragging a slider changes the number at once, without rolling.

Values to change

NameFileDefaultWhat it changes
SPRINGscript.js0.9Seconds a style takes to carry the sliders to its values.
NEAR_WIDENscript.js9How much the letters near the pointer widen, in width-axis units.
NEAR_REACHscript.js1.1How far the widening reaches, in ems of the line.
FOLLOWscript.js0.18How fast each letter follows its width, per frame.
ROLLscript.js0.32Seconds a value takes to roll to the new number.
GLYPH_SWAPscript.js0.28Seconds the big letter takes to come into the panel.
TOUR_PAUSEscript.js6Seconds of quiet before the tester shows itself again.

Try them in the Playground

When to use it

For a foundry’s typeface page, a specimen, a graphic design studio’s site or a typography blog: wherever visitors should try the face with their own words.

On phones

The same animations. The line sits at the top and scales with the width, styles and sliders below, and the letter panel below again, with the letter on the left and the Unicode name beside it.

With reduced motion

No widening letters and no self-running tour; the styles set the sliders at once, the numbers and the big letter change with a fade.

Pitfalls

  • Rebuilding the contenteditable on every input sends the caret to the start: count it first with a Range and put it back after; never rebuild during composition (Asian keyboards).
  • Rolling values: the old row leaves first, then the new one comes in, or for a moment you read two.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, JetBrains Mono (font variabile) 5.3.0.

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

Testing

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