Skip to content

Support listening to prefers-reduced-motion setting - #163

Open
avivian wants to merge 1 commit into
mainfrom
prefers-reduced-motion
Open

Support listening to prefers-reduced-motion setting#163
avivian wants to merge 1 commit into
mainfrom
prefers-reduced-motion

Conversation

@avivian

Copy link
Copy Markdown
Collaborator

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 zplataMarch 17, 2023 10:25
Comment threadsrc/utils.ts
@avivian
avivianforce-pushed the prefers-reduced-motion branch from 4493636 to 3e9b8afCompareMarch 20, 2023 10:03
Sign up for freeto 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

@avivian@zplata