All effects
Parameter playground

Drag a slider: the demo replays itself so the difference is visible, and the matching number inside the prompt is rewritten. Copy it and you take a prompt tuned to your taste.

Goal line 40% The line slides over and re-judges: lower passes more days, higher gets strict
Charts

Draggable Goal Line

Drag a goal line across a bar chart and watch qualifying days light up while the counter updates live.

AI Prompt
Make a bar chart with a draggable goal line: the line (initial goal line at 40%) can be dragged up and down; bars above the line highlight in real time while dragging, and the header shows the count of qualifying days live. SVG/CSS plus vanilla JS.

How it works

The goal line is a draggable dashed rule across the chart: an absolutely positioned line element plus pointer events. While dragging, the line's position updates through transform: translateY, and every bar is compared live against it - bars above gain a highlight class (color and outline), bars below return to normal. The header statistic refreshes in the same breath: days on target. That instant feedback loop is the entire addictive quality - sweep the line up and down and the number dances, so users drag it three more times just to watch.

Performance discipline matters because the gesture is continuous: move the line only via transform, change bars only by swapping class names, and a full drag cycle triggers zero layout work - no jank even on budget phones.

How to use this prompt

For goal management everywhere: daily step targets, spending ceilings, study-hour minimums. Tell the AI the data source for the comparison (an array of bar values plus the target) and it generates highlight and tally logic. To make the goal persist, add one line: store the target in localStorage and restore it on load.

Tips for better results

Put a small handle and the current target value on the line itself - the affordance explains itself before any hint text. Ease bar color changes over 200 milliseconds instead of snapping; the chart breathes rather than flickers. Show each bar's value at its top during the drag so users can set targets with full information. Phrase the stat concretely - 12 days on target, not just a bare number - the emotional payoff is noticeably bigger. And give the line a 24px hit area: a hairline drag target is miserable on touch screens.

Keep exploring