forked from xhgit/webup-cloud
The UI had almost no motion: two transition declarations in total, no @keyframes, no animation and no prefers-reduced-motion support. Interactive states snapped instantly and the landing page was completely static. Add a self-contained motion layer instead of scattering rules through the existing stylesheets: - frontend/src/motion.css holds the tokens, interaction feedback, keyframes and the reduced-motion opt-out. It only appends rules; no existing layout rule is rewritten, so dropping the import restores the static UI. - frontend/src/motion.ts implements scroll reveal with IntersectionObserver and a MutationObserver for asynchronously rendered content. Design constraints: - Animate transform and opacity only, so motion stays on the compositor and never forces layout of siblings. - Never animate the transform of the tilted hero artwork, which would override its 3D perspective; it fades in instead. - Decorative loops are slow and low amplitude, and only where they convey "alive" (status dots, hero glow, floating prompt). - Anchor navigation now uses smooth scrolling with scroll-padding so section headings clear the sticky header. Accessibility and progressive enhancement: - The hidden state is gated on html.motion-ready, which JS adds only after an IntersectionObserver exists. Without JS, in a browser without the observer, or with reduced motion requested, content is never hidden. - prefers-reduced-motion: reduce disables every animation, transition and smooth scrolling, and forces revealed content visible. - The reduced-motion preference is also watched at runtime, so toggling it mid-session reveals anything still hidden. Verified: 27 pages render without console errors, reveal works on every landing section, hover feedback is measurable, dark mode and mobile layouts are unaffected, and both reduced-motion and missing-IntersectionObserver fallbacks keep all content visible.