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

[website] Improve pricing page tree view animation #44490

Merged

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Nov 21, 2024

Go to https://mui.com/pricing/ and open the tree view:

SCR-20241121-cqjl

I got frustrated with the speed of opening. This feels like a bug introduced in #43466.

The fix is to rely on https://m1.material.io/motion/duration-easing.html#duration-easing-dynamic-durations.

👉 https://deploy-preview-44490--material-ui.netlify.app/pricing/


A side note, the performance of this interaction is not production compatible, it takes 100ms to start the animation on a high-end laptop, too slow, nop.

SCR-20241121-coht

@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer website Pages that are not documentation-related, marketing-focused. labels Nov 21, 2024
@mui-bot
Copy link

mui-bot commented Nov 21, 2024

Netlify deploy preview

https://deploy-preview-44490--material-ui.netlify.app/

Bundle size report

No bundle size changes (Toolpad)
No bundle size changes

Generated by 🚫 dangerJS against eefc51a

@oliviertassinari oliviertassinari changed the title [website] Improve animation speed [website] Improve pricing page tree view animation Nov 21, 2024
Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

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

I agree that the open/close interaction could be quicker, so I’m all for it!

That said, I’d suggest adding a bit more easing to the animation, specially while opening—is that possible? Keeping the same duration would work, but maybe we could add an ease-in-and-out effect.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Nov 21, 2024

That said, I’d suggest adding a bit more easing to the animation, specially while opening—is that possible? Keeping the same duration would work, but maybe we could add an ease-in-and-out effect.

@zanivan This animation uses the default easing:

easing: easingOption = mergedEasing.easeInOut,

So it's the standard easing https://m1.material.io/motion/duration-easing.html#duration-easing-natural-easing-curves.

By "a bit more easing", do you mean the animation duration should be slower? I'm not sure to get your point.

Copy link
Contributor

@zanivan zanivan left a comment

Choose a reason for hiding this comment

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

@oliviertassinari, I was suggesting we try the easeInOut, but it turns out that’s already the one we’re using. I did think it could be a bit slower, but we should go ahead and merge this—after testing the pricing table a few times while adding the Enterprise plan, the current slowness gets really annoying 😅

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Nov 23, 2024

@zanivan I feel like the challenge is to find the right function that returns the animation duration based on the height. We could hardcode the duration for each collapse, but I'm worried that this will get broken anytime we change the number of rows, it's so easy to overlook.

@oliviertassinari oliviertassinari merged commit f706939 into mui:master Nov 23, 2024
24 checks passed
@oliviertassinari oliviertassinari deleted the fix-pricing-animation-speed branch November 23, 2024 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design This is about UI or UX design, please involve a designer website Pages that are not documentation-related, marketing-focused.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants