
The slide-to-confirm button
Buttons, Physics, Transitions
The card that closes a lesson in Parlowe, an invented language learning app, like a Dribbble shot: «How clear was this lesson?» on a 1 to 10 slider. The thumb is dragged on a spring, the big number rolls on a drum, the track takes its colour from a measured gradient going from coral to amber to green and the light at the top of the card takes the same colour. Below, the follow-up question changes with the score: under 6 «What was confusing?», over 8 «What did you like most?», in between «What would make it a 10?», each with its own pills, and it passes from one to the next with a fade and a slide from the side the score is going. Send feedback gives under the finger and the card becomes a thank-you with a check that draws itself.
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>
<!--
"Lesson rating slider" 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 lesson rating with the slider that changes the question</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 end of a lesson in Parlowe, an invented language app: a 1 to 10 slider asks how clear the lesson was. The
number rolls on a drum, the track takes its colour from a measured gradient and the follow-up question below
changes with the score: what was confusing, what would make it a 10, what you liked most -->
<section class="rate" data-rate aria-labelledby="rate-title">
<div class="rate__body" data-body>
<header class="rate__head" data-rise>
<span class="rate__app" aria-hidden="true">
<svg viewBox="0 0 20 20"><path d="M4.5 4.5h11a2 2 0 0 1 2 2v5.2a2 2 0 0 1-2 2H9.6L6 16.6v-2.9H4.5a2 2 0 0 1-2-2V6.5a2 2 0 0 1 2-2z"/><path class="rate__app-wave" d="M6.6 9.2c.9-1.3 1.8-1.3 2.7 0s1.8 1.3 2.7 0 1.8-1.3 2.7 0"/></svg>
</span>
<span class="rate__meta">
<span class="rate__course">Spanish · Lesson 12</span>
<span class="rate__lesson">At the café</span>
</span>
<span class="rate__xp" data-xp>+40 XP</span>
</header>
<h1 class="rate__title" id="rate-title" data-rise>How clear was this lesson?</h1>
<div class="rate__score" data-rise>
<span class="rate__drum" aria-hidden="true">
<span class="rate__col" data-col>
<span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span>
</span>
</span>
<span class="rate__of" aria-hidden="true">/ 10</span>
<span class="rate__word" data-wordbox aria-hidden="true"><span class="rate__word-in" data-word>Clear enough</span></span>
</div>
<div class="rate__slider" data-slider role="slider" tabindex="0" aria-labelledby="rate-title"
aria-valuemin="1" aria-valuemax="10" aria-valuenow="7" aria-valuetext="7 out of 10" data-rise>
<span class="rate__track" aria-hidden="true">
<span class="rate__fill" data-fill><span class="rate__fill-grad" data-grad></span><span class="rate__shine" data-shine></span></span>
</span>
<span class="rate__ticks" data-ticks aria-hidden="true"></span>
<span class="rate__thumb" data-thumb aria-hidden="true">
<span class="rate__halo" data-halo></span>
<span class="rate__knob" data-knob><span class="rate__grip"></span></span>
</span>
</div>
<div class="rate__ends" aria-hidden="true" data-rise><span>Not at all</span><span>Completely</span></div>
<div class="rate__follow" data-follow data-rise>
</div>
<button class="rate__send" type="button" data-send data-rise>
<span class="rate__send-face" data-sendface>
<span class="rate__send-words">Send feedback</span>
<svg class="rate__send-icon" viewBox="0 0 16 16" aria-hidden="true"><path d="M3 8h9M8.5 4.2L12.3 8 8.5 11.8"/></svg>
</span>
</button>
</div>
<div class="rate__thanks" data-thanks aria-hidden="true">
<span class="rate__seal" data-seal>
<svg viewBox="0 0 48 48" aria-hidden="true">
<circle class="rate__seal-ring" data-ring cx="24" cy="24" r="21" pathLength="1"/>
<path class="rate__seal-check" data-tick pathLength="1" d="M15.5 24.6l5.6 5.6 11.6-12"/>
</svg>
</span>
<p class="rate__thanks-title" data-thx>Thanks, Maya</p>
<p class="rate__thanks-line" data-thxline>Tomorrow’s lesson will adapt to your answer.</p>
<span class="rate__bonus" data-bonus>+5 XP for your feedback</span>
</div>
</section>
<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>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.
41 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 “Lesson rating slider” from Animorio and fit it into my siteThe score is a continuous number v from 1 to 10 pulled towards its target by a damped spring written by hand (STIFFNESS, DAMPING), integrated in GSAP's ticker in two half steps with the step capped at 1/30 of a second, and still once it has settled. While dragging the target follows the finger continuously; on release it snaps to the nearest whole score. The thumb stretches sideways with its speed (SQUASH) and swells by 12% while held, with the change damped every frame.
The fill is a window with overflow: hidden; inside it the gradient is as wide as the whole track (measured on resize), so the colour under the thumb is always the colour of the score and never squeezes as the fill grows. The script reads the same three colours from :root and blends them with gsap.utils.interpolate: the result goes into the --tint variable, which colours the thumb's ring and core, the word, the ticks already passed, the wave in the icon and the light at the top of the card.
The number is a column from 1 to 10 inside a window one line tall with a soft mask above and below: it changes by sliding in yPercent with a back.out. The word leaves blurred on one side and comes in from the other following the direction of the score, with a timeline killed at every change, so a fast drag never piles up; the tick reached jumps with an elastic and reaching 10 a glint runs along the track.
Three bands (under LOW_BELOW, over HIGH_ABOVE, in between) with their own question and pills. When the band changes the new question is built next to the old one: the old one leaves by 14 pixels, blurred, towards the side the score is moving away from, the new one comes from the other side with its pills staggered on a back.out. The space below is two rows of pills tall, so the card never jumps. The picks of each band stay in a Set and going back they are found switched on.
Each pill is a button with aria-pressed: it squashes and comes back on an elastic, Mona Sans' wdth axis widens the word and an SVG check opens in width and draws itself with pathLength=1. Send feedback gives, the lines rise away blurred and the thank-you arrives with its circle and check drawn and a line chosen after the first pill switched on. A pilot made of a GSAP timeline moves the same pieces as the hand; it stops at the first touch and starts again after nine quiet seconds.
| Name | File | Default | What it changes |
|---|---|---|---|
STIFFNESS | script.js | 260 | The spring that pulls the thumb to the finger: higher is quicker. |
DAMPING | script.js | 23 | Lower lets the thumb pass the mark and come back. |
LOW_BELOW | script.js | 6 | Under this score the question asks what was confusing. |
HIGH_ABOVE | script.js | 8 | Over this score the question asks what you liked most. |
START | script.js | 7 | The score the slider starts on. |
SQUASH | script.js | 1 | How much the thumb stretches with its speed (0 never). |
HOLD | script.js | 2.6 | Seconds the thank-you stays before the card comes back. |
SPEED | script.js | 1 | 2 = the pilot twice as fast, 0.5 = half. |
LOOP | script.js | true | The pilot plays the story again and again. |
At the end of a lesson in a language learning app, an online course, a webinar or a tutorial: it asks for a score with one gesture and then just one question that fits that score, instead of a long form that is the same for everyone. It also works for feedback after an order, a delivery, a support call or a new tool in a dashboard, and as a 1 to 10 NPS with its follow-up question.
The same animation with adapted sizes: the card is 92% of the screen wide, the title, the number and the spacing are sized on the height too, so everything fits the phone's box. A finger drags like the mouse without scrolling the page (touch-action: none on the track) and a tap on the track takes the thumb there.
Nothing moves: the thumb goes straight to the score with no spring, the number changes in place with a fade, the word and the follow-up question swap with a fade, the checks appear already drawn and the thank-you fades in with its circle and check already in place.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 11 KB; the libraries: GSAP 28 KB.
Tested on 7 November 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.