Skip to content

fix: show reduced-motion banner with opt-in override (fixes #89)#92

Open
FrancoKaddour wants to merge 1 commit into
midudev:mainfrom
FrancoKaddour:fix/reduced-motion-warning-banner
Open

fix: show reduced-motion banner with opt-in override (fixes #89)#92
FrancoKaddour wants to merge 1 commit into
midudev:mainfrom
FrancoKaddour:fix/reduced-motion-warning-banner

Conversation

@FrancoKaddour

Copy link
Copy Markdown

When prefers-reduced-motion: reduce is active, the CSS in Layout.astro correctly disables all animations — but the page gives no feedback. Cards still show the "Hover to preview" label, pointing to an interaction that silently does nothing. That's the confusion reported in #89.

This adds ReducedMotionBanner.astro, a small dismissible banner that:

  1. Detects the media query on load and shows a plain explanatory message
  2. Offers an opt-in button that re-enables animations for the session via data-force-motion on , then dispatches a motionrestored event so cards can re-bind their listeners
  3. Listens for runtime changes to the OS setting

The CSS override is scoped to [data-force-motion="true"] with revert so it only undoes what the existing reduced-motion rule applied — nothing else changes.

The pattern follows WCAG 2.5.3: respect the preference by default, allow explicit opt-in.

Files changed

  • web/src/components/ui/ReducedMotionBanner.astro — new component
  • web/src/layouts/Layout.astro — adds [data-force-motion] CSS rule
  • web/src/pages/index.astro — renders the banner above the animation grid

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@FrancoKaddour is attempting to deploy a commit to the midudev's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant