Build a CSS Cubic-Bezier Easing Curve Visualizer with Draggable Handles
A single HTML file with a draggable bezier curve editor that races test boxes against CSS built-in easings and gives you a ready-to-paste cubic-bezier value.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer who builds polished motion design tools.
Build Curvewright, a cubic-bezier easing lab. On the left is a square curve editor drawn in inline SVG with two draggable control-point handles, one coral and one teal. On the right is a side-by-side race where boxes slide across tracks: one lane uses the user's custom curve, and the others use linear, ease, ease-in, ease-out and ease-in-out. Every lane runs for the same duration.
Rules:
1. Handle x values stay between 0 and 1. Handle y values can go from -0.5 to 1.6, so users can create overshoot and anticipation. Make dragging work with mouse and touch through pointer events. A focused handle moves with the arrow keys, with Shift for bigger steps.
2. While the user drags, update the custom lane's easing live. Show the exact value, rounded to 2 decimals, in a code readout with a Copy button. If clipboard access fails, select the text instead.
3. Animate the boxes with the Web Animations API using the real CSS easing strings. Draw a dot that travels along the curve in sync with the boxes.
4. Add a Play button, Space to replay, a duration slider from 300 to 3000 ms, a Loop checkbox, and preset chips (snappy, overshoot, anticipate and the CSS keywords).
5. Use a dark palette with coral, teal and warm yellow accents. The layout is two columns that stack below 820px. With prefers-reduced-motion, turn off autoplay and looping.
Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.Example output
Tips and common edits
Why this works
- Using the Web Animations API with real easing strings means the boxes move exactly as your CSS will, so there is no approximation.
- Clamping handle x to 0–1 keeps every curve a valid cubic-bezier, and wide y limits still allow overshoot.
- Pointer events plus keyboard nudging make the handles work for mouse, touch and keyboard users without extra libraries.
Paste into ChatGPT, Claude or Gemini. Save the returned code as curvewright.html and open it in any modern browser, or run it in the chat's preview or canvas panel.
Common edits
- Swap the comparison lanes for your design system's motion tokens so you can test new curves against the existing ones.
- Add a second animated property, such as scale or opacity, to each box to judge how the easing feels on fades and pops.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
Build a Beat-Synced Kinetic Typography Quote Animation in One HTML File
A prompt that produces Beatline, a single HTML page animating a short quote word by word on a tempo grid, with varied entrances, replay and a clean recording mode.
Build a Self-Drawing SVG Lighthouse Line Animation in One HTML File
You get a single HTML page where a hand-built SVG lighthouse draws itself stroke by stroke with staggered timing, then fades in its colors, with replay and speed controls.
Build an Animated SVG World Clock with Sweeping Hands and Five Time Zones
A single HTML file with a crisp SVG analog clock whose hands glide continuously and ease smoothly between five world cities, each with a labeled UTC offset.
Build a Page Transition Demo with Wipe, Curtain and Morph Effects in One HTML File
A single HTML file that simulates a four-page website and animates every page change with wipe, curtain or morph transitions, plus an adjustable duration and a reduced-motion crossfade.
Build an Animated Number Counter and Progress Ring Stats Dashboard in HTML
You get a single HTML stats section where numbers ease up to their targets and SVG progress rings fill on scroll, with an editor panel and screen-reader announcements.
Build an Animated SVG Wave and Liquid Fill Background Generator
A single HTML file that generates layered, seamlessly looping SVG waves with live controls and exports ready-to-use animated SVG and CSS code.