Respect prefers-reduced-motion in upload illustration#69
Merged
Conversation
The UploadIllustration SVG had 10+ concurrent SMIL animations (scan line, corner pulses, phone bob, lens glow, dash offset) running indefinitely, causing 40% GPU on older machines. All animations are now gated behind a useReducedMotion hook that listens to prefers-reduced-motion. When reduced motion is preferred, static SVG renders with no SMIL elements. Entrance animations (one-shot fade-in per tool) are also skipped for consistency. Signed-off-by: Jason Madigan <[email protected]>
Signed-off-by: Jason Madigan <[email protected]>
Moves 10/12 SVG SMIL animations to CSS @Keyframes using compositor-only properties (transform, opacity). Pulse ring r attribute replaced with scale(). stroke-dashoffset stays as CSS animation. prefers-reduced-motion media query added as CSS-level fallback alongside existing JS gating. Signed-off-by: Jason Madigan <[email protected]>
jasonmadigan
marked this pull request as ready for review
June 5, 2026 21:45
shanetinklenberg
pushed a commit
to shanetinklenberg/tracefinity
that referenced
this pull request
Jun 28, 2026
* Respect prefers-reduced-motion in upload illustration (tracefinity#68) The UploadIllustration SVG had 10+ concurrent SMIL animations (scan line, corner pulses, phone bob, lens glow, dash offset) running indefinitely, causing 40% GPU on older machines. All animations are now gated behind a useReducedMotion hook that listens to prefers-reduced-motion. When reduced motion is preferred, static SVG renders with no SMIL elements. Entrance animations (one-shot fade-in per tool) are also skipped for consistency. Signed-off-by: Jason Madigan <[email protected]> * fix useReducedMotion hydration mismatch and matchMedia guard Signed-off-by: Jason Madigan <[email protected]> * Replace SMIL animations with CSS in UploadIllustration Moves 10/12 SVG SMIL animations to CSS @Keyframes using compositor-only properties (transform, opacity). Pulse ring r attribute replaced with scale(). stroke-dashoffset stays as CSS animation. prefers-reduced-motion media query added as CSS-level fallback alongside existing JS gating. Signed-off-by: Jason Madigan <[email protected]> --------- Signed-off-by: Jason Madigan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
useReducedMotionhook that tracks the OS-levelprefers-reduced-motionsetting viamatchMedia<animate>,<animateTransform>) inUploadIllustrationbehind the hook -- when reduced motion is preferred, animations are removed from the DOM entirely rather than hidden, eliminating GPU compositing costmatchMedia(older browsers/test envs) and avoid hydration mismatch by deferring the read touseEffectCloses #68
Test plan
pnpm test)matchMediasupport (or mock it away) -- should default to animations enabled