Skip to content
animorio
IT
Back to the library

AI chat dropdown

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

A hover animation in the style of premium products: the dropdown for choosing the model in a made up AI chat app, Nerva, in frosted glass on a near black page. A glass pill slides on a spring under the item at the pointer, and beside the menu the model's spec card follows it up and down on a slower spring: name, line and badge come in from the side you arrive from, the three bars for speed, reasoning and cost stretch on springs and the context and the price roll to their numbers. Clicking chooses the model: the check draws itself, the header rolls to the new name and a reflection crosses the card.

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>
<!--
  "AI chat dropdown" 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 dropdown menu with the spec card that follows the item</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 open model dropdown of an AI chat app, Nerva, in frosted glass on a near black page. A glass pill slides
         on a spring to the row under the pointer, and beside the menu a spec card follows that row up and down: its
         name, line, bars and numbers change for the model you are on. Click a row to choose it: the check draws
         itself there and the header rolls to the new name. On a phone the card sits under the menu. -->
    <div class="ui" data-ui>
      <section class="menu" data-menu aria-label="Choose a model">
        <span class="menu__light" data-light aria-hidden="true"></span>
        <header class="menu__head">
          <span class="menu__title">Model</span>
          <span class="menu__current" aria-hidden="true"><span class="menu__current-in" data-current>Nerva Core</span></span>
        </header>
        <div class="menu__list" data-list role="menu">
          <span class="menu__pill" data-pill aria-hidden="true"><span class="menu__pill-glow" data-pill-glow></span></span>
          <span class="menu__bridge" data-bridge aria-hidden="true"></span>
          <button class="row" type="button" role="menuitemradio" aria-checked="false" data-row>
            <span class="row__tile row__tile--auto" data-tile aria-hidden="true">
              <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="2.4"/><ellipse cx="12" cy="12" rx="8.2" ry="3.5" transform="rotate(-32 12 12)"/><ellipse cx="12" cy="12" rx="8.2" ry="3.5" transform="rotate(32 12 12)" opacity=".55"/></svg>
            </span>
            <span class="row__text"><span class="row__name" data-name>Auto</span><span class="row__sub">Picks the model for each message</span></span>
            <span class="row__end" aria-hidden="true"><svg class="row__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M5.5 12.6l4.2 4.1 8.8-9.3"/></svg></span>
          </button>
          <button class="row" type="button" role="menuitemradio" aria-checked="false" data-row>
            <span class="row__tile row__tile--swift" data-tile aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M13.2 3.2 5.6 13.3h5.5l-.9 7.5 7.6-10.1h-5.5z"/></svg>
            </span>
            <span class="row__text"><span class="row__name" data-name>Nerva Swift</span><span class="row__sub">Fastest for everyday tasks</span></span>
            <span class="row__end" aria-hidden="true"><svg class="row__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M5.5 12.6l4.2 4.1 8.8-9.3"/></svg></span>
          </button>
          <button class="row" type="button" role="menuitemradio" aria-checked="true" data-row>
            <span class="row__tile row__tile--core" data-tile aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M12 3.4l7.4 4.3v8.6L12 20.6l-7.4-4.3V7.7z"/><circle cx="12" cy="12" r="2.6"/></svg>
            </span>
            <span class="row__text"><span class="row__name" data-name>Nerva Core</span><span class="row__sub">Balanced, great at writing</span></span>
            <span class="row__end" aria-hidden="true"><svg class="row__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M5.5 12.6l4.2 4.1 8.8-9.3"/></svg></span>
          </button>
          <button class="row" type="button" role="menuitemradio" aria-checked="false" data-row>
            <span class="row__tile row__tile--deep" data-tile aria-hidden="true">
              <svg viewBox="0 0 24 24"><path d="M12 3.8l8 4.4-8 4.4-8-4.4z"/><path d="M4 12.2l8 4.4 8-4.4"/><path d="M4 16l8 4.4 8-4.4" opacity=".55"/></svg>
            </span>
            <span class="row__text"><span class="row__name" data-name>Nerva Deep <span class="row__tag">New</span></span><span class="row__sub">Thinks longer on hard problems</span></span>
            <span class="row__end" aria-hidden="true"><svg class="row__check" viewBox="0 0 24 24"><path data-check pathLength="1" d="M5.5 12.6l4.2 4.1 8.8-9.3"/></svg></span>
          </button>
        </div>
      </section>

      <div class="spec-wrap" data-spec-wrap>
        <aside class="spec" data-spec aria-live="polite">
          <span class="spec__light" data-light aria-hidden="true"></span>
          <span class="spec__orb" aria-hidden="true"><span class="spec__orb-a" data-orb></span><span class="spec__orb-b" data-orb-b></span></span>
          <span class="spec__sweep" aria-hidden="true"><span class="spec__sweep-band" data-sweep></span></span>
          <div class="spec__head">
            <span class="spec__name" data-spec-name>Nerva Core</span>
            <span class="spec__badge" data-spec-badge>Default</span>
          </div>
          <p class="spec__line" data-spec-line>Our everyday model: quick, careful and good with long documents.</p>
          <div class="spec__bars">
            <div class="bar"><span class="bar__label">Speed</span><span class="bar__track"><span class="bar__fill" data-fill><span class="bar__tip"></span></span></span></div>
            <div class="bar"><span class="bar__label">Reasoning</span><span class="bar__track"><span class="bar__fill" data-fill><span class="bar__tip"></span></span></span></div>
            <div class="bar"><span class="bar__label">Cost</span><span class="bar__track"><span class="bar__fill" data-fill><span class="bar__tip"></span></span></span></div>
          </div>
          <div class="spec__stats">
            <div class="stat"><span class="stat__label">Context</span><span class="stat__value" data-ctx>200K</span></div>
            <div class="stat"><span class="stat__label">Per 1M tokens</span><span class="stat__value" data-price>$3.00</span></div>
          </div>
        </aside>
      </div>
    </div>

    <svg class="cursor" data-cursor viewBox="0 0 24 24" aria-hidden="true"><path d="M5.2 3.2 18.6 13l-6.1.9 3.6 6.6-2.6 1.3-3.5-6.7-4.6 4.2z"/></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.

38 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 “AI chat dropdown” 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 near black page, with two faint violet and cyan lights and a fine grain, the dropdown of an AI chat app, Nerva, stands open: at the top «Model» and the name of the chosen model, below four items with their coloured tile and drawn icon (Auto, Nerva Swift, Nerva Core, Nerva Deep with a New badge), each with a line that says what it is for, and the check on the chosen one. Beside it sits the spec card, made of the same glass: name, badge, a sentence, three thin bars (Speed, Reasoning, Cost) with a glowing tip, and at the bottom the context and the price per million tokens. A glass pill sits under the item at the pointer and gets there on a spring, passes the mark by a pixel and settles; that item's name widens a little on the width axis, its tile gives a small kick, tilting from the side you arrive from, and the other items dim slightly. The spec card follows the item up and down on a slower spring, joined to the pill by a thin thread of light, and changes: the words leave and come back from the side of the movement, the bars stretch or shrink each on its own spring, the context counts up to 1M and the price rolls with its cents, and the light behind the card takes the model's colour. The edges of the menu and the card light up only near the pointer. Clicking an item, the row gives under the finger, the check leaves the old item and draws itself on the new one, the name at the top rolls and a reflection crosses the card. Leaving the menu, pill and card go back to the chosen model. In the preview a drawn pointer goes over the items, chooses Deep and then goes back to Core.

How it works

Two panes of glass on the page

Menu and card are two boxes with backdrop-filter, a gradient from the top and five shadows: three inset (the 1px edge and the light at the top) and two soft outer ones. The page has two faint radial-gradients and a feTurbulence grain in an SVG used as an image. The edge that lights up is a layer with a one pixel padding and a radial-gradient masked with the content-box trick, which shows only the frame; the script writes its position in two CSS variables.

The item under the pointer

All rows have the same height (a --row variable in a clamp with vh), so the item is found with a sum: the pointer's y minus the top of the list, divided by the height of a row. That works the same for the real mouse, for a finger sliding over the list (touch-action: none) and for the drawn pointer of the preview.

Real springs, in small steps

The pill, the card and the three bars are springs written by hand: acceleration = stiffness times distance minus damping times velocity, integrated in GSAP's ticker in steps of 1/240 of a second. The card uses the same spring with stiffness and damping multiplied by a lag, so it arrives after the pill and swings less. The positions are written as translate3d on the outer element; the glass inside stays with the CSS.

The card that changes

Name, badge and sentence leave in 0.11 seconds upwards or downwards, depending on whether the new item is above or below, and come back from the other side with a staggered back.out; context and price are an object GSAP takes to the new values with power3.out and that is rewritten in tabular figures at every step. The light behind the card and the one in the pill change colour with backgroundColor.

The choice

On click the row goes to 0.975 and comes back with an elastic.out, the old check erases and the new one draws itself with pathLength 1 and strokeDashoffset, the name in the header leaves upwards and comes back from below, and a band of light crosses the card with xPercent. With a finger the choice happens where it is lifted.

The preview's round

A looping timeline moves an object in list units (x in shares of the width, y in rows), and at every update converts it to pixels with the current sizes: the round stays right even if the window changes size. It starts from the load event, so every preview shows the same moment at the same time, and it stops as soon as the real pointer moves.

Values to change

NameFileDefaultWhat it changes
BRANDscript.js'Nerva'The name of the made up AI, before the model names.
STARTscript.js2The model chosen at the start: 0 Auto, 1 Swift, 2 Core, 3 Deep.
STIFFNESSscript.js320How stiff the pill's spring is.
DAMPINGscript.js24How quickly it settles: less is bouncier.
CARD_LAGscript.js0.55How much slower than the pill the card follows, from 0.2 to 1.
WIDENscript.js8How much the name under the pointer widens, on the width axis.
EDGE_LIGHTscript.js1How bright the edges get near the pointer.
IDLEscript.js4How many seconds without touching before the drawn pointer comes back.
AUTOscript.jstrueWhether the drawn pointer goes round by itself until someone moves the real one.
--violetstyle.css#8f7bffThe first colour: lights, bars, badge.
--cyanstyle.css#5fd8ffThe second colour.
--pagestyle.css#0a0b0fThe page.

Try them in the Playground

When to use it

For an AI chat app, a writing or coding assistant, a SaaS tool that lets you choose between several engines or plans: a dropdown that explains each item as you go over it, without opening another page.

On phones

The same animation with adapted sizes: under 600 pixels the spec card sits under the menu, as wide as it, and changes without moving; the rows take their height from the screen too, and on a short screen the card's sentence is left out. A finger slides over the items like the pointer and chooses the one it is lifted from.

With reduced motion

Nothing moves: the pill jumps to the item with a fade, the card stays still and changes words, bars and numbers with a fade, the name at the top changes with a fade; in the preview the items light up in turn without a pointer.

Pitfalls

  • The item is worked out from geometry and not from elementFromPoint: with a finger the browser keeps the event on the element where the touch started, and the drawn pointer sends no real events.
  • The sizes (row height, top of the list) change with the window: they are read again with a ResizeObserver and the preview's round is written in rows, not pixels.
  • With a finger the click lands on the row where the touch began: the choice is made on pointerup, on the row the finger is lifted from, and the touch's click is ignored.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.

Compressed with gzip, the three demo files weigh 10 KB; the libraries: GSAP 28 KB.

Testing

Tested on 2 November 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