Skip to content
animorio
IT
Back to the library

Karaoke lyrics

TextGSAP, CSS onlyMediumCompressed weight: Demo 4.1 KBGSAP 28 KBFreeDownload the zip

A karaoke screen made of type alone: the line to sing fills with light word by word in time with the song, each word gains weight while it is sung, the next line waits below and rises when its turn comes, with the count of the beats at the top.

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>
<!--
  "Karaoke lyrics" 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>Karaoke lyrics with the words that fill in time and the next line that rises</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">
    <!-- a karaoke screen: the line being sung fills word by word in time with the song, the next one waits below
         and rises when its turn comes; the thin bar at the bottom is the song -->
    <section class="kr" data-kr aria-label="Karaoke lyrics">
      <header class="kr__head">
        <p class="kr__song">Paper Lanterns<i>The Low Tides</i></p>
        <p class="kr__next"><span data-count></span></p>
      </header>
      <div class="kr__lines" data-lines aria-live="off"></div>
      <footer class="kr__foot">
        <span class="kr__time" data-now>0:00</span>
        <span class="kr__bar"><i data-bar></i></span>
        <span class="kr__time" data-total></span>
      </footer>
    </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.

13 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 “Karaoke lyrics” 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, at the top the song’s title and on the right a small count in yellow; in the middle three large thin lines of text, fading above and below; at the bottom the time and a thin bar. Before each line the count goes “2”, “1”, “Sing”. Then the line fills with light from the left, word by word, each in the time of its syllables: the word being sung gives a small hop, gains weight on the variable axis, a yellow line runs under it, and as soon as it is done it turns light again and stays lit. At the end of the line the whole text rises by one row with a soft move and it is the next one’s turn. At the end the count says “Applause” and the song starts again.

How it works

The song is a timeline

Each word has its number of syllables; from BPM comes the length of a syllable (half a beat) and the words are lined up on a single GSAP timeline, with the count before each line.

The word written twice

Underneath is the dim word, on top the same word bright, cut with clip-path: the cut’s percentage is a CSS variable animated linearly, like the karaoke ball.

Weight while singing

The weight lives in font-variation-settings on a variable: it climbs to HEAVY in a tenth of a second at the word’s attack and returns to 300 at the end, without moving the words beside it.

Values to change

NameFileDefaultWhat it changes
BPMscript.js96The song’s tempo: each syllable lasts half a beat.
ACCENTscript.js#ffd166The colour of the line under the sung word and of the bar.
HEAVYscript.js620The weight the word takes while it is sung (300 at rest).
LEADscript.js2How many beats of waiting before each line, with the count-in.
LOOPscript.jstrueWhen the song ends it starts again.

Try them in the Playground

When to use it

On the site of a karaoke night, a venue, a party or a music app: as the opening of the event page or as the synced lyrics screen of a player.

On phones

The same screen: the type scales with the window’s width and height and a line wider than the screen is scaled down just enough to fit.

With reduced motion

The words light up whole at their moment, without filling, hopping or gaining weight; the lines change at once.

Pitfalls

  • The lyrics are ours and the timing is worked out from the syllables: a real song needs each word’s real timing (and the rights to the lyrics).
  • The animated weight would widen the word and push its neighbours: that is why the lit word sits on top, absolutely placed, and the line is measured by the dim one.
  • aria-live is off: a screen reader must not read each word in time; the whole text is in the document.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

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