
Speeding marquee
Scroll, Text, Hover
The contrast checker of a design tool: drag the lightness of the text colour and the ratio counts live, the three WCAG marks flip one at a time and the thresholds are drawn on the bar itself. One key swaps text and background, turning the preview over.
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>
<!--
"Contrast checker" 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>Contrast checker</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 contrast checker for a design tool: drag the lightness of the text colour and the ratio counts,
the three WCAG marks flip as their thresholds pass, and the thresholds are drawn on the slider itself -->
<section class="cc" data-cc aria-label="Contrast checker">
<div class="cc__flip">
<div class="cc__preview" data-preview>
<span class="cc__aa" aria-hidden="true">Aa</span>
<span class="cc__lines"><b>Readable at a glance</b><span>Small print needs more contrast than a headline.</span></span>
</div>
</div>
<div class="cc__read">
<span class="cc__ratio"><b data-ratio>1.00</b><i>:1</i></span>
<span class="cc__roll cc__verdict" aria-live="polite"><span data-verdict></span></span>
</div>
<ul class="cc__marks" data-marks>
<li data-mark="3"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="ok" d="M3.500 8.300 6.700 11.300 12.700 4.800"/><path class="no" d="M4.500 4.500l7 7M11.500 4.500l-7 7"/></svg><b>AA large</b><span>3:1</span></li>
<li data-mark="4.5"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="ok" d="M3.500 8.300 6.700 11.300 12.700 4.800"/><path class="no" d="M4.500 4.500l7 7M11.500 4.500l-7 7"/></svg><b>AA</b><span>4.5:1</span></li>
<li data-mark="7"><svg viewBox="0 0 16 16" aria-hidden="true"><path class="ok" d="M3.500 8.300 6.700 11.300 12.700 4.800"/><path class="no" d="M4.500 4.500l7 7M11.500 4.500l-7 7"/></svg><b>AAA</b><span>7:1</span></li>
</ul>
<div class="cc__slider" data-slider role="slider" tabindex="0" aria-label="Lightness of the text colour" aria-valuemin="0" aria-valuemax="100">
<div class="cc__track" data-track><div class="cc__ticks" data-ticks></div></div>
<i class="cc__thumb" data-thumb></i>
</div>
<footer class="cc__foot">
<span class="cc__well"><i data-well-a></i><span>Text<b data-hex-a></b></span></span>
<button class="cc__swap" type="button" data-swap aria-label="Swap text and background">
<svg viewBox="0 0 18 18" aria-hidden="true"><path d="M4 6.500h10l-2.800-2.800M14 11.500H4l2.800 2.800"/></svg>
</button>
<span class="cc__well"><i data-well-b></i><span>Background<b data-hex-b></b></span></span>
</footer>
</section>
<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>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
Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI
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 “Contrast checker” from Animorio and fit it into my siteFrom HSL to sRGB, then relative luminance (each channel linearised and weighted 0.2126, 0.7152, 0.0722) and the ratio of the lighter to the darker, each plus 0.05. Ten lines, no library.
At start the script tries lightness from 0 to 100 in quarter steps and marks where the ratio crosses 3, 4.5 and 7. Whoever drags already knows where to go, without trial and error.
The wanted value changes at once, the shown one chases it on a near-critical spring on GSAP’s ticker: knob, colours, ratio and marks all read the shown one, so even a far click on the bar arrives gliding.
role=slider, arrows, Shift for steps of ten, Home and End, and in aria-valuetext the lightness, the ratio and the verdict in words. The pointer is captured, so you can keep dragging outside the bar.
| Name | File | Default | What it changes |
|---|---|---|---|
HUE | script.js | 232 | The hue of the text colour, in degrees (232 = blue). |
SAT | script.js | 78 | How saturated the text colour is, in percent. |
START | script.js | 62 | The lightness the text colour starts from (0 to 100). |
PAPER | script.js | #ffffff | The other colour: the background, until they are swapped. |
FOLLOW | script.js | 1 | How readily the knob follows the value: 0.4 = lazy, 2 = immediate. |
LOOP | script.js | true | Left alone, the demo’s pointer darkens the text, lightens it and swaps the two colours. |
In a design tool, in the colour panel of a site builder, on a design system page where brand colours are chosen; or in an article explaining accessibility, to let people try it instead of reading about it.
The same tool by finger: the bar does not scroll the page while you drag, the knob is 36 pixels wide and the marks sit on one row. Sizes also look at the window’s height, so preview, numbers and bar fit together.
Knob and colours go straight to the chosen value, marks change without a spring, the verdict without rolling and the swap inverts the colours without turning the preview over. The demo does not move by itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.8 KB; the libraries: GSAP 28 KB.
Tested on 20 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.
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.