Skip to content
animorio
IT
Back to the library

AI creativity slider

Text, HoverGSAPMediumCompressed weight: Demo 6.4 KBGSAP 28 KBFreeDownload the zip

The response style setting of a made-up AI assistant, Tilde: a single slider, from Precise to Creative. As you drag it, the preview sentence above rewrites itself one word at a time, plain and short on the left, more imaginative to the right: the leaving word blurs and rises, the new one arrives from below with a small bounce and a thin accent underline says what changed. The ticks light up as the fill passes, the value rolls in a pill, «Balanced» pops up in the middle, and the thumb grows while you hold it and settles on the notch with a spring.

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 creativity slider" 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>AI creativity slider</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/mona-sans@5.3.0/wdth.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fontsource-variable/fraunces@5.3.0/full.css">
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- The response style setting of a made-up AI assistant, Tilde. One slider, from Precise to Creative: as you drag
       it, the preview sentence above rewrites itself one word at a time, plainer on the left and more imaginative on
       the right, and every word that changed gets a thin accent underline for a moment. -->
  <main class="stage">
    <section class="panel" data-panel aria-label="Response style">
      <header class="panel__head">
        <div class="brand">
          <svg class="brand__mark" viewBox="0 0 20 20" aria-hidden="true"><path d="M3.5 11.2c1.6-2.4 3.4-2.4 5.1-.6 1.7 1.8 3.4 1.8 5 .1 1-.9 1.9-1.6 2.9-1.6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
          <div>
            <p class="eyebrow">Tilde · Settings</p>
            <h1>Response style</h1>
          </div>
        </div>
        <p class="value" aria-hidden="true">
          <span class="value__col" data-int><span>0</span><span>1</span></span><span class="value__dot">.</span><span class="value__col" data-dec><span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>0</span></span>
        </p>
      </header>

      <figure class="preview">
        <figcaption class="preview__label">Preview <span data-mood>Precise</span></figcaption>
        <p class="preview__text" data-text aria-live="polite"></p>
      </figure>

      <div class="slider" data-slider role="slider" tabindex="0" aria-label="Creativity" aria-valuemin="0" aria-valuemax="1" aria-valuenow="0" aria-valuetext="0.0, Precise">
        <div class="slider__track" data-track>
          <div class="slider__rail"></div>
          <div class="slider__fill" data-fill></div>
          <div class="slider__ticks" data-ticks></div>
          <div class="slider__thumb" data-thumb><span class="slider__core" data-core></span></div>
          <span class="slider__chip"><span class="slider__chip-in" data-chip>Balanced</span></span>
        </div>
        <div class="slider__ends"><span>Precise</span><span>Creative</span></div>
      </div>
    </section>
  </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.

34 values to change

Works with Claude, Claude Code, ChatGPT, Cursor, VS Code, Windsurf, Codex, Gemini CLI

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 creativity slider” 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 page, Tilde’s settings panel: at the top the mark in a black circle, «Response style» and on the right the value in a pill, from 0.0 to 1.0, with rolling digits. Below, in a warmer box, «Preview» and the sample sentence in Fraunces: on the left «Rain stopped. We walked home.», in the middle «The rain eased, so we walked home slowly.», on the right «The storm folded its wings, and we drifted home through silver streets.». Every word has its own threshold, so they change one at a time as the slider moves: the old one blurs and rises, the new one arrives from below with a bounce, the space grows or shrinks with it and a violet line draws itself underneath for a moment. At the bottom the slider: the rail fills with violet, the eleven ticks light up and stretch as it passes, and «Balanced» appears above the middle when you cross it. The white thumb with its violet core grows while you hold it and, once released, settles on the nearest notch with a spring. When nobody touches it, the slider runs to Creative by itself, back to the middle and then to Precise.

How it works

A single number

Everything depends on state.t, between 0 and 1. On every ticker frame, if it changed, the render function moves the thumb, stretches the fill, lights up the ticks, rolls the digits and checks every word. Dragging, the keyboard and the autoplay only change state.t.

Words with thresholds

The sentence is made of six slots; each has three words (plain, balanced, imaginative) and two thresholds of its own, shifted a little from slot to slot. So, as the slider moves, the words change one at a time and never all together.

The swap

When a slot changes level, the old word leaves the flow (position: absolute) and blurs as it rises, the new one comes in from below with back.out, and the slot’s width tweens from the old width to the new one: the line settles smoothly instead of jumping. A violet line draws itself underneath and fades after a moment.

The thumb and the spring

While dragging, gsap.quickTo chases the finger with a 0.28 second lag; once released, the value goes to the nearest notch with elastic.out. The thumb grows on press with back.out and comes back with an elastic, while its core does the opposite.

Playing by itself

A repeating timeline takes the slider to 1, to 0.5 and to 0, with pauses and the thumb press. It stops at the first touch; after IDLE seconds without touches it goes back to 0 and starts again.

Values to change

NameFileDefaultWhat it changes
STEPSscript.js10How many notches the slider has (the value moves in steps of 1/STEPS).
SPRINGscript.js0.55How springy the thumb is when it settles on a notch (lower, more wobble).
SWAPscript.js0.5How long a word takes to swap, in seconds.
BLURscript.js4How blurred a word is while it leaves and arrives, in pixels.
MARKscript.js0.8How long the accent underline stays under a changed word, in seconds.
PRESSscript.js1.16How much the thumb grows while you hold it.
IDLEscript.js3Seconds without a touch before the slider plays by itself again.
--accentstyle.css#5b46f2The single accent colour: the fill, the thumb’s core, the lit ticks and the changed words.

Try them in the Playground

When to use it

In the settings of an AI app, whenever an abstract choice (temperature, creativity, tone, answer length) should be shown rather than explained: whoever moves the slider reads straight away what changes.

On phones

The panel is sized on the width and on the height too (vh), the sentence wraps by itself; the slider is dragged with a finger (touch-action: none) and the rail is measured again whenever the window changes.

With reduced motion

No autoplay, no blur and no rising words: the slider starts at 0.6, the thumb goes where you take it without a spring and the words change with a fade.

Pitfalls

  • The leaving word must be taken out of the flow (position: absolute) before measuring the new one, otherwise the slot stays as wide as both together and the line jumps.
  • If a slot changes again while it is still swapping, its tweens are stopped and the leftover old words removed: otherwise fast dragging leaves overlapping ghosts.
  • The «Balanced» label is centred with a CSS translate on one element and animated by GSAP on its child: a GSAP transform on the same element would wipe out the centring.
  • The tick colours are read from the CSS variables once: tweening towards an empty colour would leave the tick black.

Libraries

GSAP 3.15.0, Mona Sans (font variabile) 5.3.0, Fraunces (font variabile) 5.3.0.

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

Testing

Tested on 29 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