Repository navigation
fix(layer): animate menu toggle into a cross inside the header overlay - #1486
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
Bundle sizeClient 795.9 kB
Largest changes in the server
Brotli sizes. Changes under 100 B are left out of the tables. Initial page load counts the JavaScript and CSS a route loads before it renders. Prerendered URLs count the JavaScript and CSS their HTML preloads (module scripts, modulepreload and stylesheets, not prefetch), and the HTML document. Components are the lazy-loaded components the page rendered: its HTML preloads them, but its route's static imports don't reach them. Measured by nuxt-bundle-analyzer for |
…oggle" This reverts commit c8331ba.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On mobile, tapping the menu button opens
UHeader's overlay, and the overlay shows its own copy of the toggle. That copy appears when the menu is already open, so it showed the cross from its first frame: the lines never animated. The toggle you actually see after tapping didn't move at all.What changed
IconMenuToggle.vue: the toggle waits two animation frames after mounting before it draws the cross. The overlay's copy now starts as three lines and transitions into the cross, matching nuxt/nuxt.com#2656.cubic-bezier(0.34,1.56,0.64,1), previously 400ms with1.36). The transition is now turned off underprefers-reduced-motion.Evidence
Docs dev server, 390×800 viewport. After clicking "Open menu", I read
getComputedStyle(line).rotateon the overlay toggle's top line every frame.mainOn
mainthe line sits at 45° from the first frame the overlay is rendered. On this branch it rotates from 0° and settles at 45° after about 400ms. Screenshots of the open and closed states look the same as before.eslintpasses on the file. I didn't record a video, and I didn't check reduced motion in a browser.I also tried CSS
@starting-styleinstead of the two frames, but it didn't work when tested by hand, so it was reverted (d3c2cd2).ELI5
The menu button turns from three lines into an X when you open the menu. On phones, the X you see sits on a new layer that pops up already set to "open", so it appeared as an X instead of animating into one. Now it starts as three lines and animates.