Daylight slider for four cities
A sun path over a full width horizon, a year slider and a day plan, with the ground colour tracking the length of the day.
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.
719 words
# Daylight slider for four cities One product tour 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 product tour for a calendar or health product: pick a city, drag through the year; path, reading and plan change. ## Structure 1. Full width section, centred 2. Small heading, four cities as radio pills 3. Chart: horizon, daylight path above, dotted night path fading below, sun disc, horizon times 4. Large daylight hours reading, two polar alternates in one cell 5. Range input for the day of the year, month strip 6. Plan: small heading, three name and value rows ## Type Sentient 300/400 (Fontshare, or Georgia) for the reading: clamp(44px,6vw,88px)/1.04, -.02em, tabular. Synonym 400/500 (Fontshare) elsewhere: body 19px/1.55. The two small headings 500 15px/1.4. City pills 16px. Date line 19px tabular. Horizon times 400 14px tabular. Month strip 13px on a 24px line. Plan rows 19px, values tabular. ## Colour Text snow #F3F6F7 on long nights, ink #15232E from twelve hours of day. Ground eases #132029 to #46596A while nights beat days, then #A3B5C1 to #E6EDF1. Sun #F3C85A for disc and thumb, the thumb with a 1.5px ink rim. Horizon, day and night paths take the text colour at 42%, 90%, 60%; plan rules 24%. ## Spacing and lines Padding clamp(120px,16vw,240px), inner column 1120px, gutters clamp(16px,4vw,56px). City row 28px under the heading, pills 6px apart, 44px tall, 20px padding, radius 999px. Chart 52px lower, full width, 320px tall, horizon four fifths down, times 32px below. Reading 24px under the chart, date line 22px lower. Slider 52px below, max 760px: a 48px control on a 1px track, 44px thumb, month strip 10px below, inset 22px. Plan clamp(88px,9vw,128px) lower, max 520px, rows 17px on 1px rules. ## Behaviour Compute sunrise, sunset and elevation from latitude and day of year; draw path, month strip and figures. At rest one city and date show: horizon times, daylight hours, three plan rows. Range 1 to 365: on input the date eases 1.1s ease out and the chart redraws every frame; Page keys step thirty days. Choosing a city eases the position over 1.5s. Ground and text cross fade 1.2s on each change; the month under the handle brightens 0.9s. Where the sun never rises or sets the reading swaps to its alternate, 1.2s, horizon times fading out 0.9s. A polite live region, 450ms after the last move, reads city, date, daylight, plan. ## Responsive Under 640px body 18px, pills 15px with 13px padding and 2px between, reading 40px, slider 52px tall with a 48px thumb, month strip inset 24px showing one letter per month. ## Accessibility Cities: a fieldset with a hidden legend and real radios behind the pills, so arrows move between them. The range has a hidden label and an aria-valuetext giving the date in words. The chart is aria-hidden; reading and date line carry the facts. Focus ring 2px currentColor, offset 3px, 4px on the thumb. ## 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 - [Heading]: four words naming the control - [Cities]: four place names - [Reading]: hours and minutes, two polar alternates - [Date line]: city and date in words - [Plan heading]: four words - [Plan rows]: three habits with a time ## 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
Product tour
Same page




