Requirements, application design (incl. concept-API-contract voor het contactformulier), units en functional design voor U1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Business Logic Model — theme-foundation (U1)
Startup
/theme-init.js(blocking, same origin) reads the stored mode (guarded), falls back toprefers-color-scheme, and setsdata-variant="b"anddata-modeon<html>.ThemeProviderinitializes its state with the same function (resolveInitialMode) so React and the script always agree; it removes the legacy keyslp-software-theme.ThemeProvidersubscribes to theprefers-color-schememedia query; whilemodeSource = 'system'the mode follows it.
Mode toggle
toggleMode(): mode = (mode === 'light') ? 'dark' : 'light', modeSource = 'user', persist (guarded), update <html data-mode>.
Variant switch (sequence)
sequenceDiagram
box rgba(99,179,237,0.4) Browser UI
participant U as Visitor
participant VT as VariantToggle
participant TP as ThemeProvider
participant TO as TransitionOverlay
end
box rgba(154,230,180,0.4) App
participant VR as VariantRenderer
end
U->>VT: click
VT->>TP: toggleVariant
TP->>TO: start cover
TO-->>TP: cover done
TP->>VR: set variant, load E chunk if needed
VR-->>TP: ready or failed
TP->>TP: scroll to top and move focus
TP->>TO: reveal
TP-->>U: announce result in live region
Text alternative: the click asks the theme provider to switch; the overlay covers the page; the renderer loads and swaps the variant; the provider scrolls, moves focus, reveals and announces.
Time-travel transition (effect)
- cover: a full-viewport overlay with a pixel-dither pattern (CSS
steps()animation over a checker mask, accent-coloured) fades in over ~300 ms; pointer events are blocked andaria-hiddenis set. - swap: variant changes,
data-variantupdated, scroll to top, focus tomain. - reveal: the dither clears over ~300 ms. Total about 600 ms plus E chunk load time on first visit.
- Reduced motion: none of this renders.
Error handling
- Storage unavailable: mode works for the session only.
- E chunk fails to load: stay in B, show the alert, offer retry; the overlay is removed.
- Media query unsupported: treat as light.