From 4737bb9ddf6181f905de9bd44c0028ac5a8e0aaa Mon Sep 17 00:00:00 2001 From: DiheChen Date: Thu, 5 Nov 2026 12:31:45 +0800 Subject: [PATCH] feat: float the player bar above the page --- web/src/app/style.css | 5 ++++- web/src/features/playback/playback.css | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/web/src/app/style.css b/web/src/app/style.css index de6f4f2..7aed1fb 100644 --- a/web/src/app/style.css +++ b/web/src/app/style.css @@ -36,7 +36,7 @@ :root[data-performance='low'] button { transition: opacity 160ms; } } -.app-shell { height: calc(var(--vh, 1vh) * 100); height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 104px; overflow: hidden; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); background: var(--color-frame); } +.app-shell { height: calc(var(--vh, 1vh) * 100); height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); background: var(--color-frame); } .workspace { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; } .app-shell > .player-bar { grid-column: 1; grid-row: 2; } .workspace-header { position: relative; z-index: 30; height: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; background: var(--color-frame); color: var(--color-foreground); border: 0; border-radius: 0; } @@ -127,6 +127,9 @@ @media (max-width: 1100px) { :root { --detail-panel-width: 420px; } } +@media (min-width: 768px) { + .app-shell > .player-bar { justify-self: center; margin-bottom: 12px; } +} /* 通知相对窗口居中,侧栏打开时移到内容区中间,否则会盖住侧栏。窗口太窄时内容区放不下通知,留在原位。 */ @media (min-width: 1024px) { body:has(.detail-panel:not(.detail-panel-closing)) .notifications { left: calc(50% - (var(--detail-panel-width) + 8px) / 2); } diff --git a/web/src/features/playback/playback.css b/web/src/features/playback/playback.css index efb7a24..2c25cb1 100644 --- a/web/src/features/playback/playback.css +++ b/web/src/features/playback/playback.css @@ -21,6 +21,11 @@ .player-panel-toggle { color: var(--color-foreground-subtle); } .player-panel-toggle:hover:not(:disabled), .player-panel-toggle:focus-visible:not(:disabled), .player-panel-toggle[aria-pressed='true'] { color: var(--color-brand); background: transparent; } .player-panel-toggle:active:not(:disabled) { color: var(--color-brand); background: transparent; transform: none; } +/* 播放栏在布局里占一行,不压在页面上,所以各页面不用留出底部空间。 */ +@media (min-width: 768px) { + .player-bar { --color-hover: var(--color-surface-hover); width: min(920px, calc(100% - 16px)); padding: 10px 14px; border-radius: 16px; background: var(--color-panel); box-shadow: 0 8px 24px var(--color-shadow); } + .player-artwork .artwork { width: 56px; background: var(--color-surface); } +} @media (max-width: 1100px) { .player-bar { gap: 12px; } .player-tools .volume-control { margin-right: 4px; }