Skip to content
motionprompts motionprompts

Vertical Drag Dial

GSAP animation component · Published 2026-11-21 · by vanguardia.dev

Open live demo ↗ Download source

What it does

A vertical dial you drag with mouse, finger or pen, click anywhere on the rail to glide to, or drive with the keyboard as a real role=slider (arrows, Shift for tens, PageUp/PageDown between stops, Home/End). Ticks and named stops sit on the rail and releasing within 7 units of a stop snaps to it with a 0.45s power3.out glide. The value updates a readout and writes one CSS variable, --t, from which the CSS derives a photo's brightness, a screen-blended glow and the colour of an indicator light pinned to the picture through object-fit maths.

How it's built

Categoryinteractive
Techgsap
Complexitywidget
Performance costlight
Mobile-safeyes

slider drag dial range snap keyboard aria pointer-capture css-variables brightness photo

Rebuild it with AI

This component's prompt is part of the paid library. Below you can read how it starts; the full prompt, the exact structure, timing and easing an AI agent needs to rebuild the effect, unlocks with any paid plan, yearly or lifetime.

# Vertical Drag Dial — a draggable vertical regulator with named stops that brightens a photo
## Goal
Build a centred composition on a black page: on the left, a tall photograph of a dark product with a small indicator light; on the right, a large readout (`4 °C`, and the name of the nearest stop under it) above a **vertical regulator**: a thin rail with ticks, three named stops (`Tea` at the top, `Room`, `Cold` at the bottom) and a round thumb. Drag the thumb with a mouse, finger or pen, or press anywhere on the rail to glide there, or click a stop name; release within 7 units of a stop and it **snaps** to it. The keyboard drives it as a real `role="slider"`. As the value rises, the photograph **brightens**, a soft glow spreads from the indicator light and the light itself shifts from pale aqua to the accent teal; at the bottom it is dim and quiet.
The value range is 4 to 85 (°C). Top is the maximum.
## Tech
Vanilla HTML/CSS/JS with ES module imports. `gsap` (npm) core only, for the snap/glide tween and `gsap.utils.clamp`. **No Draggable, no ScrollTrigger, no Lenis.** Dragging is plain Pointer Events with pointer capture.
Fonts, self-hosted: **IBM Plex Mono** 400 for the readout, the stop names and the hint. In this repo: `/c/_vendor/fonts/css/bricolage-grotesque+ibm-plex-mono-e06e78da.css`.
The architecture in one sentence: **the script writes a number and one CSS variable, `--t` from 0 to 1, on the container; the CSS derives every visual response (photo brightness, glow strength, light colour) from `--t`.** The script knows nothing about colours or filters.
## Layout / HTML
```html
<main class="page">
  <section class="dial" data-min="4" data-max="85" data-value="4">
…

Premium prompt

Unlock this prompt, and every other one

From $99/year, or $139 once for lifetime access. Commercial license included.

See pricing Or start with the free set Already bought? Sign in

New components in your inbox

One email a week, only when new components ship, each with its live demo and prompt.