-
Notifications
You must be signed in to change notification settings - Fork 438
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
Animate nav item and panel activation #323
Conversation
- Fix `.active-current` target
Pull Request Test Coverage Report for Build 4209740912
💛 - Coveralls |
- Improve nav-item activation transition performance - Animate panel height changes when switching panels - Animate nav hide TODO: - More reliable way to count the height of toc panel
Here are two problems at least to discuss,
|
Convert to draft again to do some cleaning. You can still review this PR to suggest how the animations and transitions should be or if they shouldn't be used at all, and everything like that. |
I got my local dev env a mess and it's four months ago which worses the memory... so... I need some cleaning locally for some time. And any help on this is highly appreciated. |
要不先整理合并一部分? |
Well, my English sucks
`height` prop is expected to be initialized by registerSidebarTOC
When switching from a page with TOC to a page without TOC, the TOC is retained to prevent flash and to preserve the visual animation effects. The retained TOC is marked Aside from not keeping the animation effect, we can also delay the completion of the TOC switch on such page switches. That is, wait for the TOC transition to finish (currently 300ms), and then switch the other parts of the page. Should we drop the retention or wait for the TOC transition in those cases? |
If you have any suggestion, feel free to edit this PR branch directly or ask me to change. Thank you.
Now aligned with the other CSS transition durations (200ms) by using a new stylus variable
Now it has There's one last placeholder TOC problem mentioned above. |
* Fix a bug that caused panels of very close height to bounce when switching between pages with TOC and pages without TOC
* Fix a small (~3px) bounce in the overview panel when switching between pages with TOC and pages without TOC
Muddled in the morning.
It looks perfect! For some issues to be discussed, I suggest to merge it first and then see the feedback from users |
I found that the following algorithm is not accurate navChildHeight += (singleHeight * activateEle.childElementCount) + 5;
|
PR Checklist
PR Type
What is the current behavior?
.active-current
being set to the current active item's<a>
child, not the item itself, which seems to be a mistake by 6e60221.Issue resolved:
What is the new behavior?
.active-current
to curent active.nav-item
.height
andopacity
CSS transitions during nav item activations and deactivations.opacity
,transform
CSS transitions andheight
CSS animations during nav panel activations and deactivations.How to use?
In NexT
_config.yml
: