mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 14:34:09 +00:00
feat(core): tweak drawer open transition
Instead of using translate which can look jarring especially in large menus, we use a combination of scale and opacity to achieve smoother effect while saving more on performance.
This commit is contained in:
parent
fae606277f
commit
e2da010a90
|
@ -10,8 +10,10 @@
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: var( --margin-header-item ) var( --margin-header-item--corner );
|
||||
opacity: 0;
|
||||
overscroll-behavior: contain;
|
||||
transform: translate3d( -110%, -110%, 0 );
|
||||
pointer-events: none;
|
||||
transform: scale( 0 );
|
||||
transform-origin: 0 0;
|
||||
user-select: none;
|
||||
will-change: transform;
|
||||
|
@ -43,7 +45,19 @@
|
|||
|
||||
// Show drawer
|
||||
~ #mw-drawer {
|
||||
transform: none;
|
||||
opacity: 1;
|
||||
pointer-events: auto;
|
||||
transform: scale( 1 );
|
||||
|
||||
#mw-drawer {
|
||||
&-header,
|
||||
&-menu {
|
||||
opacity: 1;
|
||||
// Fade content when users open the menu
|
||||
// And GTFO instantly when they close the menu
|
||||
transition: @transition-opacity--transform;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -103,6 +117,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
// For transition purpose
|
||||
&-header,
|
||||
&-menu {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&-header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
|
@ -214,7 +234,7 @@
|
|||
|
||||
.citizen-animations-ready {
|
||||
#mw-drawer {
|
||||
transition: @transition-transform;
|
||||
transition: @transition-transform, @transition-opacity--transform;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -225,6 +225,8 @@
|
|||
@transition-opacity: opacity @transition-timing-fast ease;
|
||||
|
||||
@transition-transform: transform @transition-timing-slow cubic-bezier(0.215,0.61,0.355,1);
|
||||
// Only used with transform
|
||||
@transition-opacity--transform: opacity @transition-timing-slow ease;
|
||||
@transition-height: height @transition-timing-slow cubic-bezier(0.215,0.61,0.355,1);
|
||||
|
||||
/* Box shadow */
|
||||
|
|
Loading…
Reference in a new issue