Skip to content
animorio
IT
Back to the library

Prompt with suggestions

Text, HoverGSAP, CSS onlyMediumCompressed weight: Demo 9.8 KBGSAP 28 KBFreeDownload the zip

The opening of a made-up AI assistant, Corvine: a large prompt box with a thin light running around its border, a placeholder that writes and erases its own ideas and, below, two rows of suggestions drifting slowly in opposite directions. A tapped pill flies into the box and types itself, the send button lights up, turns into a stop square when pressed, and the answer arrives with a shimmer over grey lines.

The code

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>
<!--
  "Prompt with suggestions" 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 prompt box with scrolling suggestions</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 opening of a made-up AI assistant, Corvine: a prompt box with a slow beam of light on its border, a
         placeholder that writes its own ideas, and two rows of suggestions drifting in opposite directions -->
    <section class="hero" aria-label="Corvine">
      <div class="brand">
        <svg class="brand__mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.6c.7 4.9 2.7 6.9 7.6 7.6-4.9.7-6.9 2.7-7.6 7.6-.7-4.9-2.7-6.9-7.6-7.6 4.9-.7 6.9-2.7 7.6-7.6Z"/><path d="M18.4 15.4c.3 1.9 1 2.6 2.9 2.9-1.9.3-2.6 1-2.9 2.9-.3-1.9-1-2.6-2.9-2.9 1.9-.3 2.6-1 2.9-2.9Z"/></svg>
        <span class="brand__name" data-brand>Corvine</span>
      </div>
      <h1 class="title">What should we work on?</h1>

      <form class="box" data-box autocomplete="off">
        <span class="box__beam" aria-hidden="true"></span>
        <div class="box__inner">
          <label class="box__field">
            <span class="sr">Message</span>
            <input class="box__input" data-input type="text" spellcheck="false">
            <span class="box__ph" data-ph aria-hidden="true"><span data-phtext></span><span class="box__caret" data-caret></span></span>
          </label>
          <div class="box__bar">
            <div class="box__tools">
              <button class="tool tool--round" type="button" aria-label="Attach a file">
                <svg viewBox="0 0 16 16" aria-hidden="true"><path d="M8 3.2v9.6"/><path d="M3.2 8h9.6"/></svg>
              </button>
              <button class="tool" type="button" data-search aria-pressed="false">
                <svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="5.6"/><path d="M2.4 8h11.2"/><path d="M8 2.4c1.6 1.6 2.3 3.5 2.3 5.6S9.6 12 8 13.6C6.4 12 5.7 10.1 5.7 8S6.4 4 8 2.4Z"/></svg>
                <span>Search</span>
              </button>
            </div>
            <button class="send" type="submit" data-send aria-label="Send" disabled>
              <svg class="send__arrow" viewBox="0 0 16 16" aria-hidden="true"><path d="M8 12.8V3.6"/><path d="M4 7.4 8 3.4l4 4"/></svg>
              <span class="send__stop" aria-hidden="true"></span>
            </button>
          </div>
        </div>
      </form>

      <div class="below">
        <div class="rows" data-rows>
          <div class="row" data-row="0"><div class="row__track" data-track></div></div>
          <div class="row" data-row="1"><div class="row__track" data-track></div></div>
        </div>
        <div class="answer" data-answer aria-live="polite">
          <p class="answer__head"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2.6c.7 4.9 2.7 6.9 7.6 7.6-4.9.7-6.9 2.7-7.6 7.6-.7-4.9-2.7-6.9-7.6-7.6 4.9-.7 6.9-2.7 7.6-7.6Z"/></svg><span class="answer__state" data-state>Thinking</span></p>
          <div class="answer__lines" data-lines><span></span><span></span><span></span></div>
          <p class="answer__text" data-text></p>
        </div>
      </div>
    </section>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5 2.8v16.4l4.2-4 2.8 6.2 2.9-1.3-2.8-6.1h5.9Z"/></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>

Playground

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.

19 values to change

Or ask your AI assistant for it

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 “Prompt with suggestions” from Animorio and fit it into my site
Platform licenseFree on your sites and your clients’ sites. Want it inside a website builder, a template platform or a client dashboard? There’s a license for agencies and platforms.

What it does

On a warm white background, with a faint violet light behind it, there is the opening of Corvine, a made-up AI assistant: its four-pointed star with the name, the headline What should we work on? and below a large white box with round corners. A thin violet and pink light runs slowly around the border of the box, one lap every nine seconds. Inside, the grey placeholder writes an idea by itself letter by letter, with its violet caret, holds it for a moment and erases it to write another; at the bottom of the box there are the plus to attach, the Search pill with its globe and, on the right, the round send button, grey and off. Below the box two rows of suggestion pills drift, each with its drawn icon, the first to the left and the second to the right, faded at the sides; with the pointer over it a row slows down and stops. Tap a pill and a copy of it lifts a little, flies into the box and fades as the text types itself; the send button turns black with a small bounce. Pressed, the arrow rises and disappears and a stop square arrives, the light on the border speeds up, the suggestions drop away and in their place the answer appears: the word Thinking, or Searching the web if Search is on, and three grey lines that stretch out, with a shimmer running across them. After a moment the lines fade and the answer arrives word by word, with the time it took written above; pressing the square earlier stops the answer and it says Stopped. A drawn pointer does it all by itself, once with Search and once without, then starts again; it also really works, you can type in the box and send with Enter.

How it works

The light on the border

The box has a one pixel padding and above it a layer with a conic-gradient that is almost all transparent, with a violet and pink tail: a mask with mask-composite lets only the ring of the border show. GSAP takes the --a variable from 0 to 360 in an endless loop and the gradient starts from calc(var(--a) * 1deg); while the assistant answers the same tween runs three times faster with timeScale.

The two drifting rows

Each row repeats its five pills three times, and the width of one lap is read from the distance between the first pill and the sixth. A single gsap.ticker moves the two tracks in opposite directions and wraps them back with gsap.utils.wrap; each row’s speed chases 1 or 0 with a little damping, so under the pointer it slows down and stops instead of halting at once.

The pill that flies into the box

The tapped pill is copied into an absolute element at the same position, read with getBoundingClientRect. A timeline lifts it by six pixels, carries it to the start of the box with power3.inOut and fades it with a touch of blur, while a tween on a number types the real text into the input letter by letter.

The answer arriving

When Send is pressed the arrow rises and the stop square comes in on a spring. The suggestions drop away and make room for the answer: three grey lines stretch out with scaleX and a shimmer crosses them, a gradient two and a half times the line’s width slid with background-position from a variable animated by GSAP. After the waiting time the lines fade and the words come in one by one.

The drawn pointer

The autopilot is an async function that waits with gsap.delayedCall and computes every position on the spot, so it holds up after a resize too: it goes to the row, stops it, picks the pill closest to the centre, presses it, goes to the send button and waits for the answer. The first real touch stops it; after nine quiet seconds it starts again.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js'Corvine'The name of the made-up assistant, written above the headline and in the first placeholder.
DRIFTscript.js22The pixels per second of the two rows of suggestions.
BEAM_TURNscript.js9The seconds of one lap of the light on the border of the box.
TYPE_SPEEDscript.js0.026The seconds per letter as the suggestion types itself into the box.
THINKscript.js1.9The seconds the assistant thinks before answering.
HOLDscript.js2.4The seconds the answer stays before the drawn pointer starts again.

Try them in the Playground

When to use it

For the opening of an AI assistant, an app with a chat or a tool you use by typing: the box invites you to write, the placeholder and the suggestions show what you can ask, and anyone who doesn’t know where to start taps a pill.

On phones

The same animation with adapted sizes: the headline and the box are sized on the width and the height, the Search pill keeps only its globe under 420 pixels, the rows drift the same way and a tap on a pill sends it into the box.

With reduced motion

No drifting, no flight and no lap of the light: the rows stay still, the light rests on one corner, the placeholder changes sentence with a fade, the pill’s text appears in the box at once and the answer arrives with a fade, without the shimmer.

Pitfalls

  • With two copies of the pills, on wide desktop rows one side was left empty before the wrap: three are needed, and the lap is measured from the sixth pill, not from scrollWidth, which also counts the last gap.
  • The flying pill is a copy, not the original: moving the original out of its track would make it vanish from the row, which keeps drifting meanwhile.
  • The autopilot picks the pill closest to the centre at the moment of the click and skips those half outside the row: with a fixed index, the drifting row would have carried the pill under the faded edge.

Libraries

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.

Testing

Tested on 25 October 2026

  • Desktop: Done
  • Phone: Done
  • Reduced motion: Done
  • Safari on iPhone: To do

License

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.

All animations