No.254 · Stats· New
Lesson Summary
The results screen at the end of a lesson: three chunky tiles count up the XP, accuracy and time, then the week's streak fills in today with a small pop.
The prompt
Written for the variant you picked above: Light
Build an end-of-lesson results screen in a bright, chunky, friendly style: Nunito, centred 34rem column. A 900-weight 28–36px 'Lesson complete!' in warm gold #ffb100 pops in from 80% scale. Below, three equal tiles in a row: each has a 2px border and header band in its colour (gold #ffc800 'TOTAL XP', green #58cc02 for accuracy, blue #1cb0f6 for time) with white uppercase 12px 800 labels, and an inner white panel with 14px corners showing a small icon and the value in the deeper tone (#e5a400, #58a700, #1899d6) at 24px 800 with tabular numbers. The accuracy header reads FLAWLESS (100), AMAZING (90+), GOOD (75+) or ACCURACY; the time header reads SPEEDY at two minutes or less, otherwise TIME. Values count up from zero over 900ms with a cubic ease-out, 150ms apart, and the tiles rise in with the same stagger. Under the tiles, a 2px grey-bordered streak card: an orange flame and '6 day streak' in #ff9600, then seven day columns with narrow weekday initials and 28px circles, orange with a 3px darker lip and a white tick when the goal was met, grey when missed. Today's circle pops in last. Two full-width 50px buttons: outlined grey 'REVIEW LESSON' and green 'CONTINUE' with a solid 4px #58a700 lip that disappears as the button drops on press. Selected variant — Light (light): Light theme: page and tile panels #ffffff, ink #4b4b4b, muted #777777, borders #e5e5e5, heading #ffb100, flame and streak #ff9600 with lip #e08600, Continue green #58cc02 with lip #58a700, focus ring #1cb0f6. 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: Continue and Review call their callbacks; the demo replays the screen. Values come entirely from props. Motion: The heading pops with an overshoot curve, tiles rise 12px in sequence, numbers count up with requestAnimationFrame, and today's streak dot scales in after the counts. With reduced motion everything shows its final value immediately. Accessibility: A section labelled by its heading. The numbers animate in an aria-hidden layer while one status line reads the full result once ('27 XP earned, 94% accuracy, 1:44 taken. 6 day streak.'). Each streak day has hidden text for met or missed and marks today. Buttons have visible focus rings. Responsive behavior: Under 26rem the tile icons hide, labels tighten, and the buttons stack with Continue on top. Touch: Two large tap targets; nothing depends on hover. 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
- Continue and Review call their callbacks; the demo replays the screen. Values come entirely from props.
- Motion
- The heading pops with an overshoot curve, tiles rise 12px in sequence, numbers count up with requestAnimationFrame, and today's streak dot scales in after the counts. With reduced motion everything shows its final value immediately.
- Accessibility
- A section labelled by its heading. The numbers animate in an aria-hidden layer while one status line reads the full result once ('27 XP earned, 94% accuracy, 1:44 taken. 6 day streak.'). Each streak day has hidden text for met or missed and marks today. Buttons have visible focus rings.
- Responsive
- Under 26rem the tile icons hide, labels tighten, and the buttons stack with Continue on top.
- On touch
- Two large tap targets; nothing depends on hover.