
The elastic button
Buttons, Hover, Text
The card of an online course, on the lightest grey: the lesson in progress has a thin bar inside its row and a Mark as complete button; pressed, the check draws itself in the circle, the row dims, the course percentage rolls, the ring at the top fills and the next lesson opens up. After the last one, the certificate rises at the bottom with «Course completed».
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>
<!--
"Online course card" 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 online course card with lessons that complete</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" data-stage>
<!-- the card of an online course: the lesson in progress has a thin bar inside its row and a Mark as complete
button; completing it draws the check, dims the row, rolls the course percentage, fills the ring and opens
the next lesson. After the last one the certificate rises -->
<article class="course" data-card aria-label="Motion design for interfaces, online course">
<header class="course__head">
<div class="course__text">
<p class="course__brand">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M2 5.2 8 2.4l6 2.8-6 2.8Z"/><path d="M4.6 6.6v3.2c0 1 1.6 1.9 3.4 1.9s3.4-.9 3.4-1.9V6.6"/></svg>
<span>Lessonary</span>
</p>
<h1 class="course__title" data-title>Motion design for interfaces</h1>
<p class="course__meta"><span class="roll" data-left><span class="roll__in">37</span></span> min left</p>
</div>
<div class="ring" aria-hidden="true">
<svg viewBox="0 0 48 48">
<circle class="ring__track" cx="24" cy="24" r="20"/>
<circle class="ring__fill" data-ring cx="24" cy="24" r="20"/>
</svg>
<span class="ring__num"><span class="roll" data-pct><span class="roll__in">40</span></span><span class="ring__pc">%</span></span>
</div>
</header>
<ol class="lessons" data-list aria-label="Lessons"></ol>
<footer class="course__foot" data-foot>
<div class="foot__a" data-foot-a>
<span class="foot__label">Next up</span>
<span class="foot__next" data-next>Springs you can feel</span>
</div>
<div class="foot__b" data-foot-b aria-live="polite">
<span class="cert" data-cert aria-hidden="true">
<svg viewBox="0 0 64 44">
<rect x="1" y="1" width="62" height="42" rx="4" class="cert__paper"/>
<rect x="5" y="5" width="54" height="34" rx="2" class="cert__frame"/>
<path d="M14 14h28M14 19h20M14 24h24" class="cert__lines"/>
<path d="M47 24l-3 12 4-2 2 3 2-12" class="cert__ribbon"/>
<path d="M49 17.5l2.2 1.3 2.5-.4.6 2.4 2 1.6-1.1 2.3.4 2.5-2.4.7-1.5 2-2.3-1.1-2.5.4-.7-2.4-2-1.6 1.1-2.3-.4-2.5 2.4-.6Z" class="cert__seal"/>
</svg>
</span>
<span class="foot__done">
<span class="foot__title">Course completed</span>
<span class="foot__sub">Your certificate is ready</span>
</span>
<button class="foot__btn" type="button" data-cert-btn>View</button>
</div>
</footer>
</article>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.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>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.
25 values to change
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 “Online course card” from Animorio and fit it into my siteEach lesson has a title and a length in minutes; its state (done, in progress, to do) decides the circle: a grey ring, an indigo triangle or a green disc with the check. The percentage and the minutes left are computed from the lessons done.
The part under the lesson in progress (bar, minutes watched, button) starts at zero height and GSAP takes it to auto with power3.out; its content drops six pixels and lights up. When it closes, the content fades first and then the height goes back to zero, so nothing gets squashed.
The check is a stroke with a strokeDasharray that draws itself after the disc has grown with back.out; the course ring is a circle whose strokeDashoffset equals the circumference for the missing part, and it eases down with power3.inOut for every lesson done.
Percentage and minutes sit in a window with a faded mask: the old value becomes a copy that leaves, the new one enters from the opposite side with back.out, upwards if it grows, downwards if it shrinks.
After the last lesson, Next up leaves upwards and in its place the certificate rises from forty pixels lower, turned fourteen degrees, and lands at minus four with back.out(1.7), then sways gently once; the text and the View button arrive staggered.
| Name | File | Default | What it changes |
|---|---|---|---|
COURSE | script.js | Motion design for interfaces | The course title. |
ACCENT | script.js | #4f46e5 | The colour of the ring, of the lesson in progress and of the bar. |
DONE | script.js | #16a34a | The colour of the disc with the check of the lessons done. |
WATCH | script.js | 2.2 | The seconds the pointer watches the lesson while the bar reaches the end. |
ROLL | script.js | 0.42 | The seconds a number takes to roll to its new value. |
PAUSE | script.js | 0.7 | The seconds the drawn pointer waits between one gesture and the next. |
For an online course platform, the members’ area of a school or an academy, a company training app, a course page that shows how far you are.
The card takes the screen’s width and is measured on the height too: the rows, the ring and the footer get shorter with the window’s height, so everything stays inside the box even with the lesson open; under 360 pixels the minutes watched go and the margins tighten. A tap does what a click does.
No rolling, no bounces and no unfolding: the numbers change with a fade, the check, the ring and the open row appear already in place, and the drawn pointer stays hidden.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.5 KB; the libraries: GSAP 28 KB.
Tested on 28 October 2026
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.
Support Animorio
Animorio stays free thanks to the people who support it. If you like, buy us a coffee: it helps us make the next animations.
You asked for
We made it for you: it’s in the library, with the preview, the Playground and the code to copy.
An animation you can’t find, or a site to take apart in the journal: tell us which. We pick the next ones from here.
With your account’s email and password.
or with your email
You’re signed in as .
With your account, you can download the zip of every animation and every pack, for free.