Skip to content

No.179 · Navigation· New

Lesson Path

A course drawn as a winding path of round, pressable lessons: ticks for finished ones, a bobbing Start flag on the next, grey locks after it, and a card with the lesson and its XP on press.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Light

Build a learning path in a bright, chunky, friendly style: Nunito at 800 for every label, white page, ink #4b4b4b. Each unit starts with a full-width 16px-radius header band in the unit colour with white text (uppercase 'UNIT 1' kicker, 22px title, 15px subtitle) and a solid 4px darker 'lip' under it (box-shadow 0 4px 0, no blur). Below, lessons are 70×64px round buttons stacked with 22px gaps and offset sideways along a sine curve (sin(i × 0.95) × min(76px, 19% of width)), so the path winds. Done lessons are the unit colour with a white tick and a 6px darker lip; the current lesson is the same with a filled white star, a 6px light-grey ring around it, a slow 4% breathing scale, and a white rounded 'START' flag above it in the unit colour with a 2px grey border and a pointer, bobbing 4px. Locked lessons are grey #e5e5e5 with a darker grey lip and a grey padlock. Pressing any node drops it 6px into its lip. Activating a node opens a card under it with a small pointer: unit colour, white 18px title, 'Lesson 3 of 5', and a full-width white lip button 'START +15 XP' (uppercase, unit-coloured text); done lessons offer 'PRACTISE +5 XP'; locked ones show a pale grey bordered card 'Finish Ordering coffee to unlock this' with no button. Selected variant — Light (light): Light theme: page #ffffff, ink #4b4b4b, muted #777777, ring and borders #e5e5e5, locked nodes #e5e5e5 with lip #b7b7b7 and glyph #afafaf, locked card #f7f7f7, focus ring #1cb0f6. Unit colours with lips: green #58cc02/#58a700, blue #1cb0f6/#1899d6, purple #ce82ff/#a568cc, orange #ff9600/#cc7a00, pink #ff86d0/#d364ad. This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Nodes use a roving tabindex: ↑/↓ (or ←/→) walk the path, Home/End jump to the ends, Enter or Space toggles a lesson's card, and Escape closes it and returns focus to the node. Pressing outside closes the card. Start and Practise call onStart with the lesson id. Motion: The current node breathes (scale 1 → 1.04 → 1 over 1.6s) and its flag bobs; cards pop open from 92% with a slight overshoot (cubic-bezier(.34,1.56,.64,1), 200ms); buttons drop into their lips in 90ms. Reduced motion stops the breathing, bobbing and pop. Accessibility: Each unit is a section labelled by its title; lessons are an ordered list of buttons named like 'Ordering coffee, lesson 3 of 5, up next' with aria-expanded and aria-controls pointing at their card. The decorative flag is hidden from assistive technology. Responsive behavior: The sideways swing scales with the container (19% of its width, capped at 76px) so the path never overflows a 320px phone; cards cap at 86% of the width. Touch: Lessons are large tap targets; tapping outside closes the card. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Nodes use a roving tabindex: ↑/↓ (or ←/→) walk the path, Home/End jump to the ends, Enter or Space toggles a lesson's card, and Escape closes it and returns focus to the node. Pressing outside closes the card. Start and Practise call onStart with the lesson id.
Motion
The current node breathes (scale 1 → 1.04 → 1 over 1.6s) and its flag bobs; cards pop open from 92% with a slight overshoot (cubic-bezier(.34,1.56,.64,1), 200ms); buttons drop into their lips in 90ms. Reduced motion stops the breathing, bobbing and pop.
Accessibility
Each unit is a section labelled by its title; lessons are an ordered list of buttons named like 'Ordering coffee, lesson 3 of 5, up next' with aria-expanded and aria-controls pointing at their card. The decorative flag is hidden from assistive technology.
Responsive
The sideways swing scales with the container (19% of its width, capped at 76px) so the path never overflows a 320px phone; cards cap at 86% of the width.
On touch
Lessons are large tap targets; tapping outside closes the card.

Featured

333 components