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.

Timeline span 120 分钟 The indicator auto-sweeps: 60min crowds the marks, 240min spreads them out
Stages 5 段 Segments rebuild and rescan: 3 keeps long blocks, 6 chops into small chunks
Charts

Focus Timeline

A segmented timeline of focus sessions; slide your finger and the header tracks the time and phase.

AI Prompt
Make a focus session timeline that spans 120 minutes: one horizontal axis where segments differ in height and color by phase (focus / break / deep focus, 5 phases), with an indicator line following the finger while swiping and the header showing the current time and phase name in real time. HTML/CSS plus vanilla JS.

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.

Keep exploring