Skip to content
animorio
IT
Back to the library

Curling badge label

Hover, SVGGSAPMediumCompressed weight: Demo 6.2 KBGSAP 28 KBFreeDownload the zip

A minimal hover animation: one line of capitals with a thin rule under it, like a label. With the pointer over it the line curls without changing its length: its two ends bend down and round until they meet and the words become a ring, the rule a closed circle, a hair past closed and back. As it closes it becomes a badge, the rule gives a knock and a thin arrow in the one accent colour draws itself in the middle; then the ring turns slowly. Pressing it gives it a push; when the pointer leaves it unwinds back into a straight line.

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>
<!--
  "Curling badge label" 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 label that curls into a circle</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="scena" data-stage>
    <!-- the script sizes the SVG to the window and bends the line, the text on it and the rule under it every frame -->
    <svg class="palco" data-svg xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Now booking spring 2027">
      <defs>
        <path id="filo" data-path />
      </defs>
      <g data-place>
        <g data-turn>
          <!-- the thin rule under the words: a straight line, then a closed ring -->
          <path class="riga" data-rule />
          <!-- the words, set on the bending line -->
          <text class="scritta" data-text><textPath href="#filo" data-tp></textPath></text>
        </g>
        <!-- the arrow that draws itself in the middle of the ring, the one accent -->
        <g data-arrow-place>
          <path class="freccia" data-arrow pathLength="1" />
        </g>
      </g>
      <!-- an invisible text used to measure the words -->
      <text class="scritta misura" data-measure></text>
    </svg>
    <p class="nota" data-note>Hover the line, press the ring</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.

12 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 “Curling badge label” 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 empty warm white a thin grey rule draws itself from the middle out to both sides and a line of wide-spaced capitals rises onto it and settles: Now booking spring 2027. It is a label, nothing more. When the pointer passes over it, the line curls: its two ends bend down and round, tighter and tighter, without the line changing its length; the words follow the curve with their heads outwards and the rule stays under them, towards the centre. As it closes it rises and grows, until the two ends meet at the bottom, go a hair past and come back: the words have become a ring, the rule a closed circle. In that instant the rule gives a small knock, getting thicker and thin again, and in the middle a thin blue arrow draws itself from tail to tip, arriving a little small, passing its size by a touch and settling. While the pointer stays, the ring turns slowly clockwise. Pressing it squeezes the ring a little and gives it a push: it spins fast and slows down by itself to its own pace; with the pointer on the arrow, the arrow leans out two pixels up and to the right. When the pointer leaves, the arrow erases itself, the ring unwinds its turns the short way round and at the same time opens, comes down and becomes a straight line with the rule under it again. If nobody touches it, an invisible pointer curls it, presses the ring once and lets it go, and starts again. On a phone a tap curls it and another tap unrolls it.

How it works

An arc of the same length

The line is an arc of fixed length L: with the curl c from 0 to 1 the angle is 2π·c and the radius is L over the angle. Every point is R·sin(u/R) and 2R·sin²(u/2R): so even when the radius is huge (the line almost straight) the maths keeps its precision.

Words on the path

The words sit in a textPath on that path, rebuilt every frame from 180 segments; startOffset leaves half of the closing gap at the start, so the other half stays at the end and the two ends meet in empty space. The rule is the same arc with a slightly shorter radius.

The centre that rises

The middle of the line rises as it curls, from under the words to one final radius above the centre: the closed ring ends up exactly where the line was. At the same time it grows to about half of the shorter side of the box.

A spring and a hair past

The curl chases its target on a spring damped at 0.74: it goes a few degrees past closed, inside the gap between the two ends, and comes back. Once it is closed and nearly still the rule knocks and the arrow draws itself, with stroke-dashoffset on a single stroke.

Spin and unwind

Closed, the ring turns at a steady speed; a press adds 300 degrees per second that die away by themselves. On the way back the angle is brought between minus 180 and 180 and a spring takes it to zero while the ring opens, so it unwinds the short way round.

Values to change

NameFileDefaultWhat it changes
TEXTscript.jsNow booking spring 2027The words on the line: short is better, they have to make a ring.
SPINscript.js22How fast the closed ring turns, in degrees per second (0 = it stays still).
PUSHscript.js1How hard a press spins the ring (0 = nothing).
GROWscript.js1How much the ring grows as it closes: 1 = into a badge, 0 = it keeps the size of the line.
SPRINGscript.js1How stiff the spring is: 2 = quick and tight, 0.5 = slow and soft.
GAPscript.js1.2The space where the two ends of the words meet, in letters.

Try them in the Playground

When to use it

For the badge of a portfolio or a studio saying it is open for new work, an invitation to book or to get in touch, the corner of a landing page: wherever a line of text should stay quiet until someone looks at it.

On phones

The same animation with adapted sizes: the line is as wide as the box and the ring grows to half of its shorter side. A tap curls it, a tap in the middle of the ring pushes it, a tap away from the middle unrolls it.

With reduced motion

Nothing bends or turns: the line fades in; on hover it becomes the still ring at once, with the arrow fading in, and on leaving it is a line again at once.

Pitfalls

  • With vector-effect non-scaling-stroke Chrome measures the dashes on screen, while pathLength measures them in the drawing: with the ring scaled up the arrow drew only halfway. The arrow gets a width divided by the scale instead, without non-scaling-stroke.
  • Dashing starts again on every separate piece of a path: the arrow in three pieces showed its head before its shaft. Now it is a single stroke that goes back over the tip.
  • With the radius as L over the angle, a nearly straight line has a huge radius and 1 minus the cosine loses every digit: 2·sin² of the half angle is used instead.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

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

Testing

Tested on 31 October 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