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

[FEATURE] coordinate durations of types animate with spring #1062

Closed
jedierikb opened this issue Mar 26, 2021 · 6 comments
Closed

[FEATURE] coordinate durations of types animate with spring #1062

jedierikb opened this issue Mar 26, 2021 · 6 comments
Labels
feature New feature or request

Comments

@jedierikb
Copy link

jedierikb commented Mar 26, 2021

I want to coordinate two animations to complete at the same time.

One is a type: 'spring' and the other is a type: 'animate', duration: x.

Can I solve for duration x given different parameters to the spring?

@jedierikb jedierikb added the feature New feature or request label Mar 26, 2021
@mattgperry
Copy link
Collaborator

You can give individually named transitions to any transition prop, with “default” as a fallback for any you didn’t explicitly mention

@jedierikb
Copy link
Author

Maybe this sandbox will help demonstrate what feature I am suggesting:
https://codesandbox.io/s/motion-duration-sync-8kh3o?file=/src/App.tsx

@mattgperry
Copy link
Collaborator

Oh I see. Thanks for that example, yeah spring accepts duration. If you set duration you can change its feel by setting bounce from between 0 and 1

@jedierikb
Copy link
Author

Explicitly setting duration on spring works and bounce allows you to tweak. Nice.
https://codesandbox.io/s/motion-duration-sync-forked-ydcp4?file=/src/App.tsx

Can you go the other way, and get an estimated duration (probably from a utility function) for a spring with fine tuned parameters like

{         type: 'spring',
          stiffness: 550,
          damping: 30,
          restDelta: 0.01,
          restSpeed: 10,
}

@jedierikb
Copy link
Author

jedierikb commented Apr 24, 2021

Is this is a bug with type: spring being set with duration, or is it user error?
#1094

If it is a bug, any suggestions where I could investigate to help fix?

@mattgperry
Copy link
Collaborator

No, this isn't possible and probably won't ever be. You have to use duration bounce to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants