Skip to content
animorio
IT
Back to the library

Spellchecker fix

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

The editor of a made-up writing app, Penhold, on warm paper: in a short draft three words get a wavy line that draws itself underneath, two spelling mistakes in coral and one wordy phrase in violet. Tap a word and a glass card rises with the suggestion; pick it and the old word becomes the right one letter by letter: the letters they share slide to their new place with a little hop (the i and the e of recieve swap places), the ones not needed fall away, the missing ones rise in, and the word stays green for a moment before going back to ink. The count in the corner rolls from 3 to All clear with a check that draws itself and the clarity meter fills up.

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>
<!--
  "Spellchecker fix" 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 editor with the spellchecker that fixes the word letter by letter</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/newsreader@5.3.0/opsz.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage" data-stage>
    <!-- the editor of a made-up writing app, Penhold. Three words are flagged with a wavy line: two spelling mistakes
         and one wordy phrase. Click a flagged word and a glass card offers the fix; pick it and the letters of the old
         word slide, drop and rise into the new one, while the count in the top corner rolls down to All clear -->
    <section class="doc" data-doc aria-label="Penhold editor">
      <span class="doc__sheen" aria-hidden="true"></span>

      <header class="doc__head">
        <span class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true">
            <path d="M10 2.5l4.6 6.2-4.6 8.8-4.6-8.8z" />
            <path d="M10 2.5v9.2" />
            <circle cx="10" cy="11.9" r="1.3" />
          </svg>
          <span class="brand__name">Penhold</span>
        </span>
        <span class="count" data-count aria-live="polite">
          <span class="count__icon" aria-hidden="true">
            <svg viewBox="0 0 16 16">
              <circle class="count__ring" cx="8" cy="8" r="6.2" />
              <path class="count__check" data-check pathLength="1" d="M5 8.3l2 2 4-4.4" />
            </svg>
            <span class="count__num" data-num>3</span>
          </span>
          <span class="count__words">
            <span class="count__word" data-word-left>suggestions</span>
            <span class="count__word count__word--clear" data-word-clear>All clear</span>
          </span>
        </span>
      </header>

      <p class="doc__kicker">Draft &middot; Beta launch note</p>
      <h1 class="doc__title">Your new build is on its way</h1>

      <div class="doc__body" data-body>
        <p class="text">Thanks for joining the beta. You will
          <span class="flag flag--spell" data-flag="0" data-fix="receive" data-kind="Spelling" data-why="Did you mean">recieve</span>
          the new build on Friday, and it
          <span class="flag flag--spell" data-flag="1" data-fix="definitely" data-kind="Spelling" data-why="Did you mean">definately</span>
          fixes the sync bug. Your notes are
          <span class="flag flag--style" data-flag="2" data-fix="invaluable" data-kind="Clarity" data-why="Say it in one word">very important</span>
          to us, so reply any time.<span class="caret" data-caret aria-hidden="true"></span></p>
      </div>

      <footer class="doc__foot">
        <span class="meter">
          <span class="meter__label">Clarity</span>
          <span class="meter__bar"><span class="meter__fill" data-fill></span></span>
          <span class="meter__val" data-score>68</span>
        </span>
        <span class="doc__words">31 words</span>
      </footer>

      <!-- the glass card with the fix, placed over the flagged word -->
      <div class="pop" data-pop role="dialog" aria-label="Suggestion" aria-hidden="true">
        <span class="pop__kind" data-pop-kind>Spelling</span>
        <span class="pop__why" data-pop-why>Did you mean</span>
        <div class="pop__row">
          <button class="pop__fix" type="button" data-pop-fix>
            <span class="pop__fixword" data-pop-word>receive</span>
            <svg class="pop__enter" viewBox="0 0 16 16" aria-hidden="true"><path d="M12.5 4v4.5h-8M7 6l-2.6 2.5L7 11" /></svg>
          </button>
          <button class="pop__ignore" type="button" data-pop-ignore>Ignore</button>
        </div>
      </div>
    </section>

    <svg class="pointer" data-pointer viewBox="0 0 20 20" aria-hidden="true">
      <path d="M4 2.6l11.6 9.1-5.3.6-2.6 4.9z" />
    </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.

37 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 “Spellchecker fix” 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 ivory paper with the faintest grain sits the white editor card, with 22 pixel corners, a one pixel edge and a four layer shadow. At the top the Penhold brand (a nib drawn in lines) and a pill with the number of suggestions in a coral circle; below, the draft «Your new build is on its way» in a book serif, with the caret blinking at the end. After the entrance a wavy line draws itself from the left under recieve, definately and very important: coral for spelling, violet for clarity. On tap the word takes a soft background and a frosted glass card rises above it (or below, if there is no room) on a small spring: the kind of suggestion, a line of explanation, the right word on a dark button and Ignore. Pick the fix and the line pulls back to the right while the word transforms: the letters the two words share slide to their new position on a small arc, the ones not needed fall with a slight turn and fade, the new ones rise from below with a bounce; meanwhile the word's width changes smoothly and the rest of the line follows. The word stays green and goes back to ink in just over a second. The number in the pill rolls away upwards and the new one rises; at the last one the circle turns green, the check draws itself, the label becomes All clear, the pill gives a small bump and a sheen crosses the card. At the foot the Clarity meter fills from 68 to 97 with the number counting, and the word count drops from 31 to 30 when very important becomes invaluable. Left alone, a drawn pointer fixes the three words by itself, then the draft goes back as it was, with the letters shuffling backwards, and starts again.

How it works

One letter, one span

Each flagged word is an inline-block with white-space: pre, and its letters are inline-block spans. The space of very important is a letter like the others: the phrase never wraps in the middle.

Pairing letters

pairUp() pairs every letter of the new word with the nearest still free matching letter of the old one, by position, regardless of order: so in recieve the i and the e cross instead of vanishing and coming back. Old letters with no pair fall, new letters with no pair rise.

FLIP for letters

Measure the x of the old letters, write the new word, measure the new x; each paired letter starts offset by the difference and goes back to zero with back.out, with an arc in keyframes (up with sine.out, down with bounce.out) as high as ARC for its distance. The falling letters are absolutely positioned copies at the old x, removed at the end.

The width follows

The word goes from its old width to the new one with power3.inOut and clearProps at the end: the rest of the line slides instead of jumping.

The wavy line

An 8 by 5 pixel SVG repeated horizontally as a background-image: it draws by taking background-size from 0% to 100% with the position on the left, and pulls back by moving the position to the right and taking the size to zero. It follows the word even when the line wraps, with no maths.

The card and the pilot

The glass card is measured each time above the word, moves below if it would leave the card and stays inside the edges; transformOrigin sits on the word. The pilot is a chain of Promises on gsap.delayedCall that stops as soon as a real pointer arrives (event.isTrusted) and starts again from the draft after seven quiet seconds.

Values to change

NameFileDefaultWhat it changes
MORPHscript.js0.62Seconds for the shared letters to slide to their new place.
STAGGERscript.js0.03Seconds between one letter and the next.
ARCscript.js0.24How high a sliding letter hops, relative to the text size.
DROPscript.js0.55How far the letters not needed fall, relative to the text size.
POP_SPRINGscript.js1.6How much the glass card overshoots when it rises.
HOLDscript.js2.6Seconds All clear stays before the pilot starts again.
LOOPscript.jstrueLeft alone, it fixes the words by itself and starts again.

Try them in the Playground

When to use it

For a text editor, a notes or writing app, a CMS, an app's comment field, or the page of an AI writing assistant: wherever a correction is suggested and you want to show what changes in the word, instead of swapping it at once.

On phones

The same animation with adapted sizes: the card takes almost the whole width, title and text scale with the screen's height, the kicker and the word count hide under 420 pixels. The glass card stays inside the edges and goes below the word if there is no room above. You tap the word with your finger.

With reduced motion

No sliding, falling or hopping letters and no pointer: the glass card and the new word arrive as a fade, the wavy lines are already there, the count and the meter change without animation.

Pitfalls

  • Pairing letters while keeping their order (like the classic diff of two strings) makes swapped letters vanish and come back: to see them cross, take the nearest matching letter even if it comes later.
  • If the word changes width at once, the whole line jumps: animate the width and remove it with clearProps.
  • The falling letters go into absolute copies inside the word (which must be position: relative), otherwise they take room in the new word.
  • A space inside a flagged phrase in a normal inline-block wraps: it needs white-space: pre.
  • The pilot must not count as a user: the check is on event.isTrusted.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Newsreader (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 9.9 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