How it works
The visual is a row of bars of differing heights and colors standing on a common baseline - a flex container with align-items: flex-end. Each segment is one time interval; height maps intensity and color maps phase type - focus, break, deep focus - so a day's rhythm is legible in one glance.
The interaction is slide-to-scrub: on pointermove, the touch x-coordinate is converted to which segment it falls in, the indicator line follows with transform: translateX, and the header text swaps to that segment's start time and phase name. Two details create the tactile pleasure: text changes get a 150-millisecond crossfade instead of hard replacement, and the indicator carries a slight spring, so dragging feels like running a finger along ruler notches rather than querying a lookup table. Call setPointerCapture on pointerdown so the scrub keeps tracking even when the finger leaves the component.
How to use this prompt
Built for time-tracking surfaces: focus logs, sleep staging, meeting replay. Provide your segment shape - start, end, and type are enough - and the AI generates the height and color mapping. Want a legend? Add one sentence: place a phase legend at the top right.
Tips for better results
Leave 2px seams between segments; boundaries read far clearer than a continuous ribbon. Keep colors under four and give breaks the palest shade so focus phases stay the protagonist. If scrubbing flips text too fast to read, update the time within a segment but only swap the phase name when crossing into a new one. A row of hourly ticks below the axis adds instant orientation. On mobile, compute position as e.clientX minus the container's left edge - offsetX behaves inconsistently across browsers and will bite you once.