Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for a reduced motion prop #216

Open
Sandstedt opened this issue Jul 12, 2019 · 5 comments
Open

Add support for a reduced motion prop #216

Sandstedt opened this issue Jul 12, 2019 · 5 comments
Labels
feature feature request to implement
Projects

Comments

@Sandstedt
Copy link
Member

Sandstedt commented Jul 12, 2019

To make animations accessible per default, maybe we should add a reduced motion media query test before playing any animation. Then via a prop you could disable this, so it always plays. This could be fine for smaller animations and animations with just opacity or color changes.

So it would be up to the developer to decide if the animation is safe.

@Sandstedt Sandstedt added the feature feature request to implement label Jul 12, 2019
@xavierfoucrier
Copy link
Member

Hi @Sandstedt!

Can you give a short code sample to figure out what you mean? 😉

@Sandstedt
Copy link
Member Author

Here's and article about what it is and when it should be used: https://developers.google.com/web/updates/2019/03/prefers-reduced-motion

const opacityAnim = new mojs.Shape({
  opacity: {0 : 1},
  a11y: false
});

Not sure about the prop name. Should be clear that it has with accesability to do and that we want to ignore the prefere reduced motion check.

@Sandstedt
Copy link
Member Author

So if the a11y prop in the example above is set to true, the animation wont play if the user has set "Prefere reduced motion" in their system settings.

@xavierfoucrier
Copy link
Member

Thanks for the clarification, it could be a great feature: respect the user preference is more important than ever today.

@Sandstedt
Copy link
Member Author

Yeah, it very easy to do self as a developer, by adding the stop method inside the media query. But then the developer need to be aware of it. Better to have them opt-out instead if they know what they're doing.

@xavierfoucrier xavierfoucrier added this to Features in mojs@next Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature request to implement
Projects
No open projects
mojs@next
Features
Development

No branches or pull requests

2 participants