
The elastic button
Buttons, Hover, Text
The prompt field of Vela, a made-up AI workspace, in dark glass with a one pixel edge that catches the light and an indigo and cyan glow underneath. While it is empty, five example prompts take turns inside it: the words rise staggered out of a blur, the old line leaves upwards blurring away and a thin ring around the Tab key counts the time. With the pointer over it the suggestion holds; with a click or Tab its words turn white where they are and become the text. Sent, the text shimmers, a beam runs round the edge and the button loads, then the words fly off and a check arrives.
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>
<!--
"Glass prompt field" 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 glass prompt field with suggestions that take turns</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 prompt field of a made-up AI workspace, Vela: dark glass with a one pixel edge that catches the light, a
controlled glow underneath. Five example prompts take turns inside the empty field: the words rise one after
the other, the old line leaves upwards in a blur. Hover holds the line, a click or Tab puts it in the field -->
<div class="wrap" data-wrap>
<span class="glow" data-glow aria-hidden="true"><span class="glow__a"></span><span class="glow__b"></span></span>
<form class="field" data-field autocomplete="off">
<span class="field__glass" aria-hidden="true"></span>
<span class="field__sheen" data-sheen aria-hidden="true"></span>
<span class="field__edge" data-edge aria-hidden="true"></span>
<span class="field__beam" data-beam aria-hidden="true"></span>
<div class="field__area">
<label class="sr" for="prompt">Ask Vela anything</label>
<textarea class="field__input" id="prompt" rows="2" data-input aria-describedby="hint-now"></textarea>
<div class="hint" data-hint>
<button class="hint__btn" type="button" data-hint-btn tabindex="-1">
<span class="hint__line" data-line></span>
<span class="hint__line" data-line></span>
</button>
</div>
<p class="sr" id="hint-now" data-hint-now></p>
</div>
<div class="bar">
<div class="bar__left">
<button class="tool" type="button" aria-label="Attach a file">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.2v9.6M3.2 8h9.6"/></svg>
</button>
<button class="model" type="button" aria-label="Model: Vela 3">
<svg class="model__star" data-star viewBox="0 0 16 16" aria-hidden="true"><path d="M8 1.6c.5 3.3 3.1 5.9 6.4 6.4-3.3.5-5.9 3.1-6.4 6.4-.5-3.3-3.1-5.9-6.4-6.4 3.3-.5 5.9-3.1 6.4-6.4Z"/></svg>
<span data-model>Vela 3</span>
<svg class="model__chev" viewBox="0 0 16 16" aria-hidden="true"><path d="m5 6.6 3 3 3-3"/></svg>
</button>
</div>
<div class="bar__right">
<span class="use" data-use aria-hidden="true">
<span class="use__swap">
<span class="use__idle" data-use-idle>
<span class="key" data-key>
<svg class="key__ring" viewBox="0 0 36 22" preserveAspectRatio="none"><rect class="key__track" x="0.6" y="0.6" width="34.8" height="20.8" rx="6"/><rect class="key__fill" data-timer x="0.6" y="0.6" width="34.8" height="20.8" rx="6" pathLength="1"/></svg>
<span class="key__cap" data-keycap>Tab</span>
</span>
<span class="use__word">to use</span>
</span>
<span class="use__busy" data-use-busy>Thinking</span>
</span>
</span>
<button class="send" type="submit" data-send aria-label="Send" disabled>
<span class="send__face" data-send-face>
<svg class="send__icon" viewBox="0 0 16 16" aria-hidden="true">
<path class="send__arrow" data-arrow d="M8 12.6V3.6M4.2 7.2 8 3.4l3.8 3.8"/>
<circle class="send__spin" data-spin cx="8" cy="8" r="6" pathLength="1"/>
<path class="send__check" data-check pathLength="1" d="M4 8.4l2.7 2.7L12 5.6"/>
</svg>
</span>
</button>
</div>
</div>
</form>
</div>
<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.
30 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 “Glass prompt field” from Animorio and fit it into my siteThe field is a form with four absolute layers under the text: the glass with a vertical gradient and backdrop-filter, a barely visible radial sheen under the pointer, the edge and the beam. The edge is a one pixel ring cut out with mask-composite (1px padding and two linear-gradients), painted with a light from above and a radial-gradient sitting at --mx and --my; a gsap.quickTo on an object brings the light after the pointer on a spring, and without a mouse it drifts slowly along the top edge.
Two absolute lines sit exactly over the textarea, with the same font, size and line height. Each suggestion is split into inline-block words separated by real spaces, so it wraps like the real text; the words rise from fourteen pixels and out of a blur with back.out and a stagger, while those of the old line rise and blur with power2.in. The two lines swap at every turn.
Around the Tab key there is an SVG rectangle with pathLength 1: a stroke-dashoffset tween from 1 to 0 as long as the suggestion stays, which calls the next one when it ends. The pointer over the line pauses it and resumes it on the way out, so the time left is not lost.
With a click or Tab (caught in the textarea only when it is empty) the words go from grey to white where they are with a small elastic settle; at the end the value goes into the textarea and the lines hide in the same frame, and since they sit in the same place the swap does not show.
The sent text goes back into the lines and takes a shimmer: each word has two backgrounds clipped to the text, the colour and a light band, and the band is shifted by minus its offsetLeft, so a single --sx variable animated on the line sweeps it across the whole sentence. Meanwhile a conic-gradient in the same ring as the edge spins with the --a variable, the button’s arc spins with svgOrigin and the glow grows; after the wait the words fly off and the button draws the check.
| Name | File | Default | What it changes |
|---|---|---|---|
IDEAS | script.js | 5 prompt | The five example prompts that take turns in the field. |
DWELL | script.js | 3.2 | The seconds each suggestion stays in the field. |
STAGGER | script.js | 0.05 | The seconds between one word and the next as they rise. |
RISE | script.js | 14 | The pixels the words rise from. |
BLUR | script.js | 8 | The pixels of blur of the line that leaves. |
THINK | script.js | 2.4 | The seconds of loading after sending. |
MODEL | script.js | 'Vela 3' | The model written in the bar. |
AUTO | script.js | true | Whether it goes round by itself until someone touches it. |
For the main box of an AI app, an assistant, an internal search or a dashboard: it shows what can be asked without filling the page with pills, an example is picked with a click or Tab, and it clearly says the request is loading.
On the phone the field is 92% of the screen wide and long suggestions wrap onto two lines; the to use words go and the key with its ring stays; there is no hover, so you tap the suggestion to pick it and the light on the edge drifts by itself.
Nothing moves: the lines swap with a fade without rising or blurring, the light on the edge stays still, loading is the still arc and the text fading lighter and darker, and the check draws itself.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 9.8 KB; the libraries: GSAP 28 KB.
Tested on 3 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.