-
Notifications
You must be signed in to change notification settings - Fork 105
feat(motion): added hamburger and settings animations #7260
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
Conversation
|
Preview: https://patternfly-pr-7260.surge.sh A11y report: https://patternfly-pr-7260-a11y.surge.sh |
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're a man in motion. All you need is a pair of wings. You'll be where the eagle's flying higher and higher...
TLDR Approved. ✅
I have been adding more examples for future work on my codepen. The last two are more inline with the Red hat icon that we'll introduce some day but we can tackle that closer to release
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates are looking good!
|
Remaining tasks:
|
|
Remaining tasks:
|
andrew-ronaldson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cooooooooooooooool. thanks!
|
@andrew-ronaldson for the "settings" menu toggle, should the icon rotate on hover/focus when in the expanded state? Or should it only rotate if it isn't open? I suppose the same question for the button's "clicked" state. Currently it rotates for all states (except disabled) - https://patternfly-pr-7260.surge.sh/components/menus/menu-toggle/html/settings/ |
srambach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus favorite button fix 😻
lboehling
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks amazing! 🤩
|
🎉 This PR is included in version 6.3.0-prerelease.26 🎉 The release is available on: Your semantic-release bot 📦🚀 |
closes #7257
closes #7151
closes #7559
Links:
This PR adds:
Settings button and menu toggle
Adds
.pf-v6-c-button.pf-m-settingsand.pf-v6-c-menu-toggle.pf-m-settings. Nothing tricky, the button/menu-toggle icon element rotates on hover. Takes the regular cog icon.Hamburger button
This adds
.pf-v6-c-button.pf-m-hamburgerthat requires a specific svg as its icon. For the button variation, there is also.pf-m-collapseand.pf-m-expandthat put it in the "collapse" and "expand" states. "collapse" means clicking on it will collapse something (when the hamburger arrow points to the left), "expand" is the opposite. Thinking about that a little, this works for the hamburger, but if it's for a drawer that opens and closes from the right side of the screen, expand and collapse would point in opposite directions. @andrew-ronaldson wdyt? We don't name things "left/right" for RTL reasons, and we use "start/end" instead most of the time, but I don't know if that's appropriate here. Any ideas?The video below is the animation wired up in a react workspace to show the interaction. Sorry you can't see my mouse.
burger.mp4
The only wrinkle I see is at the 20s mark, when you shrink your screen from desktop to mobile, there is a small delay for the nav to collapse. Here's why that's what's happening. * I noticed another issue - if you're at a mobile viewport and reload the page, you see the hamburger menu blip with an arrow very quickly. I believe it's the same issue - we add
.pf-m-expandedto the sidebar by default, then remove it when we detect you're on a mobile viewport..pf-m-expandedto the sidebar when it's expanded on mobile and desktop even though that class only works on mobile (desktop is expanded by default without.pf-m-expanded). So if you load the page on desktop, you're starting out with the sidebar expanded on mobile per the markup..pf-m-expandedonce you hit the mobile breakpoint, but only after you stop resizing the window. So you're technically in the mobile breakpoint with the sidebar expanded (because of.pf-m-expanded) until you stop resizing the window, then the class is removed.I'm not saying we need to fix this now, but as a bug fix, I wonder if we could:
.pf-m-expandedfrom the sidebar by default.isMobileto determine if we need to add.pf-m-expandedor not (only add it if you're on mobile)..pf-m-expandedas a default style.The react changes I made to enable this are simple, just add the react variation and use it in
<PageToggleButton>: