Giter VIP home page Giter VIP logo

Comments (5)

justin-schroeder avatar justin-schroeder commented on August 22, 2024 7

We've been discussing this internally — I'm not sure making animations less distracting is the direction we want to go in. Partially because "less distracting" is a very subjective metric and partly because the way the prefers-reduced-motion option is described on many operating systems is "disable motion".

That said, we think there may be times when it makes sense to override the existing behavior but with a verbose pejorative option name much in the way React allows dangerouslySetInnerHTML. Current favorite is:

cost [ref] = useAutoAnimate({
  disrespectUserMotionPreference: true
})

from auto-animate.

justin-schroeder avatar justin-schroeder commented on August 22, 2024 1

This is available: https://auto-animate.formkit.com/#configuration

from auto-animate.

mtsknn avatar mtsknn commented on August 22, 2024

A general enabled or disabled option (#27) could work as well and would leave the decision to disable potentially distracting animations to the library users.

const prefersReducedMotion = usePrefersReducedMotion()
const [ref] = useAutoAnimate({ disabled: prefersReducedMotion })

from auto-animate.

joaomanke avatar joaomanke commented on August 22, 2024

+1 to this!

In my use case, I work in a company that sets reduced motion as default for all computers, however in some cases we need to enforce animation, to make list transitions clearer.

I can submit a PR if necessary.

The package is currently unusable because of this, but I would love to switch all my manual animations with this godsend of a library.

from auto-animate.

aderchox avatar aderchox commented on August 22, 2024

Yeah I'd like to request this too, and I also want to recommend adding a button on the main website demo/#examples/showcase section to enable animations even if reduced mode is enabled.
I don't like to change my whole system settings in order to only check the demos, and even worse, the whole time I'm developing using this library... I'm personally an animations-off guy on my own system, but I am "requested" to use animations in some projects, so... .
Thank you.

from auto-animate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.