Skip to content
animorio
IT
Back to the library

Muted words

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

The muted words of a social app, on black: three words to switch on and three comments below. Switching a word on, in every comment containing it a bar sweeps across from the left and covers it, the letters vanish underneath and the count at the top rolls. Hovering a bar gives a peek at the word; switching it off sends the bar away to the right and the text comes back.

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>
<!--
  "Muted words" 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>Muted words</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">
    <!-- the muted words of a social app: switching a word on covers it in every comment with a bar
         sweeping across it, and the count of what is hidden rolls -->
    <section class="mw" data-mw aria-label="Muted words">
      <header class="mw__head"><strong>Muted words</strong><span class="mw__sum"><span data-outsum>Nothing hidden</span></span></header>
      <div class="mw__chips" role="group" aria-label="Words to mute">
        <button type="button" class="mw__chip" data-mute="spoiler" aria-pressed="false"><span>spoiler</span></button>
        <button type="button" class="mw__chip" data-mute="giveaway" aria-pressed="false"><span>giveaway</span></button>
        <button type="button" class="mw__chip" data-mute="crypto" aria-pressed="false"><span>crypto</span></button>
      </div>
      <ul class="mw__list">
        <li class="mw__row"><span class="mw__face" aria-hidden="true">M</span><p><b>Maya</b>No <span class="mw__w" data-w="spoiler">spoiler</span> please, I’m only on episode two.</p></li>
        <li class="mw__row"><span class="mw__face" aria-hidden="true">L</span><p><b>Leo</b>Huge <span class="mw__w" data-w="giveaway">giveaway</span> on my page, <span class="mw__w" data-w="crypto">crypto</span> prizes!</p></li>
        <li class="mw__row"><span class="mw__face" aria-hidden="true">I</span><p><b>Ines</b>That finale <span class="mw__w" data-w="spoiler">spoiler</span> ruined my whole week.</p></li>
      </ul>
    </section>
    <span class="live" aria-live="polite" data-live></span>

    <svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.200 19.200 11l-6.300 1.600-3.300 5.900Z"></path></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.

32 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 “Muted words” 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 black, a dark rounded card: “Muted words” and on the right “Nothing hidden”. Below, three outlined chips: “spoiler”, “giveaway” and “crypto”. Then three comments, each with the round initial, the name and a line: Maya asks for no spoilers, Leo announces a giveaway with crypto prizes, Ines complains about a spoiler of the finale. Tapping “spoiler” turns the chip amber with the word struck through; in Maya’s comment a grey bar sweeps across the word from the left, slightly overshoots and settles, and a moment later does the same in Ines’s; the letters vanish underneath and at the top the text rolls into “2 words hidden”, in amber. With “crypto” and “giveaway” the bars in Leo’s comment become two and the count climbs to four. Hovering a bar turns it see-through and the word can be read. Tapping “spoiler” again brings the letters back and the bars leave to the right.

How it works

The words are marked

In the comments every word that can be muted sits in its own element, saying which word it is. The script puts the letters inside it and a bar on top.

The bar comes in from the left

Switching a word on, the bar of each of its occurrences grows from zero to the full width with its origin on the left and a small overshoot; halfway through, the letters under it fade.

One after the other

The occurrences of the same word start staggered, so the eye follows them down the comments.

It leaves on the right

Switching off, the letters come back and the bar retracts with its origin on the right: it seems to carry on its way instead of going back.

Values to change

NameFileDefaultWhat it changes
ACCENTscript.js#f2b84bThe colour of the muted words, on their chip and in the count.
BARscript.js#4a4a52The colour of the bar covering the word in the comments.
SWEEPscript.js0.45How many seconds the bar takes to sweep across the word.
STAGGERscript.js0.14The delay between one covered word and the next, in seconds.
LOOPscript.jstrueLeft alone, the demo’s pointer mutes the three words, peeks at one and starts again.

Try them in the Playground

When to use it

In the privacy settings of a social app, a forum or a group chat, to show at once what the filter does; and in comment moderation tools. The same bar sweeping across a word carries the sensitive data of a document, quiz answers to reveal or prices hidden from people without an account.

On phones

The card is at most 348 pixels wide and from 280 to 335 tall, and narrows with the screen: the comments wrap and the bars follow their words. On a phone a tap on the bar peeks at the word and another covers it again. The chips are 32 pixels tall.

With reduced motion

No sweeping bars: the bar is on the word at once and the letters fade; switching off, the bar disappears and the letters fade back. The demo’s pointer does not start.

Pitfalls

  • A covered word must not be read out all the same by a screen reader: the letters take aria-hidden and in their place is the text “muted word”, hidden from view.
  • Here the word stays in the page under the bar: fine for a filter the reader chose and can peek through. To really hide data the text must not be sent to the browser at all.
  • Every word to cover has to stay on one line: it is an inline block, and the bar is as wide as the word plus three pixels each side.
  • In a real product the words are searched for in the text regardless of capitals and plurals; here they are already marked by hand.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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