feat(mobile): add dev phone preview and system-bar safe areas
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
This commit is contained in:
1 parent
c15742ff2a
commit
7fb3d6cfa4
30 files changed
+304
-81
No files matched your search
@@ -5,6 +5,7 @@ import { createRootRouteWithContext, Outlet } from "@tanstack/react-router";
|
||||
import { SnackbarProvider } from "notistack";
|
||||
import React from "react";
|
||||
import { AppBar } from "@/components/appBar/appBar";
|
||||
import MobilePreview from "@/components/mobilePreview";
|
||||
// import NProgress from "@/components/nProgress";
|
||||
import AudioPlayer from "@/components/playback/audioPlayer";
|
||||
|
||||
@@ -72,6 +73,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
||||
<QuickConnectApprovalDialog />
|
||||
<DeepLinkHandler />
|
||||
<AppBar />
|
||||
<MobilePreview />
|
||||
<WindowChrome />
|
||||
<WindowDrag />
|
||||
<WindowResizeHandles />
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.favorite-page {
|
||||
padding: 4.8rem 0 7rem !important;
|
||||
padding: calc(4.8rem + var(--safe-top)) 0 calc(7rem + var(--safe-bottom)) !important;
|
||||
}
|
||||
|
||||
.favorite-page .favorite-header {
|
||||
|
||||
@@ -267,7 +267,7 @@ body.has-player-bar .home-sections {
|
||||
}
|
||||
|
||||
.home-header {
|
||||
padding: 0.55rem 0.8rem 1rem;
|
||||
padding: calc(0.55rem + var(--safe-top)) 0.8rem 1rem;
|
||||
|
||||
.home-header-groups,
|
||||
.home-header-cast {
|
||||
@@ -306,6 +306,6 @@ body.has-player-bar .home-sections {
|
||||
}
|
||||
|
||||
.home-sections {
|
||||
padding: 2rem 1.1rem 8rem;
|
||||
padding: 2rem 1.1rem calc(8rem + var(--safe-bottom));
|
||||
}
|
||||
}
|
||||
@@ -221,6 +221,7 @@
|
||||
}
|
||||
|
||||
.library-items {
|
||||
padding-top: 8.4em !important;
|
||||
padding-top: calc(8.4em + var(--safe-top)) !important;
|
||||
padding-bottom: calc(7.5em + var(--safe-bottom)) !important;
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,9 @@
|
||||
z-index: 6;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 46px;
|
||||
padding: 4px 8px;
|
||||
min-height: calc(46px + var(--safe-top));
|
||||
padding: calc(4px + var(--safe-top)) 8px 4px;
|
||||
box-sizing: border-box;
|
||||
|
||||
&-end {
|
||||
margin-left: auto;
|
||||
@@ -34,7 +35,7 @@
|
||||
|
||||
&-collapse {
|
||||
position: absolute;
|
||||
top: 58px;
|
||||
top: calc(58px + var(--safe-top));
|
||||
right: 22px;
|
||||
z-index: 6;
|
||||
display: grid;
|
||||
@@ -68,7 +69,7 @@
|
||||
|
||||
&-stage {
|
||||
position: absolute;
|
||||
inset: 46px 0 96px;
|
||||
inset: calc(46px + var(--safe-top)) 0 calc(96px + var(--safe-bottom));
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -209,8 +210,8 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
height: 96px;
|
||||
padding: 0 clamp(1.25rem, 3vw, 3rem);
|
||||
height: calc(96px + var(--safe-bottom));
|
||||
padding: 0 clamp(1.25rem, 3vw, 3rem) var(--safe-bottom);
|
||||
box-sizing: border-box;
|
||||
|
||||
.MuiIconButton-root {
|
||||
@@ -561,12 +562,29 @@
|
||||
position: static;
|
||||
}
|
||||
|
||||
&-main {
|
||||
transition:
|
||||
transform 0.32s cubic-bezier(0.2, 0, 0, 1),
|
||||
opacity 0.25s ease;
|
||||
}
|
||||
|
||||
&.has-panel &-main {
|
||||
transform: translateX(-120%);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&-panel {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
bottom: 0;
|
||||
width: min(84vw, 520px);
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgb(12 10 20 / 0.97),
|
||||
rgb(12 10 20 / 0.93)
|
||||
);
|
||||
backdrop-filter: blur(24px) saturate(150%);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -457,8 +457,8 @@ function AudioPlayerRoute() {
|
||||
</span>
|
||||
<IconButton
|
||||
size="small"
|
||||
aria-label="Показать очередь"
|
||||
onClick={() => setPanelTab("queue")}
|
||||
aria-label="Закрыть"
|
||||
onClick={() => setPanelOpen(false)}
|
||||
>
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
@@ -479,31 +479,43 @@ function AudioPlayerRoute() {
|
||||
</div>
|
||||
</>
|
||||
) : (
|
||||
<div className="music-player-panel-body">
|
||||
{upcoming.length === 0 ? (
|
||||
<p className="music-player-panel-empty">
|
||||
Очередь пуста. Запустите альбом или плейлист,
|
||||
чтобы она наполнилась.
|
||||
</p>
|
||||
) : (
|
||||
<div className="music-player-queue-list">
|
||||
{upcoming.map((track, offset) => (
|
||||
<QueueRow
|
||||
key={track.Id}
|
||||
item={track}
|
||||
index={currentTrack + 1 + offset}
|
||||
isCurrent={false}
|
||||
coverUrl={coverFor(track)}
|
||||
onPlay={(index) =>
|
||||
playItemFromQueue(index, user?.Id, api)
|
||||
}
|
||||
queryKey={["queue-upcoming"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<>
|
||||
<div className="music-player-panel-head">
|
||||
<span className="music-player-panel-source">Очередь</span>
|
||||
<IconButton
|
||||
size="small"
|
||||
aria-label="Закрыть"
|
||||
onClick={() => setPanelOpen(false)}
|
||||
>
|
||||
<span className="material-symbols-rounded">close</span>
|
||||
</IconButton>
|
||||
</div>
|
||||
<div className="music-player-panel-body">
|
||||
{upcoming.length === 0 ? (
|
||||
<p className="music-player-panel-empty">
|
||||
Очередь пуста. Запустите альбом или плейлист,
|
||||
чтобы она наполнилась.
|
||||
</p>
|
||||
) : (
|
||||
<div className="music-player-queue-list">
|
||||
{upcoming.map((track, offset) => (
|
||||
<QueueRow
|
||||
key={track.Id}
|
||||
item={track}
|
||||
index={currentTrack + 1 + offset}
|
||||
isCurrent={false}
|
||||
coverUrl={coverFor(track)}
|
||||
onPlay={(index) =>
|
||||
playItemFromQueue(index, user?.Id, api)
|
||||
}
|
||||
queryKey={["queue-upcoming"]}
|
||||
userId={user?.Id}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</motion.aside>
|
||||
|
||||
@@ -305,8 +305,13 @@ export function VideoPlayer() {
|
||||
if (videoElement) videoElement.currentTime = target;
|
||||
}
|
||||
|
||||
if (navigator.mediaSession && mediaSource) {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
if (
|
||||
navigator.mediaSession &&
|
||||
typeof navigator.mediaSession.setActionHandler === "function" &&
|
||||
mediaSource
|
||||
) {
|
||||
if (typeof MediaMetadata !== "undefined") {
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title: isEpisode
|
||||
? `${itemName} - ${episodeTitle}`
|
||||
: (itemName ?? "Blink"),
|
||||
@@ -325,6 +330,7 @@ export function VideoPlayer() {
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
navigator.mediaSession.setActionHandler("play", () => {
|
||||
toggleIsPlaying();
|
||||
});
|
||||
|
||||
@@ -579,8 +579,8 @@ html.is-macos .remote-topbar-right .remote-topbar-divider {
|
||||
}
|
||||
|
||||
.remote-topbar {
|
||||
height: 52px;
|
||||
padding: 0 16px;
|
||||
height: calc(52px + var(--safe-top));
|
||||
padding: var(--safe-top) 16px 0;
|
||||
}
|
||||
|
||||
html.is-macos .remote-topbar {
|
||||
@@ -689,7 +689,7 @@ html.is-macos .remote-topbar-right .remote-topbar-divider {
|
||||
justify-content: flex-start;
|
||||
gap: 0.35rem;
|
||||
height: auto;
|
||||
padding: 0.5rem 1rem 1rem;
|
||||
padding: 0.5rem 1rem calc(1rem + var(--safe-bottom));
|
||||
}
|
||||
|
||||
.remote-bottom-item {
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.search-page .search-header {
|
||||
inset: 0.5em 0.5em auto 0.5em !important;
|
||||
inset: calc(0.5em + var(--safe-top)) 0.5em auto 0.5em !important;
|
||||
width: auto !important;
|
||||
flex-wrap: wrap;
|
||||
border-radius: 22px;
|
||||
@@ -230,7 +230,7 @@
|
||||
}
|
||||
|
||||
.search-page-content {
|
||||
padding: 8.4em 1rem 8rem;
|
||||
padding: calc(8.4em + var(--safe-top)) 1rem calc(8rem + var(--safe-bottom));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
align-items: center;
|
||||
gap: 0.25em;
|
||||
width: 100%;
|
||||
padding: 0.4rem 0.6rem;
|
||||
padding: calc(0.4rem + var(--safe-top)) 0.6rem 0.4rem;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid rgb(255 255 255 / 0.06);
|
||||
overflow-x: auto;
|
||||
@@ -219,7 +219,7 @@
|
||||
box-sizing: border-box;
|
||||
|
||||
html.is-macos & {
|
||||
padding-top: 0.4rem;
|
||||
padding-top: calc(0.4rem + var(--safe-top));
|
||||
padding-left: 76px;
|
||||
}
|
||||
}
|
||||
@@ -309,10 +309,14 @@
|
||||
|
||||
.settings-sidebar-list-item .MuiButtonBase-root {
|
||||
width: auto;
|
||||
padding: 0.4em 0.6em !important;
|
||||
padding: 0.4em 0.8em 0.4em 0.6em !important;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.settings-sidebar-list-item.active .MuiButtonBase-root {
|
||||
padding-right: 2em !important;
|
||||
}
|
||||
|
||||
.settings-sidebar-controls {
|
||||
display: flex;
|
||||
flex: 0 0 auto;
|
||||
@@ -323,7 +327,7 @@
|
||||
}
|
||||
|
||||
.settings-page-scrollY {
|
||||
padding: 0.75rem 1rem 7.5rem !important;
|
||||
padding: 0.75rem 1rem calc(7.5rem + var(--safe-bottom)) !important;
|
||||
}
|
||||
|
||||
.settings-form {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
.serverContainer {
|
||||
width: 100%;
|
||||
max-width: 40em;
|
||||
padding: 1rem;
|
||||
padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
|
||||
box-sizing: border-box;
|
||||
|
||||
.MuiPaper-root {
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.server-list {
|
||||
padding: 1rem;
|
||||
padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
|
||||
box-sizing: border-box;
|
||||
|
||||
&-container {
|
||||
|
||||
Reference in new issue
Block a user