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.