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

- 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:
1xDed committed 2026-12-01 16:38:56 +03:00
1 parent 785f64a72e
commit 72909fd3b2
4 files changed
+245 -115

No files matched your search

+87
View File
@@ -106,6 +106,47 @@
0 24px 48px rgba(0, 0, 0, 0.4),
0 4px 8px rgba(0, 0, 0, 0.2);
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 {
@@ -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 {
html.is-macos & {
+110 -108
View File
@@ -61,114 +61,116 @@ export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => {
className="library-drawer"
onClose={onClose}
>
<List>
<ListItem>
<ListItemButton onClick={onClose}>
<span className="material-symbols-rounded">menu_open</span>
<div style={{ marginLeft: "8px" }}>Закрыть</div>
</ListItemButton>
</ListItem>
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Обзор
</Typography>
<List>
<ListItemLink
className="library-drawer-item"
to="/home"
icon="home"
primary="Главная"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/search"
search={{ query: "" }}
icon="search"
primary="Поиск"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/remote"
icon="settings_remote"
primary="Пульт"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/downloads"
icon="download"
primary="Загрузки"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/favorite"
icon="favorite"
primary="Избранное"
onClick={onClose}
/>
<ListItem className="library-drawer-item">
<ListItemButton
onClick={() => {
onClose();
openSyncPlayDialog();
}}
>
<span className="material-symbols-rounded">groups</span>
<ListItemText primary="Смотреть вместе" />
</ListItemButton>
</ListItem>
{libraries.isSuccess &&
libraries.data?.Items?.map((library) => (
<ListItemLink
className="library-drawer-item"
key={library.Id}
to="/library/$id"
params={{ id: library.Id ?? "" }}
icon={
library.CollectionType && getTypeIcon(library.CollectionType)
}
primary={library.Name ?? "Библиотека"}
onClick={onClose}
/>
))}
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Настройки
</Typography>
<List>
<ListItemLink
to="/settings/preferences"
icon="settings"
primary="Настройки"
className="library-drawer-item"
onClick={onClose}
/>
<ListItemLink
to="/settings/changeServer"
icon="dns"
primary="Сменить сервер"
className="library-drawer-item"
onClick={onClose}
/>
<ListItemLink
to="/settings/about"
icon="info"
primary="О приложении"
className="library-drawer-item"
onClick={onClose}
/>
</List>
<div className="library-drawer-scroll">
<List className="library-drawer-top">
<ListItem>
<ListItemButton onClick={onClose}>
<span className="material-symbols-rounded">menu_open</span>
<div style={{ marginLeft: "8px" }}>Закрыть</div>
</ListItemButton>
</ListItem>
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Обзор
</Typography>
<List>
<ListItemLink
className="library-drawer-item"
to="/home"
icon="home"
primary="Главная"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/search"
search={{ query: "" }}
icon="search"
primary="Поиск"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/remote"
icon="settings_remote"
primary="Пульт"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/downloads"
icon="download"
primary="Загрузки"
onClick={onClose}
/>
<ListItemLink
className="library-drawer-item"
to="/favorite"
icon="favorite"
primary="Избранное"
onClick={onClose}
/>
<ListItem className="library-drawer-item">
<ListItemButton
onClick={() => {
onClose();
openSyncPlayDialog();
}}
>
<span className="material-symbols-rounded">groups</span>
<ListItemText primary="Смотреть вместе" />
</ListItemButton>
</ListItem>
{libraries.isSuccess &&
libraries.data?.Items?.map((library) => (
<ListItemLink
className="library-drawer-item"
key={library.Id}
to="/library/$id"
params={{ id: library.Id ?? "" }}
icon={
library.CollectionType && getTypeIcon(library.CollectionType)
}
primary={library.Name ?? "Библиотека"}
onClick={onClose}
/>
))}
</List>
<Divider variant="middle" />
<Typography
variant="overline"
sx={{ display: "block", px: 2, pt: 1.5, opacity: 0.55 }}
>
Настройки
</Typography>
<List>
<ListItemLink
to="/settings/preferences"
icon="settings"
primary="Настройки"
className="library-drawer-item"
onClick={onClose}
/>
<ListItemLink
to="/settings/changeServer"
icon="dns"
primary="Сменить сервер"
className="library-drawer-item"
onClick={onClose}
/>
<ListItemLink
to="/settings/about"
icon="info"
primary="О приложении"
className="library-drawer-item"
onClick={onClose}
/>
</List>
</div>
</Drawer>
);
};
+20
View File
@@ -69,6 +69,25 @@
border-right: 1px solid rgba(255, 255, 255, 0.05);
padding: 1.5em 1em; // Reduced padding
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 & {
// Overlay titlebar: leave room for the traffic lights.
@@ -196,6 +215,7 @@
border-right: 0;
border-bottom: 1px solid rgb(255 255 255 / 0.06);
overflow-x: auto;
overflow-y: hidden;
box-sizing: border-box;
html.is-macos & {
+28 -7
View File
@@ -135,46 +135,67 @@ body {
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) {
::view-transition-group(root) {
animation-duration: 300ms;
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}
::view-transition-old(root),
::view-transition-new(root) {
animation-duration: 160ms;
animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
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) {
animation-name: routeFadeOut;
animation-name: routeExit;
animation-duration: 180ms;
animation-timing-function: cubic-bezier(0.4, 0, 1, 1);
}
::view-transition-new(root) {
animation-name: routeFadeIn;
animation-name: routeEnter;
animation-duration: 300ms;
}
}
@media (prefers-reduced-motion: reduce) {
::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) {
animation: none !important;
}
}
@keyframes routeFadeOut {
@keyframes routeExit {
from {
opacity: 1;
transform: translateY(0) scale(1);
filter: blur(0);
}
to {
opacity: 0;
transform: translateY(-5px) scale(0.995);
filter: blur(2px);
}
}
@keyframes routeFadeIn {
@keyframes routeEnter {
from {
opacity: 0;
transform: translateY(14px) scale(1.003);
filter: blur(6px);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
filter: blur(0);
}
}