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

Support listening to prefers-reduced-motion setting #163

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

avivian
Copy link
Collaborator

@avivian avivian commented Mar 17, 2023

Addresses issue raised in #152

  • Adds the usePrefersReducedMotion option that can be passed to the useRive. If true, we respect the user prefers-reduced-motion setting and start the animation paused. Defaults to false.
  • Adds the usePrefersReducedMotion option that can be passed to the Rive component, which get's passed onto the useRive hook.

A somewhat simple, dumb implementation right now where we just pause the animation on the first frame. Being able to select the specific frame to pause on would be a cool addition, but will require work on the wasm runtime, so we can look at that separately.

@avivian avivian requested a review from zplata March 17, 2023 10:25
src/utils.ts Show resolved Hide resolved
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.

2 participants