
The inchworm menu
Menus, Hover, Transitions
The context window of an AI chat, alone on black in the premium style of product shots: a bar split into what the model is holding in mind (instructions, files, conversation). Every message that arrives makes the conversation grow on a spring and the token count rolls; near the limit the bar turns amber and Compact lights up. Pressed, a sheen of liquid metal runs across the conversation, the old messages leave and fold into a single silver summary, the bar goes short again and the summary pill appears above the chat with its tick drawing 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>
<!--
"AI chat context meter" 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 AI chat context meter with messages that compact into a summary</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 context window of an AI chat: a bar split into what the model is holding (instructions, files,
conversation); each message makes the conversation grow, near the limit the bar warns, and Compact folds
the old messages into one short summary with a sheen of liquid metal -->
<section class="ctx" data-ctx aria-label="Context window">
<header class="ctx__top">
<span class="brand">
<svg viewBox="0 0 20 20" aria-hidden="true"><path d="M10 2.5 12 8l5.5 2-5.5 2-2 5.5L8 12l-5.5-2L8 8Z"/></svg>
<span>Vellum</span>
</span>
<span class="thread">Q4 launch plan</span>
<span class="model">Vellum 3 · 128k</span>
</header>
<div class="feed" data-feed aria-live="polite">
<div class="summary" data-summary aria-hidden="true">
<svg class="summary__ic" viewBox="0 0 16 16"><path data-sumtick d="M4 8.4 6.8 11 12 5.4"/></svg>
<span>Summary of <b data-sumcount>24</b> earlier messages</span>
</div>
<div class="msgs" data-msgs></div>
</div>
<div class="meter">
<div class="meter__row">
<span class="meter__label">Context</span>
<span class="meter__val"><b data-used>33.5k</b> <span class="of">/ 128k tokens</span></span>
</div>
<div class="bar" data-bar>
<span class="seg seg--sys" data-seg="sys"><i></i></span>
<span class="seg seg--files" data-seg="files"><i></i></span>
<span class="seg seg--sum" data-seg="sum"><i></i></span>
<span class="seg seg--chat" data-seg="chat"><i></i><span class="sheen" data-sheen></span></span>
<span class="bar__mark" aria-hidden="true"></span>
<div class="tip" data-tip role="tooltip"><b data-tipname>Conversation</b><span data-tipval>18k</span></div>
</div>
<div class="keys" aria-hidden="true">
<span><i class="k k--sys"></i>Instructions</span>
<span><i class="k k--files"></i>Files</span>
<span><i class="k k--chat"></i>Conversation</span>
</div>
</div>
<footer class="foot">
<p class="hint" data-hint><span data-hinttext>Plenty of room</span></p>
<button class="compact" type="button" data-compact disabled>
<span class="compact__in">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3 5h10M5 8h6M7 11h2"/></svg>
<span>Compact</span>
</span>
</button>
</footer>
</section>
<svg class="pointer" data-pointer viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.5 18.5 12l-6 1.4L9.6 19.4Z"/></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.
36 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 “AI chat context meter” from Animorio and fit it into my siteEach piece is as wide as its tokens over the limit (k / LIMIT x 100%), animated by GSAP with a back.out: the bar grows on a spring and stays right at any window width.
An object with a number goes to the new total and at each step writes the text rounded to one decimal: no tabular figures, so with Mona Sans the zero stays clean.
A timeline sends the light across the conversation, then removes the old messages, brings the conversation close to zero and grows the silver summary piece; the pill’s tick draws itself with stroke-dashoffset.
| Name | File | Default | What it changes |
|---|---|---|---|
LIMIT | script.js | 128 | The model’s context window, in thousands of tokens. |
WARN_AT | script.js | 0.8 | Where on the bar the warning starts and Compact lights up. |
SUMMARY_SIZE | script.js | 4.2 | How many thousand tokens the summary keeps. |
STEP_TIME | script.js | 0.95 | Seconds between messages when the pilot plays on its own. |
SPRING | script.js | 1.4 | How much the bar bounces when it grows. |
SHEEN_TIME | script.js | 0.9 | Seconds of the light running across the conversation. |
HOLD | script.js | 3.2 | Seconds of pause on the result before the loop starts again. |
In an AI chat app, a writing or coding assistant, an agent’s panel: anywhere you need to show how much room the model has left and what happens when the conversation is summarized.
The panel narrows to 92% of the width, the type follows the window with clamp and the chat height also depends on the screen height; the tooltip stays inside the bar.
No springs or movement: the bar changes at once, messages and summary fade in, the light does not run and the tick is already drawn.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 6.4 KB; the libraries: GSAP 28 KB.
Tested on 14 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.