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

[feat]: add slow back animation prop for better ux #165

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Aberratio
Copy link

@Aberratio Aberratio commented Mar 4, 2024

The animation of the card's return (animateBack) is very fast and makes a very "aggressive" movement of passing to the other side.

In order to make it possible to use a slower or even remove it altogether, I propose to introduce backAnimationType props that defaults to standard and keeps the existing operation.

On the other hand, it will be possible to use this function and:

  • set the props to slow, which will delay the animateBack effect.
  • set the props to none, which will completely remove the effect of the return animation.

Comment on lines +114 to +119
if (backAnimationType === 'standard') {
return physics.animateBack;
} else if (backAnimationType === 'slow') {
return physics.animateSlow;
}
return physics.none;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be more readable.

      if (backAnimationType === 'standard') return physics.animateBack;
      if (backAnimationType === 'slow') return physics.animateSlow;
      return physics.none;

@3DJakob
Copy link
Owner

3DJakob commented Aug 29, 2024

I think a much better solution to this is exposing the spring configuration for the back animation instead. Letting the user fine tune exactly how they want the back animation to behave.

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.

3 participants