feat(ui): animate page transitions and scroll long menus
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped
- richer view-transition crossfade with lift and blur, reduced-motion safe - navigation drawer scrolls with a sticky close action and compact rows on short windows - settings sidebar scrolls independently when the window is short
This commit is contained in:
1 parent
785f64a72e
commit
72909fd3b2
4 files changed
+138
-8
No files matched your search
@@ -106,6 +106,47 @@
|
|||||||
0 24px 48px rgba(0, 0, 0, 0.4),
|
0 24px 48px rgba(0, 0, 0, 0.4),
|
||||||
0 4px 8px rgba(0, 0, 0, 0.2);
|
0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
overflow: hidden; // Contain scrollbars
|
overflow: hidden; // Contain scrollbars
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
// The drawer itself scrolls, so settings/about/libraries stay reachable
|
||||||
|
// when the window is shorter than the full menu.
|
||||||
|
&-scroll {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(255, 255, 255, 0.18);
|
||||||
|
border-radius: 999px;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keep the close action visible while the rest of the menu scrolls.
|
||||||
|
&-top {
|
||||||
|
position: sticky !important;
|
||||||
|
top: 0 !important;
|
||||||
|
z-index: 3;
|
||||||
|
background: rgba(18, 18, 24, 0.92);
|
||||||
|
backdrop-filter: blur(18px) saturate(160%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.MuiList-root {
|
.MuiList-root {
|
||||||
@@ -227,6 +268,52 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Short windows: keep every menu item reachable by scrolling and make the
|
||||||
|
rows denser so less scrolling is needed in the first place. */
|
||||||
|
@media (max-height: 720px) {
|
||||||
|
.library-drawer {
|
||||||
|
&.MuiDrawer-paper {
|
||||||
|
margin: 8px;
|
||||||
|
height: calc(100% - 16px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiListItemButton-root {
|
||||||
|
min-height: 36px !important;
|
||||||
|
padding: 6px 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiListItemText-primary {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiTypography-overline {
|
||||||
|
padding-top: 0.7em !important;
|
||||||
|
padding-bottom: 0.1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiDivider-root {
|
||||||
|
margin: 2px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-height: 560px) {
|
||||||
|
.library-drawer {
|
||||||
|
.MuiListItemButton-root {
|
||||||
|
min-height: 32px !important;
|
||||||
|
padding: 4px 8px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MuiListItemText-primary {
|
||||||
|
font-size: 0.8rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.back-only-bar {
|
.back-only-bar {
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
|
|||||||
@@ -61,7 +61,8 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
|||||||
className="library-drawer"
|
className="library-drawer"
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
>
|
>
|
||||||
<List>
|
<div className="library-drawer-scroll">
|
||||||
|
<List className="library-drawer-top">
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<ListItemButton onClick={onClose}>
|
<ListItemButton onClick={onClose}>
|
||||||
<span className="material-symbols-rounded">menu_open</span>
|
<span className="material-symbols-rounded">menu_open</span>
|
||||||
@@ -169,6 +170,7 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
|
|||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
/>
|
/>
|
||||||
</List>
|
</List>
|
||||||
|
</div>
|
||||||
</Drawer>
|
</Drawer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -69,6 +69,25 @@
|
|||||||
border-right: 1px solid rgba(255, 255, 255, 0.05);
|
border-right: 1px solid rgba(255, 255, 255, 0.05);
|
||||||
padding: 1.5em 1em; // Reduced padding
|
padding: 1.5em 1em; // Reduced padding
|
||||||
gap: 1em; // Reduced gap
|
gap: 1em; // Reduced gap
|
||||||
|
min-height: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
overscroll-behavior: contain;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
|
||||||
|
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background: rgba(255, 255, 255, 0.18);
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
// Overlay titlebar: leave room for the traffic lights.
|
// Overlay titlebar: leave room for the traffic lights.
|
||||||
@@ -196,6 +215,7 @@
|
|||||||
border-right: 0;
|
border-right: 0;
|
||||||
border-bottom: 1px solid rgb(255 255 255 / 0.06);
|
border-bottom: 1px solid rgb(255 255 255 / 0.06);
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
overflow-y: hidden;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
|
|||||||
+28
-7
@@ -135,46 +135,67 @@ body {
|
|||||||
opacity: 0.35;
|
opacity: 0.35;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fast, compositor-driven page transitions. */
|
/* Page transitions: a short, soft crossfade with a gentle lift. The whole
|
||||||
|
root is snapshotted, so the app bar and player stay in place visually while
|
||||||
|
the content changes underneath them. */
|
||||||
@supports (view-transition-name: none) {
|
@supports (view-transition-name: none) {
|
||||||
|
::view-transition-group(root) {
|
||||||
|
animation-duration: 300ms;
|
||||||
|
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
}
|
||||||
|
|
||||||
::view-transition-old(root),
|
::view-transition-old(root),
|
||||||
::view-transition-new(root) {
|
::view-transition-new(root) {
|
||||||
animation-duration: 160ms;
|
|
||||||
animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
|
|
||||||
animation-fill-mode: both;
|
animation-fill-mode: both;
|
||||||
|
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
mix-blend-mode: normal;
|
||||||
|
transform-origin: 50% 42%;
|
||||||
|
will-change: opacity, transform, filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
::view-transition-old(root) {
|
::view-transition-old(root) {
|
||||||
animation-name: routeFadeOut;
|
animation-name: routeExit;
|
||||||
|
animation-duration: 180ms;
|
||||||
|
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
::view-transition-new(root) {
|
::view-transition-new(root) {
|
||||||
animation-name: routeFadeIn;
|
animation-name: routeEnter;
|
||||||
|
animation-duration: 300ms;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
::view-transition-group(root),
|
||||||
::view-transition-old(root),
|
::view-transition-old(root),
|
||||||
::view-transition-new(root) {
|
::view-transition-new(root) {
|
||||||
animation: none !important;
|
animation: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes routeFadeOut {
|
@keyframes routeExit {
|
||||||
from {
|
from {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
transform: translateY(0) scale(1);
|
||||||
|
filter: blur(0);
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
transform: translateY(-5px) scale(0.995);
|
||||||
|
filter: blur(2px);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes routeFadeIn {
|
@keyframes routeEnter {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
transform: translateY(14px) scale(1.003);
|
||||||
|
filter: blur(6px);
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
transform: translateY(0) scale(1);
|
||||||
|
filter: blur(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user