Skip to content
animorio
IT
Back to the library

Pronunciation popover

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

A page of Larder, a made-up food magazine, on warm paper: a story from Marseille with three French words wearing a dotted underline and a small speaker. On hover the word takes a rust tint from the middle, the rest of the page goes quiet and a paper card springs out of the word with the pronunciation: the word in italic gaining weight, the syllables with the stressed one in rust under a small tick, the voice's waveform, the play button and the speed switch. Press play and the light runs along the wave, each syllable lifts and underlines itself as it is said, and the word in the text fills its underline; at 0.5× the syllables spread apart and the length rolls from 0:01 to 0:02.

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>
<!--
  "Pronunciation popover" 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 food magazine article with the pronunciation that opens from the word</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="https://cdn.jsdelivr.net/npm/@fontsource-variable/newsreader@5.3.0/opsz-italic.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <main class="stage">
    <!-- one page of a food magazine on warm paper. Three French words in the story wear a dotted underline and a
         small speaker: hover one and a paper card opens out of it with the word, its syllables (the stressed one in
         rust), a waveform, a play button and a speed switch. Play it and the light runs along the wave, each
         syllable lifts as it is said and the word in the text fills its underline; at half speed the syllables
         spread apart -->
    <div class="fit" data-fit>
      <div class="sheet-wrap" data-wrap>
        <span class="sheet__under" aria-hidden="true"></span>
        <article class="sheet" data-sheet aria-label="Larder, Field notes from Marseille">
          <span class="sheet__sheen" data-sheen aria-hidden="true"></span>
          <header class="mast">
            <span class="mast__logo">Larder</span>
            <span class="mast__issue">Issue 14 <span class="mast__sep">·</span> Winter</span>
          </header>
          <span class="mast__rule" aria-hidden="true"></span>

          <p class="kicker">Field notes, Marseille</p>
          <h1 class="title">Lunch lasts until the boats come in</h1>
          <p class="byline">
            <span class="byline__face" aria-hidden="true"></span>
            <span class="byline__name">Inès Carbonel</span>
            <span class="byline__sep">·</span>
            <span class="byline__time">6 min read</span>
          </p>

          <div class="body" data-body>
            <p class="para" data-para><span class="drop">A</span>t Chez Lune the <button class="w" type="button" data-word="bouillabaisse"><span class="w__tint"></span><span class="w__txt">bouillabaisse</span><span class="w__line"></span><span class="w__prog"></span><svg class="w__ico" viewBox="0 0 12 12" aria-hidden="true"><path class="w__ico-box" d="M1.6 4.4h1.8L6 2.3v7.4L3.4 7.6H1.6z"/><path class="w__ico-wave" d="M8 4.2c.7.9.7 2.7 0 3.6M9.6 2.9c1.4 1.7 1.4 4.5 0 6.2"/></svg></button> arrives in two acts: first the broth, saffron-dark and thick with <button class="w" type="button" data-word="rascasse"><span class="w__tint"></span><span class="w__txt">rascasse</span><span class="w__line"></span><span class="w__prog"></span><svg class="w__ico" viewBox="0 0 12 12" aria-hidden="true"><path class="w__ico-box" d="M1.6 4.4h1.8L6 2.3v7.4L3.4 7.6H1.6z"/><path class="w__ico-wave" d="M8 4.2c.7.9.7 2.7 0 3.6M9.6 2.9c1.4 1.7 1.4 4.5 0 6.2"/></svg></button>, then the fish itself, laid out whole on a warm plate. Spread the <button class="w" type="button" data-word="rouille"><span class="w__tint"></span><span class="w__txt">rouille</span><span class="w__line"></span><span class="w__prog"></span><svg class="w__ico" viewBox="0 0 12 12" aria-hidden="true"><path class="w__ico-box" d="M1.6 4.4h1.8L6 2.3v7.4L3.4 7.6H1.6z"/><path class="w__ico-wave" d="M8 4.2c.7.9.7 2.7 0 3.6M9.6 2.9c1.4 1.7 1.4 4.5 0 6.2"/></svg></button> on the toast, not in the bowl, and nobody will need to tell you twice.</p>
            <p class="para para--soft">By three the room is half empty and the owner is mending a net by the door.</p>
          </div>

          <footer class="foot">
            <svg class="foot__ico" viewBox="0 0 12 12" aria-hidden="true"><path d="M1.6 4.4h1.8L6 2.3v7.4L3.4 7.6H1.6z"/><path d="M8 4.2c.7.9.7 2.7 0 3.6"/></svg>
            <span class="foot__hint">Hover a dotted word to hear it</span>
            <span class="foot__heard"><span class="roll" data-heard><span>0</span><span>0</span></span> of 3 heard</span>
          </footer>

          <div class="say" data-say role="dialog" aria-modal="false" aria-label="Pronunciation" hidden>
            <span class="say__shadow" aria-hidden="true"></span>
            <div class="say__face" data-face>
              <span class="say__glint" data-glint aria-hidden="true"></span>
              <div class="say__top" data-row>
                <span class="say__chip">
                  <svg viewBox="0 0 12 12" aria-hidden="true"><path d="M1.6 4.4h1.8L6 2.3v7.4L3.4 7.6H1.6z"/><path d="M8 4.2c.7.9.7 2.7 0 3.6M9.6 2.9c1.4 1.7 1.4 4.5 0 6.2"/></svg>
                  Say it
                </span>
                <span class="say__lang" data-lang>French · Provence</span>
              </div>
              <p class="say__hw" data-row data-hw>bouillabaisse</p>
              <div class="say__syl" data-row data-syl aria-label="Syllables"></div>
              <div class="say__player" data-row>
                <button class="say__play" type="button" data-play aria-label="Play pronunciation">
                  <span class="say__play-face" data-play-face>
                    <svg class="say__ring" viewBox="0 0 40 40" aria-hidden="true">
                      <circle class="say__ring-track" cx="20" cy="20" r="18.5"/>
                      <circle class="say__ring-fill" data-ring cx="20" cy="20" r="18.5" pathLength="1"/>
                    </svg>
                    <svg class="say__icon" viewBox="0 0 16 16" aria-hidden="true">
                      <path class="say__tri" data-tri d="M5.4 3.6v8.8l7-4.4z"/>
                      <path class="say__bars" data-bars d="M5 4v8M11 4v8"/>
                    </svg>
                  </span>
                </button>
                <div class="say__wave" data-wave aria-hidden="true">
                  <span class="wave wave--base" data-wave-base></span>
                  <span class="wave wave--lit" data-wave-lit></span>
                  <span class="say__head" data-head></span>
                </div>
                <div class="speed" data-speed role="group" aria-label="Speed">
                  <span class="speed__thumb" data-thumb aria-hidden="true"></span>
                  <button class="speed__opt is-on" type="button" data-rate="1">1×</button>
                  <button class="speed__opt" type="button" data-rate="0.5">0.5×</button>
                </div>
              </div>
              <div class="say__foot" data-row>
                <p class="say__gloss" data-gloss>The fishermen’s stew of Marseille</p>
                <p class="say__voice"><span data-voice>Margaux, Marseille</span><span class="say__dur roll" data-dur><span>0:01</span><span>0:01</span></span></p>
              </div>
            </div>
            <span class="say__notch" data-notch aria-hidden="true"></span>
          </div>
        </article>
      </div>
    </div>
    <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.

48 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 “Pronunciation popover” 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 sand-coloured table sits a page of Larder, a made-up food magazine, with another page peeking out underneath: Larder in italic and Issue 14 · Winter over a double rule, then Field notes, Marseille in rust, the title Lunch lasts until the boats come in, the author and 6 min read, and the text with its drop cap. Three words, bouillabaisse, rascasse and rouille, are in italic with a dotted underline and a small speaker. Hover one (or let the page do it, in turn) and the word rises a pixel, a rust tint spreads from its middle, the speaker gives a little jolt and the rest of the text fades; a paper card springs out of the word with its notch pointing at it: Say it, the language, the word in italic going from light to full weight, the syllables (boo · yuh · bess) with the stressed one in rust and a small tick above, a row with the round play button, the voice's waveform and the 1× / 0.5× switch, and below the meaning, the voice and the length. A warm glint slides over the card. On play the button gives, the triangle turns into two bars, a rust ring runs round it, the light runs along the wave with a fine playhead and each bar it passes jumps a little; every syllable lifts a few pixels as it is said and underlines itself, the stressed one swells a touch, and the word in the text fills its underline with rust. At 0.5× the white thumb slides, the syllables spread apart and the length rolls to 0:02. In the footer the 0 of 3 heard count goes up. Left alone the page says its three words one after another, the first one slowly too, then starts again.

How it works

One page, scaled

The page is drawn at one size, 400 px wide, and .fit scales it on every resize just enough to fit the window (up to 1.3 times): the words always wrap at the same points. The card lives inside the page and sits above the word or, with no room above, below it, with the notch following the word's centre and acting as the transform-origin of the spring.

The wave in two layers

The wave is two identical rows of bars, a grey one and a rust one on top; the rust one is revealed with clip-path: inset() tied to the --p variable, which GSAP takes from 0% to 100% together with the playhead, the button's ring and the underline of the word in the text, all with the same duration. The heights come from the syllables: one envelope per syllable, taller for the stressed one, with a seeded generator per word.

Syllables in time

Each syllable has its own length; the play timeline lines them up and on each one lifts the syllable, changes weight and colour through the --sw and --sc variables and draws its line, then brings it down with a back.out. At 0.5× the lengths are divided by the speed and GSAP widens --gap and the syllables' wdth axis.

Values to change

NameFileDefaultWhat it changes
SPRINGscript.js1.5How far the card springs past its size as it opens (0 for no overshoot).
DIMscript.js0.45How much the rest of the text fades while the card is open.
SLOWscript.js0.5The slow speed of the switch (0.5 is half).
LIFTscript.js3How many pixels each syllable rises while it is said.
STRESS_WEIGHTscript.js720The weight of the stressed syllable.
BARSscript.js38How many bars the waveform has.
SPEEDscript.js1The speed of the walk on its own: 2 is twice as fast.
--accentstyle.css#b5502eThe rust accent of the wave and the underlines.
--paperstyle.css#fffcf7The paper of the page.

Try them in the Playground

When to use it

For a food, travel or wine blog or magazine, a language learning app or a restaurant menu with foreign dish names: readers hear how a word is said without leaving the page, slowly too.

On phones

The same page, scaled whole to fit the box on the height too: the words wrap at the same points, a tap opens the card and a second tap makes it speak.

With reduced motion

Nothing slides or bounces: the card, the tint and the rows fade in, the syllables do not lift and the bars do not jump; the wave still colours in and the underline still fills.

Pitfalls

  • Opening a word while another was open, the quick close of the first one was killed along with the card's timeline and its tint stayed on: the quick close now has its own timeline and the new card takes over the old one with overwrite: 'auto'.
  • The phonetic alphabet symbols are not in the fonts' Latin subsets: the pronunciation is spelled in plain syllables, with the stress as a mark drawn in SVG.

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 12 KB; the libraries: GSAP 28 KB.

Testing

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