Bedtime drifting over three weeks
One stretched SVG line with a dot and a figure at each end, held in place by percentages rather than a chart library.
Links in the preview stay on the block.
Open on its ownThe prompt
One prompt, written to stand on its own: goal, structure, type, colour, spacing, behaviour and the words in square brackets to replace. Paste it into any tool that writes HTML. The Code tab has this block as one file.
725 words
# Bedtime drifting over three weeks One data section, not a whole page: build it to drop into a page that already exists. Works in Claude, v0, Lovable, Bolt, Cursor or any tool that writes HTML. ## Goal A quiet chart section for a habit or sleep product: one line drifting across three weeks, a dot and a figure at each end. ## Structure 1. A centred section with a heading of about six words 2. A lead sentence: how the change is made 3. A chart area holding one full width SVG line 4. A dot at the start of the line and a dot at its end 5. A figure and week label under the start dot, the same above the end dot ## Type Sentient (Fontshare) 300 for the heading and both figures; alternative Fraunces. Synonym 400 and 500 for the body; alternative Switzer. Heading 300 clamp(44px,5.4vw,84px)/1.04, tracking -0.02em, measure 11em, balanced. Lead 19px/1.55 muted, measure 30em. The two figures 300 30px/1 serif, tabular, week labels 15px. Body 19px/1.55. ## Colour Page #F3F6F7, ink #15232E for the line, both dots and both figures, muted #5C6B76 for the lead and the week labels, hairline #D6E0E6 if a rule is needed. The line is a 1.5px ink stroke, round caps, no fill. AA: #5C6B76 and #15232E on #F3F6F7. ## Spacing and lines Section padding clamp(120px,16vw,240px) top and bottom, clamp(16px,4vw,56px) at the sides, text centred. Lead 28px under the heading. Chart clamp(80px,9vw,128px) under the lead, max 960px wide, clamp(200px,24vw,280px) tall. Dots 9px, pulled back half their size to sit on the line. Example placement: start dot 0% across and 84% down, end dot 100% and 22%. Start figure 22px under its dot, left aligned; end figure 22px above its dot, right aligned; gap 2px. ## Behaviour No script needed, and nothing moves on load or scroll. The line is one path in an SVG, viewBox 0 0 1000 100, preserveAspectRatio none, so it stretches to the box, with vector-effect non-scaling-stroke holding the stroke at 1.5px at every width. Dots and labels are placed in percentages over the same box, so they stay on the line as it resizes. Example reading: 84 of 100 down the box to 22, about 45 minutes earlier over three weeks. For your own figures, map each reading to a percentage of the box, lowest at the bottom, write the path with one point per reading, and give the dots and labels the end percentages. ## Responsive Under 640px body 18px, the two figures 26px. The chart keeps its percentages and clamped height, so the line is shorter but dots and labels stay on it. Keep the labels at opposite ends and opposite sides of the line. ## Accessibility The chart is a div with role img and an aria-label giving the reading at each end and the direction of travel. The SVG is aria-hidden and not focusable; both dots and figure blocks aria-hidden too. The section is labelled by its heading id, figures tabular. Nothing inside can be focused, so the page default serves: 2px of the current colour, offset 4px. ## Built values (from code.html) - Fonts: Sentient 300, 400 (Fontshare); Synonym 400, 500 (Fontshare). - Colour variables: --snow #F3F6F7, --ink #15232E, --muted #5C6B76, --ice #DCE6EC, --sun #F3C85A, --line #D6E0E6, --muted-ice #4C5A65. - Font variables: --serif "Sentient",Georgia,serif; --sans "Synonym",system-ui,sans-serif. - Size variables: --g clamp(16px,4vw,56px), --pad clamp(120px,16vw,240px). - Media queries: max-width 640px. - No media files. - Script: none, CSS only. ## Content to replace - [Headline]: about six words naming the pace of the change - [Lead]: how the change is made - [Readings]: a figure and label for each end - [Line]: the path through the readings between those ends ## Rules Plain, specific copy that reads as a live product; never the word sample. No shadows, glow, glass, blur, gradient text, emoji or italics. Motion moves transform and opacity, with colour, border, height and stroke transitions on state changes, and holds its end state under prefers-reduced-motion. Text passes WCAG AA. ## Output Return the block in one piece: the markup, one style block with the web fonts imported on its first line, and a small script only if the behaviour needs one. No page wrapper, no framework, no build step. Prefix every class with `blk-` and put the colours and sizes in CSS variables at the top.
More like this
Data
Same page




