
The colour columns
Hover, SVG
A glucose sensor’s day: the curve draws itself inside the target band and the large value follows its tip; outside the band the line and the number turn warm and the word rolls to “High” or “Low”. The point can be taken back along the day and the arrow leans with the trend.
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>
<!--
"Glucose curve" 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>Glucose curve</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 glucose sensor's day: the curve draws itself through the target band, the reading follows its tip,
and the point can be dragged back along the day; the arrow leans with the trend -->
<section class="gl" data-gl aria-label="Glucose today">
<header class="gl__head">
<p class="gl__read">
<b class="gl__num" data-num>0</b>
<span class="gl__unit" data-unit></span>
<svg class="gl__arrow" viewBox="0 0 28 28" aria-hidden="true"><g transform="translate(14 14)"><g data-arrow><path d="M-7.500 0H7.500M2.500-5 7.500 0 2.500 5"></path></g></g></svg>
</p>
<p class="gl__state"><span class="gl__word"><span data-word>In range</span></span><span class="gl__time" data-time></span></p>
</header>
<div class="gl__chart" data-chart role="slider" tabindex="0" aria-label="Time of day" aria-valuemin="0" aria-valuemax="100" aria-valuenow="100">
<svg viewBox="0 0 300 132" preserveAspectRatio="none" aria-hidden="true">
<defs>
<clipPath id="gl-seen"><rect data-seen x="0" y="-10" width="0" height="152"></rect></clipPath>
<clipPath id="gl-in"><rect data-clip-in x="0" y="0" width="300" height="0"></rect></clipPath>
<clipPath id="gl-out"><rect data-clip-high x="0" y="-10" width="300" height="0"></rect><rect data-clip-low x="0" y="0" width="300" height="0"></rect></clipPath>
</defs>
<rect class="gl__band" data-band x="0" y="0" width="300" height="0" rx="3"></rect>
<line class="gl__edge" data-edge-high x1="0" x2="300"></line>
<line class="gl__edge" data-edge-low x1="0" x2="300"></line>
<g clip-path="url(#gl-seen)">
<path class="gl__line gl__line--in" data-line clip-path="url(#gl-in)"></path>
<path class="gl__line gl__line--out" data-line clip-path="url(#gl-out)"></path>
</g>
<line class="gl__rule" data-rule y1="0" y2="132"></line>
</svg>
<i class="gl__dot" data-dot></i>
<span class="gl__lim gl__lim--high" data-lim-high></span>
<span class="gl__lim gl__lim--low" data-lim-low></span>
</div>
<div class="gl__hours" data-hours aria-hidden="true"></div>
<p class="gl__tir"><span>Time in range</span><b><span data-tir>0</span>%</b></p>
<div class="gl__share" aria-hidden="true"><i data-s-low></i><i data-s-in></i><i data-s-high></i></div>
</section>
<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"></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.
16 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 “Glucose curve” from Animorio and fit it into my siteThe half-hourly readings go through a Catmull-Rom curve sampled 240 times: the same samples draw the path and give the value under the point, so number and line never disagree.
The same path is drawn twice: one copy clipped by the band, teal, and one clipped by what is above and below it, orange. A third clip, as wide as the time elapsed, reveals the curve.
The slope is the difference between the values a quarter of an hour before and after. It becomes an angle written into the arrow’s transform attribute, reached with back.out: it settles instead of snapping.
| Name | File | Default | What it changes |
|---|---|---|---|
ACCENT | script.js | #0f9d8a | The colour of the target band. |
LOW | script.js | 70 | Below this value glucose is low. |
HIGH | script.js | 180 | Above this value glucose is high. |
UNIT | script.js | mg/dL | The unit of measure. |
DRAW | script.js | 2.6 | How many seconds the curve takes to draw. |
LOOP | script.js | true | Left alone, a pointer takes the point back to the peak and the dip. |
On the page of a diabetes app or a glucose sensor, on the site of whoever sells them, in a health app; and wherever a value is read inside a target band: a cold room’s temperature, a greenhouse’s humidity, a server’s load.
The same scene: the point is dragged with a finger along the chart, without scrolling the page. Number and chart are also sized on the window’s height.
The curve is already drawn and the point is on now. The point moves without gliding and the words change without rolling.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.0 KB; the libraries: GSAP 28 KB.
Tested on 18 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.