
Speeding marquee
Scroll, Text, Hover
A CSS gradient editor: three colour stops to drag along the bar, a dial for the angle and three ready gradients that blend into one another. The preview, its glow and the line of code rewrite themselves as you move, and a key copies it.
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>
<!--
"Gradient editor" 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>Gradient editor</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">
<!-- a gradient editor: three colour stops slide along the bar, the dial turns the angle, the presets blend
into one another, and the line of CSS below rewrites itself as you go -->
<section class="ge" data-ge aria-label="Gradient editor">
<header class="ge__head">
<span class="ge__title">Gradient</span>
<span class="ge__angle"><b data-deg>135</b><i>deg</i></span>
<button class="ge__dial" type="button" data-dial aria-label="Angle" role="slider" aria-valuemin="0" aria-valuemax="360" aria-valuenow="135">
<span class="ge__hand" data-hand></span>
</button>
</header>
<div class="ge__view">
<span class="ge__glow" data-glow aria-hidden="true"></span>
<span class="ge__paint" data-paint aria-hidden="true"></span>
</div>
<div class="ge__bar" data-bar>
<span class="ge__strip" data-strip aria-hidden="true"></span>
</div>
<div class="ge__presets" data-presets role="radiogroup" aria-label="Presets"></div>
<div class="ge__code">
<code data-code></code>
<button class="ge__copy" type="button" data-copy aria-label="Copy CSS">
<svg viewBox="0 0 20 20" aria-hidden="true"><g data-sheets><rect x="7" y="7" width="9" height="9" rx="2.200"></rect><path d="M4.200 12.600V6.200a2 2 0 0 1 2-2h6.400"></path></g><path class="ge__tick" data-tick pathLength="1" d="M5 10.400 8.600 14l6.600-7.800"></path></svg>
</button>
</div>
</section>
<svg class="ghost" data-ghost viewBox="0 0 24 24" aria-hidden="true"><path d="M5 3.2 19.2 11l-6.3 1.6-3.3 5.9Z"></path></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.
15 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 “Gradient editor” from Animorio and fit it into my siteEach stop is an object with red, green, blue and position; the angle is a number. A single function writes from there two CSS variables (the gradient with its angle and the flat one for the bar), the handles and the line of code.
The pointer gives the percentage along the bar; the stop gets there with a tween of FOLLOW seconds, kept six points from its neighbours. The dial uses atan2 between its centre and the finger.
Choosing a preset, GSAP animates the three channels of each colour with power2.inOut and the positions with back.out, 0.06 s apart; the angle picks the shortest direction by adding or removing 360 degrees.
| Name | File | Default | What it changes |
|---|---|---|---|
START | script.js | 0 | The gradient it opens with: 0 Sunset, 1 Aurora, 2 Ember. |
BLEND | script.js | 0.9 | How many seconds one gradient takes to blend into the next. |
FOLLOW | script.js | 0.16 | How far the stop lags behind the finger, in seconds (0 = glued). |
GLOW | script.js | 0.55 | How strong the glow under the preview is, from 0 to 1. |
HOLD | script.js | 1.5 | On its own: how many seconds it stops to look at each gradient. |
LOOP | script.js | true | Left alone, a pointer moves a stop, turns the angle, changes gradient and copies. |
In the panel of a design tool, a site or theme builder, in settings where the background of a profile or a card is chosen, and on a gradient generator’s page.
The same piece: the stops have a 30-pixel touch area and are dragged by finger, the preview shrinks with the window’s height (a quarter of it) and the code wraps.
No springs, lag or blending: stops, angle and ready gradients change at once.
GSAP 3.15.0, Mona Sans (font variabile) 5.3.0.
Compressed with gzip, the three demo files weigh 7.2 KB; the libraries: GSAP 28 KB.
Tested on 17 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.