Skip to content
animorio
IT
Back to the library

SEO preview field

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

The Search appearance panel of a made-up blog editor, Inkhouse, for a post on a sailing blog. The SEO title is measured the way a search engine measures it, in pixels of 20 px Arial against the 600 of a result; the meta description in characters, up to 155. Under each field a thin meter goes from grey (too short) to green and turns amber past the limit mark, and a badge flips to say so. Below, the search result the post will make rewrites itself word by word: new words rise in with a blue light that cools, and when the title is too long the words past the cut fold away into the ellipsis, exactly where a real result would cut them, while in the field the same letters take an amber wash. The Desktop and Mobile switch narrows the result into the phone card, where the title wraps instead.

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>
<!--
  "SEO preview field" 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 SEO title field with the search result preview that updates as you type</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 Search appearance panel of a made-up blog editor, Inkhouse: the SEO title and the meta description, each
         with a length meter that runs from green to amber, and below them the search result the post will make,
         rewritten word by word as you type and cut with an ellipsis where a real result would cut it -->
    <section class="panel" data-panel aria-labelledby="panel-title">
      <span class="panel__shine" aria-hidden="true"></span>

      <header class="head" data-rise>
        <span class="head__app" aria-hidden="true">
          <svg viewBox="0 0 20 20"><path d="M5 15.5 13.8 6.7a1.9 1.9 0 0 1 2.7 2.7L7.7 18.2 4 19z"/><path d="M12.4 8.1l2.7 2.7"/><path d="M3 4.5h6M3 8h3.5"/></svg>
        </span>
        <span class="head__meta">
          <span class="head__app-name">Inkhouse</span>
          <span class="head__title" id="panel-title">Search appearance</span>
        </span>
        <span class="head__post">Post settings</span>
      </header>

      <div class="field" data-field="title" data-rise>
        <div class="field__top">
          <label class="field__label" for="seo-title">SEO title</label>
          <span class="badge" data-badge>
            <span class="badge__in" data-badge-in>
              <svg class="badge__icon" viewBox="0 0 16 16" aria-hidden="true" data-icon-ok><path d="M3.8 8.4l2.7 2.6 5.7-6"/></svg>
              <svg class="badge__icon" viewBox="0 0 16 16" aria-hidden="true" data-icon-warn hidden><path d="M8 3.2v5.6"/><path d="M8 11.6v.2"/></svg>
              <span data-badge-text>Add a title</span>
            </span>
          </span>
        </div>
        <div class="box" data-box>
          <div class="box__mirror" aria-hidden="true" data-mirror></div>
          <input class="box__input" id="seo-title" data-input type="text" autocomplete="off" spellcheck="false" placeholder="Write the title people will see in search">
        </div>
        <div class="meter" aria-hidden="true">
          <span class="meter__track"><span class="meter__fill" data-fill></span><span class="meter__mark"></span></span>
          <span class="meter__count"><span data-count>0</span> px of 600</span>
        </div>
      </div>

      <div class="field" data-field="desc" data-rise>
        <div class="field__top">
          <label class="field__label" for="seo-desc">Meta description</label>
          <span class="badge" data-badge>
            <span class="badge__in" data-badge-in>
              <svg class="badge__icon" viewBox="0 0 16 16" aria-hidden="true" data-icon-ok><path d="M3.8 8.4l2.7 2.6 5.7-6"/></svg>
              <svg class="badge__icon" viewBox="0 0 16 16" aria-hidden="true" data-icon-warn hidden><path d="M8 3.2v5.6"/><path d="M8 11.6v.2"/></svg>
              <span data-badge-text>Add a description</span>
            </span>
          </span>
        </div>
        <div class="box box--area" data-box>
          <div class="box__mirror" aria-hidden="true" data-mirror></div>
          <textarea class="box__input" id="seo-desc" data-input rows="2" spellcheck="false" placeholder="One or two lines that make people click"></textarea>
        </div>
        <div class="meter" aria-hidden="true">
          <span class="meter__track"><span class="meter__fill" data-fill></span><span class="meter__mark"></span></span>
          <span class="meter__count"><span data-count>0</span> of 155 characters</span>
        </div>
      </div>

      <div class="preview" data-rise>
        <div class="preview__top">
          <span class="preview__label">Search preview</span>
          <span class="seg" role="group" aria-label="Preview size" data-seg>
            <span class="seg__pill" data-seg-pill aria-hidden="true"></span>
            <button class="seg__btn is-on" type="button" data-device="desktop" aria-pressed="true">Desktop</button>
            <button class="seg__btn" type="button" data-device="mobile" aria-pressed="false">Mobile</button>
          </span>
        </div>
        <div class="result-wrap" data-wrap>
          <article class="result" data-result>
            <div class="result__site">
              <span class="result__fav" aria-hidden="true">S</span>
              <span class="result__who">
                <span class="result__name">The Slow Sail</span>
                <span class="result__url">theslowsail.com <svg viewBox="0 0 8 8" aria-hidden="true"><path d="M2.6 1.6 5 4 2.6 6.4"/></svg> journal <svg viewBox="0 0 8 8" aria-hidden="true"><path d="M2.6 1.6 5 4 2.6 6.4"/></svg> winter-refit</span>
              </span>
            </div>
            <h2 class="result__title" data-rtitle></h2>
            <p class="result__desc" data-rdesc></p>
          </article>
        </div>
      </div>
    </section>

    <svg class="pointer" data-pointer viewBox="0 0 20 20" aria-hidden="true">
      <path d="M4.5 2.8l10.6 8.1-4.6.6 2.6 5.1-2.1 1-2.6-5.1-3.4 3.2z" />
    </svg>
    <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.

41 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 “SEO preview field” 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 warm paper sits a white panel with 22 pixel corners, a one pixel border and three soft shadows, with a faint blue glow at the top. In the header the dark Inkhouse icon, Search appearance and the Post settings pill. The SEO title and the meta description are real fields you can type into: behind each one, transparent, sits a copy of the text that washes in amber the letters past the cut. Under each field a thin meter with the limit mark at 85%, the number (pixels for the title, characters for the description) and a badge that flips on a spring: Add a title, A bit short, Good length, Too long, gets cut; going over the limit gives the field a small jolt. At the bottom the post's search result, as wide as a real one (600 pixels) and scaled down to fit the panel: icon, site name, path, blue title and grey description. Each new word rises with a blue light that cools, a changed word flashes, deleted ones leave in a blur, and the ellipsis arrives when the title goes past 600 pixels. The Desktop and Mobile switch has a white pill that stretches as it travels and settles on a spring; in Mobile the result becomes a phone card and the title wraps instead of being cut. Left alone, a drawn pointer types a title, goes past the limit, takes it back, writes the description and tries the phone view, then clears it and starts again.

How it works

Measuring like a search engine

The title is not counted in characters but in pixels: a hidden canvas measures the text with measureText in 20 px Arial, the way a result draws it, against a limit of 600. To find the cut, one word at a time is dropped until the rest plus the ellipsis fits in 600 pixels.

The real field and its copy

The field is an input (or a textarea) with transparent text and a visible caret; behind it, in the same font and sizes, a copy of the text split in two: the letters that stay and the ones past the cut, with the amber wash. The field's scroll is copied onto the copy.

The result word by word

The result's title and description are spans, one per word. On every change they are compared with the new words: new ones rise with a blue light, changed ones flash, extra ones leave in a blur, and the ellipsis comes and goes by itself.

The meter and the badge

The limit mark sits at 85% of the track, so going over has room to show. The colour moves from grey to green to amber with GSAP; the badge leaves upwards and comes back from below with the new text and icon.

Desktop and Mobile

The result stays a real 600 or 380 pixels wide and is scaled to fit the panel; the frame's height is measured again and animated. The switch pill first stretches towards the new option, then settles with back.out.

Values to change

NameFileDefaultWhat it changes
TITLE_LIMITscript.js600Pixels of 20 px Arial before the title is cut in the result.
DESC_LIMITscript.js155Characters before the description is cut.
TYPE_SPEEDscript.js0.05Seconds per letter when the pilot types.
RISEscript.js7How far a new word rises into the result, in pixels.
GLOWscript.js0.7Seconds of blue light on a new word.
SPRINGscript.js1.6How much the switch pill overshoots: 1 is none.
LOOPscript.jstrueLeft alone, the pilot shows it again.

Try them in the Playground

When to use it

For a blog or CMS editor, for page settings in a site builder, for an SEO tool: anywhere a writer needs to see right away how a title will look in search results, and where it will be cut.

On phones

The same animations with adapted sizes: the panel takes almost the full width and scales with the screen height; when the screen is short the description field gives its room to the preview, which still shows it.

With reduced motion

No pointer, no rising words and no jolts: the fields are already filled, badges and meter change at once, the result updates with fades as you type.

Pitfalls

  • A result's title is cut in pixels, not characters: counting letters gives the wrong cut with wide letters (m, w) or narrow ones (i, l).
  • The field with transparent text and the copy behind must share the same font, line height and spacing, or the caret lands on the wrong letter.
  • A one line field scrolls sideways when the text is long: the copy behind must scroll the same way, on every scroll and every key.
  • The result must be scaled down, not narrowed: narrowed, the title would wrap earlier and the cut would no longer be the real one.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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