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
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
||||||
<!-- <script src="http://localhost:8097"></script> -->
|
<!-- <script src="http://localhost:8097"></script> -->
|
||||||
<title>Blink</title>
|
<title>Blink</title>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -236,7 +236,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.appBar {
|
.appBar {
|
||||||
padding: 0.55rem 0.6rem !important;
|
padding: calc(0.55rem + var(--safe-top)) 0.6rem 0.55rem !important;
|
||||||
|
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
padding-left: 76px !important;
|
padding-left: 76px !important;
|
||||||
@@ -260,8 +260,8 @@
|
|||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.library-drawer.MuiDrawer-paper {
|
.library-drawer.MuiDrawer-paper {
|
||||||
width: min(84vw, 320px);
|
width: min(84vw, 320px);
|
||||||
margin: 8px;
|
margin: calc(8px + var(--safe-top)) 8px calc(8px + var(--safe-bottom));
|
||||||
height: calc(100% - 16px) !important;
|
height: calc(100% - 16px - var(--safe-top) - var(--safe-bottom)) !important;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
background: rgb(18 18 24 / 0.98) !important;
|
background: rgb(18 18 24 / 0.98) !important;
|
||||||
backdrop-filter: blur(24px) saturate(160%);
|
backdrop-filter: blur(24px) saturate(160%);
|
||||||
@@ -316,6 +316,8 @@
|
|||||||
|
|
||||||
|
|
||||||
.back-only-bar {
|
.back-only-bar {
|
||||||
|
padding-top: var(--safe-top);
|
||||||
|
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
padding-left: 76px;
|
padding-left: 76px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,7 +242,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.item-detail-page.item {
|
.item-detail-page.item {
|
||||||
padding: 0.75rem 1rem 7.5rem !important;
|
padding: 0.75rem 1rem calc(7.5rem + var(--safe-bottom)) !important;
|
||||||
|
|
||||||
.item-detail {
|
.item-detail {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ $cardWidth: 18%;
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
padding: 5.5rem 1rem 7.5rem;
|
padding: calc(5.5rem + var(--safe-top)) 1rem calc(7.5rem + var(--safe-bottom));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.library-header {
|
.library-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;
|
width: auto !important;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
border-radius: 22px;
|
border-radius: 22px;
|
||||||
@@ -121,7 +121,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.library-items {
|
.library-items {
|
||||||
padding: 7.8em 0.75rem 7.5em !important;
|
padding: calc(8.4em + var(--safe-top)) 0.75rem calc(7.5em + var(--safe-bottom)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alpha-selector {
|
.alpha-selector {
|
||||||
|
|||||||
@@ -280,7 +280,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.login-shell {
|
.login-shell {
|
||||||
padding: 4.5rem 1rem 2rem;
|
padding: calc(4.5rem + var(--safe-top)) 1rem calc(2rem + var(--safe-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-grid {
|
.profile-grid {
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
import "./mobilePreview.scss";
|
||||||
|
|
||||||
|
const MOBILE_QUERY = "(max-width: 700px)";
|
||||||
|
const isRealMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||||
|
|
||||||
|
const platformClass = () => {
|
||||||
|
const ua = navigator.userAgent;
|
||||||
|
if (ua.includes("Android")) return ["is-android", "is-mobile"];
|
||||||
|
if (/iPhone|iPad|iPod/.test(ua)) return ["is-ios", "is-mobile"];
|
||||||
|
if (ua.includes("Macintosh")) return ["is-macos"];
|
||||||
|
if (ua.includes("Windows")) return ["is-windows"];
|
||||||
|
return ["is-linux"];
|
||||||
|
};
|
||||||
|
|
||||||
|
const clock = () =>
|
||||||
|
new Date().toLocaleTimeString("ru-RU", {
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dev-only phone chrome: a transparent Android status bar and the bottom
|
||||||
|
* gesture pill are drawn over the app while the Tauri window is phone-sized.
|
||||||
|
* It lets the mobile layout be checked without a physical device.
|
||||||
|
*/
|
||||||
|
const MobilePreview = () => {
|
||||||
|
const [narrow, setNarrow] = useState(() =>
|
||||||
|
window.matchMedia(MOBILE_QUERY).matches,
|
||||||
|
);
|
||||||
|
const [time, setTime] = useState(clock);
|
||||||
|
const enabled = import.meta.env.DEV && !isRealMobile && narrow;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const media = window.matchMedia(MOBILE_QUERY);
|
||||||
|
const onChange = (event: MediaQueryListEvent) => setNarrow(event.matches);
|
||||||
|
media.addEventListener("change", onChange);
|
||||||
|
return () => media.removeEventListener("change", onChange);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!enabled) return;
|
||||||
|
const root = document.documentElement;
|
||||||
|
const previous = ["is-macos", "is-windows", "is-linux"].filter((name) =>
|
||||||
|
root.classList.contains(name),
|
||||||
|
);
|
||||||
|
root.classList.remove("is-macos", "is-windows", "is-linux");
|
||||||
|
root.classList.add("mobile-preview");
|
||||||
|
return () => {
|
||||||
|
root.classList.remove("mobile-preview");
|
||||||
|
for (const name of platformClass()) root.classList.add(name);
|
||||||
|
for (const name of previous) root.classList.add(name);
|
||||||
|
};
|
||||||
|
}, [enabled]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!enabled) return;
|
||||||
|
const timer = window.setInterval(() => setTime(clock()), 30_000);
|
||||||
|
return () => window.clearInterval(timer);
|
||||||
|
}, [enabled]);
|
||||||
|
|
||||||
|
if (!enabled) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="mobile-preview" aria-hidden="true">
|
||||||
|
<div className="mobile-preview-status">
|
||||||
|
<span className="mobile-preview-time">{time}</span>
|
||||||
|
<span className="mobile-preview-status-icons">
|
||||||
|
<span className="material-symbols-rounded">signal_cellular_alt</span>
|
||||||
|
<span className="material-symbols-rounded">wifi</span>
|
||||||
|
<span className="material-symbols-rounded">battery_full</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="mobile-preview-gesture">
|
||||||
|
<span />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MobilePreview;
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
html.mobile-preview {
|
||||||
|
--safe-top: 32px;
|
||||||
|
--safe-bottom: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
html.mobile-preview .window-controls,
|
||||||
|
html.mobile-preview .window-chrome {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-preview {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 10000;
|
||||||
|
pointer-events: none;
|
||||||
|
color: #fff;
|
||||||
|
font-family: "Medeo Sans", system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-preview-status {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
height: 32px;
|
||||||
|
padding: 0 18px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-shadow: 0 1px 3px rgb(0 0 0 / 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-preview-time {
|
||||||
|
font-size: 0.82rem;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.01em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-preview-status-icons {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.3rem;
|
||||||
|
|
||||||
|
.material-symbols-rounded {
|
||||||
|
font-size: 1rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile-preview-gesture {
|
||||||
|
position: absolute;
|
||||||
|
inset: auto 0 0;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
height: 28px;
|
||||||
|
|
||||||
|
span {
|
||||||
|
width: 108px;
|
||||||
|
height: 4px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgb(255 255 255 / 0.85);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -20,6 +20,8 @@ export const ErrorNotice = ({ error }: { error?: unknown }) => {
|
|||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
flexFlow: "column",
|
flexFlow: "column",
|
||||||
|
boxSizing: "border-box",
|
||||||
|
padding: "calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom))",
|
||||||
// opacity: 0.2,
|
// opacity: 0.2,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -52,8 +54,9 @@ export const ErrorNotice = ({ error }: { error?: unknown }) => {
|
|||||||
background: "rgb(0 0 0 / 1)",
|
background: "rgb(0 0 0 / 1)",
|
||||||
borderRadius: "8px",
|
borderRadius: "8px",
|
||||||
border: "2px dashed rgb(255 255 255 / 0.5)",
|
border: "2px dashed rgb(255 255 255 / 0.5)",
|
||||||
maxWidth: "40em",
|
maxWidth: "100%",
|
||||||
maxHeight: "20em",
|
maxHeight: "20em",
|
||||||
|
boxSizing: "border-box",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
marginTop: "1em",
|
marginTop: "1em",
|
||||||
whiteSpace: "pre-wrap",
|
whiteSpace: "pre-wrap",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ html.player-full-open .audio-player {
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0.85rem;
|
bottom: calc(0.85rem + var(--safe-bottom));
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
width: min(1700px, calc(100% - 3rem));
|
width: min(1700px, calc(100% - 3rem));
|
||||||
height: 82px;
|
height: 82px;
|
||||||
@@ -348,7 +348,7 @@ html.player-full-open .audio-player {
|
|||||||
.audio-player {
|
.audio-player {
|
||||||
width: calc(100% - 1rem);
|
width: calc(100% - 1rem);
|
||||||
height: 64px;
|
height: 64px;
|
||||||
bottom: 0.5rem;
|
bottom: calc(0.5rem + var(--safe-bottom));
|
||||||
padding: 0 0.55rem;
|
padding: 0 0.55rem;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
border-radius: 22px;
|
border-radius: 22px;
|
||||||
|
|||||||
@@ -208,7 +208,11 @@ const AudioPlayer = () => {
|
|||||||
|
|
||||||
// Media Session metadata/actions for local playback.
|
// Media Session metadata/actions for local playback.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if ("mediaSession" in navigator && item) {
|
if (
|
||||||
|
navigator.mediaSession &&
|
||||||
|
typeof MediaMetadata !== "undefined" &&
|
||||||
|
item
|
||||||
|
) {
|
||||||
const imageUrl = item.ImageTags?.Primary
|
const imageUrl = item.ImageTags?.Primary
|
||||||
? api &&
|
? api &&
|
||||||
getImageUrlsApi(api).getItemImageUrlById(item.Id ?? "", "Primary", {
|
getImageUrlsApi(api).getItemImageUrlById(item.Id ?? "", "Primary", {
|
||||||
@@ -227,7 +231,7 @@ const AudioPlayer = () => {
|
|||||||
}, [item, api]);
|
}, [item, api]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!("mediaSession" in navigator)) return;
|
if (!navigator.mediaSession?.setActionHandler) return;
|
||||||
navigator.mediaSession.setActionHandler("play", () => {
|
navigator.mediaSession.setActionHandler("play", () => {
|
||||||
audioRef.current?.play();
|
audioRef.current?.play();
|
||||||
});
|
});
|
||||||
@@ -320,14 +324,14 @@ const AudioPlayer = () => {
|
|||||||
const onPlay = () => {
|
const onPlay = () => {
|
||||||
setPlaying(true);
|
setPlaying(true);
|
||||||
updatePositionState();
|
updatePositionState();
|
||||||
if ("mediaSession" in navigator) {
|
if (navigator.mediaSession) {
|
||||||
navigator.mediaSession.playbackState = "playing";
|
navigator.mediaSession.playbackState = "playing";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onPause = () => {
|
const onPause = () => {
|
||||||
setPlaying(false);
|
setPlaying(false);
|
||||||
updatePositionState();
|
updatePositionState();
|
||||||
if ("mediaSession" in navigator) {
|
if (navigator.mediaSession) {
|
||||||
navigator.mediaSession.playbackState = "paused";
|
navigator.mediaSession.playbackState = "paused";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ const ForwardButton = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!navigator.mediaSession?.setActionHandler) return;
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler("seekforward", (details) => {
|
navigator.mediaSession.setActionHandler("seekforward", (details) => {
|
||||||
if (details.seekOffset) {
|
if (details.seekOffset) {
|
||||||
seekForward(details.seekOffset);
|
seekForward(details.seekOffset);
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ const RewindButton = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
if (!navigator.mediaSession?.setActionHandler) return;
|
||||||
|
|
||||||
navigator.mediaSession.setActionHandler("seekbackward", (details) => {
|
navigator.mediaSession.setActionHandler("seekbackward", (details) => {
|
||||||
if (details.seekOffset) {
|
if (details.seekOffset) {
|
||||||
seekBackward(details.seekOffset);
|
seekBackward(details.seekOffset);
|
||||||
|
|||||||
@@ -27,8 +27,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 0.75em;
|
gap: 0.75em;
|
||||||
padding: 4px 8px;
|
padding: calc(4px + var(--safe-top)) 8px 4px;
|
||||||
min-height: 46px;
|
min-height: calc(46px + var(--safe-top));
|
||||||
|
box-sizing: border-box;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
&-end {
|
&-end {
|
||||||
@@ -51,7 +52,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 2em 3em;
|
padding: 2em 3em calc(2em + var(--safe-bottom));
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
to bottom,
|
to bottom,
|
||||||
rgba(0, 0, 0, 0.8) 0%,
|
rgba(0, 0, 0, 0.8) 0%,
|
||||||
@@ -148,7 +149,7 @@ html.is-macos .video-player-titlebar.is-fullscreen {
|
|||||||
}
|
}
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.video-player-osd {
|
.video-player-osd {
|
||||||
padding: 0.75em 1em;
|
padding: 0.75em 1em calc(0.75em + var(--safe-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-player-osd-info {
|
.video-player-osd-info {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import React, { useEffect, useState } from "react";
|
|||||||
import "./windowControls.scss";
|
import "./windowControls.scss";
|
||||||
|
|
||||||
const isMac = navigator.userAgent.includes("Macintosh");
|
const isMac = navigator.userAgent.includes("Macintosh");
|
||||||
|
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||||
|
|
||||||
const WindowsControls = () => {
|
const WindowsControls = () => {
|
||||||
const [maximized, setMaximized] = useState(false);
|
const [maximized, setMaximized] = useState(false);
|
||||||
@@ -68,6 +69,7 @@ const WindowsControls = () => {
|
|||||||
* Window buttons for frameless windows on Windows/Linux. macOS keeps its
|
* Window buttons for frameless windows on Windows/Linux. macOS keeps its
|
||||||
* native traffic lights (overlay titlebar), so this renders nothing there.
|
* native traffic lights (overlay titlebar), so this renders nothing there.
|
||||||
*/
|
*/
|
||||||
const WindowControls = () => (isMac ? null : <WindowsControls />);
|
const WindowControls = () =>
|
||||||
|
isMac || isMobile ? null : <WindowsControls />;
|
||||||
|
|
||||||
export default WindowControls;
|
export default WindowControls;
|
||||||
@@ -6,6 +6,7 @@ import WindowControls from ".";
|
|||||||
import "./windowControls.scss";
|
import "./windowControls.scss";
|
||||||
|
|
||||||
const isMac = navigator.userAgent.includes("Macintosh");
|
const isMac = navigator.userAgent.includes("Macintosh");
|
||||||
|
const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frameless-window fallback for pages that do not draw the app header:
|
* Frameless-window fallback for pages that do not draw the app header:
|
||||||
@@ -17,7 +18,7 @@ const isMac = navigator.userAgent.includes("Macintosh");
|
|||||||
*/
|
*/
|
||||||
const WindowChrome = () => {
|
const WindowChrome = () => {
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
if (isMac) return null;
|
if (isMac || isMobile) return null;
|
||||||
// The global app header owns the window buttons on these routes.
|
// The global app header owns the window buttons on these routes.
|
||||||
if (shouldShowAppBar(pathname)) return null;
|
if (shouldShowAppBar(pathname)) return null;
|
||||||
// The home page draws its own header inside the hero frame.
|
// The home page draws its own header inside the hero frame.
|
||||||
|
|||||||
+7
-1
@@ -129,7 +129,13 @@ const init = async () => {
|
|||||||
// Frameless titlebar: macOS keeps the native traffic lights; Windows and
|
// Frameless titlebar: macOS keeps the native traffic lights; Windows and
|
||||||
// Linux use the custom window buttons in the header.
|
// Linux use the custom window buttons in the header.
|
||||||
const userAgent = navigator.userAgent;
|
const userAgent = navigator.userAgent;
|
||||||
if (userAgent.includes("Macintosh")) {
|
const isAndroid = userAgent.includes("Android");
|
||||||
|
const isIOS = /iPhone|iPad|iPod/.test(userAgent);
|
||||||
|
if (isAndroid) {
|
||||||
|
document.documentElement.classList.add("is-android", "is-mobile");
|
||||||
|
} else if (isIOS) {
|
||||||
|
document.documentElement.classList.add("is-ios", "is-mobile");
|
||||||
|
} else if (userAgent.includes("Macintosh")) {
|
||||||
document.documentElement.classList.add("is-macos");
|
document.documentElement.classList.add("is-macos");
|
||||||
} else if (userAgent.includes("Windows")) {
|
} else if (userAgent.includes("Windows")) {
|
||||||
document.documentElement.classList.add("is-windows");
|
document.documentElement.classList.add("is-windows");
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { createRootRouteWithContext, Outlet } from "@tanstack/react-router";
|
|||||||
import { SnackbarProvider } from "notistack";
|
import { SnackbarProvider } from "notistack";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { AppBar } from "@/components/appBar/appBar";
|
import { AppBar } from "@/components/appBar/appBar";
|
||||||
|
import MobilePreview from "@/components/mobilePreview";
|
||||||
// import NProgress from "@/components/nProgress";
|
// import NProgress from "@/components/nProgress";
|
||||||
import AudioPlayer from "@/components/playback/audioPlayer";
|
import AudioPlayer from "@/components/playback/audioPlayer";
|
||||||
|
|
||||||
@@ -72,6 +73,7 @@ export const Route = createRootRouteWithContext<ApiContext>()({
|
|||||||
<QuickConnectApprovalDialog />
|
<QuickConnectApprovalDialog />
|
||||||
<DeepLinkHandler />
|
<DeepLinkHandler />
|
||||||
<AppBar />
|
<AppBar />
|
||||||
|
<MobilePreview />
|
||||||
<WindowChrome />
|
<WindowChrome />
|
||||||
<WindowDrag />
|
<WindowDrag />
|
||||||
<WindowResizeHandles />
|
<WindowResizeHandles />
|
||||||
|
|||||||
@@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.favorite-page {
|
.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 {
|
.favorite-page .favorite-header {
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ body.has-player-bar .home-sections {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.home-header {
|
.home-header {
|
||||||
padding: 0.55rem 0.8rem 1rem;
|
padding: calc(0.55rem + var(--safe-top)) 0.8rem 1rem;
|
||||||
|
|
||||||
.home-header-groups,
|
.home-header-groups,
|
||||||
.home-header-cast {
|
.home-header-cast {
|
||||||
@@ -306,6 +306,6 @@ body.has-player-bar .home-sections {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.home-sections {
|
.home-sections {
|
||||||
padding: 2rem 1.1rem 8rem;
|
padding: 2rem 1.1rem calc(8rem + var(--safe-bottom));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,6 +221,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.library-items {
|
.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;
|
z-index: 6;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-height: 46px;
|
min-height: calc(46px + var(--safe-top));
|
||||||
padding: 4px 8px;
|
padding: calc(4px + var(--safe-top)) 8px 4px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
&-end {
|
&-end {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
|
|
||||||
&-collapse {
|
&-collapse {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 58px;
|
top: calc(58px + var(--safe-top));
|
||||||
right: 22px;
|
right: 22px;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -68,7 +69,7 @@
|
|||||||
|
|
||||||
&-stage {
|
&-stage {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 46px 0 96px;
|
inset: calc(46px + var(--safe-top)) 0 calc(96px + var(--safe-bottom));
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -209,8 +210,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
height: 96px;
|
height: calc(96px + var(--safe-bottom));
|
||||||
padding: 0 clamp(1.25rem, 3vw, 3rem);
|
padding: 0 clamp(1.25rem, 3vw, 3rem) var(--safe-bottom);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.MuiIconButton-root {
|
.MuiIconButton-root {
|
||||||
@@ -561,12 +562,29 @@
|
|||||||
position: static;
|
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 {
|
&-panel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 1rem;
|
inset: 0;
|
||||||
right: 1rem;
|
width: 100%;
|
||||||
bottom: 0;
|
background: linear-gradient(
|
||||||
width: min(84vw, 520px);
|
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>
|
</span>
|
||||||
<IconButton
|
<IconButton
|
||||||
size="small"
|
size="small"
|
||||||
aria-label="Показать очередь"
|
aria-label="Закрыть"
|
||||||
onClick={() => setPanelTab("queue")}
|
onClick={() => setPanelOpen(false)}
|
||||||
>
|
>
|
||||||
<span className="material-symbols-rounded">close</span>
|
<span className="material-symbols-rounded">close</span>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
@@ -479,31 +479,43 @@ function AudioPlayerRoute() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="music-player-panel-body">
|
<>
|
||||||
{upcoming.length === 0 ? (
|
<div className="music-player-panel-head">
|
||||||
<p className="music-player-panel-empty">
|
<span className="music-player-panel-source">Очередь</span>
|
||||||
Очередь пуста. Запустите альбом или плейлист,
|
<IconButton
|
||||||
чтобы она наполнилась.
|
size="small"
|
||||||
</p>
|
aria-label="Закрыть"
|
||||||
) : (
|
onClick={() => setPanelOpen(false)}
|
||||||
<div className="music-player-queue-list">
|
>
|
||||||
{upcoming.map((track, offset) => (
|
<span className="material-symbols-rounded">close</span>
|
||||||
<QueueRow
|
</IconButton>
|
||||||
key={track.Id}
|
</div>
|
||||||
item={track}
|
<div className="music-player-panel-body">
|
||||||
index={currentTrack + 1 + offset}
|
{upcoming.length === 0 ? (
|
||||||
isCurrent={false}
|
<p className="music-player-panel-empty">
|
||||||
coverUrl={coverFor(track)}
|
Очередь пуста. Запустите альбом или плейлист,
|
||||||
onPlay={(index) =>
|
чтобы она наполнилась.
|
||||||
playItemFromQueue(index, user?.Id, api)
|
</p>
|
||||||
}
|
) : (
|
||||||
queryKey={["queue-upcoming"]}
|
<div className="music-player-queue-list">
|
||||||
userId={user?.Id}
|
{upcoming.map((track, offset) => (
|
||||||
/>
|
<QueueRow
|
||||||
))}
|
key={track.Id}
|
||||||
</div>
|
item={track}
|
||||||
)}
|
index={currentTrack + 1 + offset}
|
||||||
</div>
|
isCurrent={false}
|
||||||
|
coverUrl={coverFor(track)}
|
||||||
|
onPlay={(index) =>
|
||||||
|
playItemFromQueue(index, user?.Id, api)
|
||||||
|
}
|
||||||
|
queryKey={["queue-upcoming"]}
|
||||||
|
userId={user?.Id}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</motion.aside>
|
</motion.aside>
|
||||||
|
|||||||
@@ -305,8 +305,13 @@ export function VideoPlayer() {
|
|||||||
if (videoElement) videoElement.currentTime = target;
|
if (videoElement) videoElement.currentTime = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (navigator.mediaSession && mediaSource) {
|
if (
|
||||||
navigator.mediaSession.metadata = new MediaMetadata({
|
navigator.mediaSession &&
|
||||||
|
typeof navigator.mediaSession.setActionHandler === "function" &&
|
||||||
|
mediaSource
|
||||||
|
) {
|
||||||
|
if (typeof MediaMetadata !== "undefined") {
|
||||||
|
navigator.mediaSession.metadata = new MediaMetadata({
|
||||||
title: isEpisode
|
title: isEpisode
|
||||||
? `${itemName} - ${episodeTitle}`
|
? `${itemName} - ${episodeTitle}`
|
||||||
: (itemName ?? "Blink"),
|
: (itemName ?? "Blink"),
|
||||||
@@ -325,6 +330,7 @@ export function VideoPlayer() {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
}
|
||||||
navigator.mediaSession.setActionHandler("play", () => {
|
navigator.mediaSession.setActionHandler("play", () => {
|
||||||
toggleIsPlaying();
|
toggleIsPlaying();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -579,8 +579,8 @@ html.is-macos .remote-topbar-right .remote-topbar-divider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.remote-topbar {
|
.remote-topbar {
|
||||||
height: 52px;
|
height: calc(52px + var(--safe-top));
|
||||||
padding: 0 16px;
|
padding: var(--safe-top) 16px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
html.is-macos .remote-topbar {
|
html.is-macos .remote-topbar {
|
||||||
@@ -689,7 +689,7 @@ html.is-macos .remote-topbar-right .remote-topbar-divider {
|
|||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
gap: 0.35rem;
|
gap: 0.35rem;
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 0.5rem 1rem 1rem;
|
padding: 0.5rem 1rem calc(1rem + var(--safe-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.remote-bottom-item {
|
.remote-bottom-item {
|
||||||
|
|||||||
@@ -196,7 +196,7 @@
|
|||||||
|
|
||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
.search-page .search-header {
|
.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;
|
width: auto !important;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
border-radius: 22px;
|
border-radius: 22px;
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.search-page-content {
|
.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;
|
align-items: center;
|
||||||
gap: 0.25em;
|
gap: 0.25em;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0.4rem 0.6rem;
|
padding: calc(0.4rem + var(--safe-top)) 0.6rem 0.4rem;
|
||||||
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;
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
html.is-macos & {
|
html.is-macos & {
|
||||||
padding-top: 0.4rem;
|
padding-top: calc(0.4rem + var(--safe-top));
|
||||||
padding-left: 76px;
|
padding-left: 76px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,10 +309,14 @@
|
|||||||
|
|
||||||
.settings-sidebar-list-item .MuiButtonBase-root {
|
.settings-sidebar-list-item .MuiButtonBase-root {
|
||||||
width: auto;
|
width: auto;
|
||||||
padding: 0.4em 0.6em !important;
|
padding: 0.4em 0.8em 0.4em 0.6em !important;
|
||||||
font-size: 0.82rem;
|
font-size: 0.82rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.settings-sidebar-list-item.active .MuiButtonBase-root {
|
||||||
|
padding-right: 2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
.settings-sidebar-controls {
|
.settings-sidebar-controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
@@ -323,7 +327,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.settings-page-scrollY {
|
.settings-page-scrollY {
|
||||||
padding: 0.75rem 1rem 7.5rem !important;
|
padding: 0.75rem 1rem calc(7.5rem + var(--safe-bottom)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.settings-form {
|
.settings-form {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
.serverContainer {
|
.serverContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 40em;
|
max-width: 40em;
|
||||||
padding: 1rem;
|
padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.MuiPaper-root {
|
.MuiPaper-root {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.server-list {
|
.server-list {
|
||||||
padding: 1rem;
|
padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
&-container {
|
&-container {
|
||||||
|
|||||||
+18
-4
@@ -32,6 +32,20 @@
|
|||||||
|
|
||||||
:root {
|
:root {
|
||||||
--font-mono: "Medeo Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
--font-mono: "Medeo Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||||
|
--safe-top: env(safe-area-inset-top, 0px);
|
||||||
|
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Android WebViews run edge-to-edge: env() reports cutouts but not the system
|
||||||
|
bars, so keep a platform fallback clear of the status and navigation bars. */
|
||||||
|
html.is-android {
|
||||||
|
--safe-top: max(env(safe-area-inset-top, 0px), 32px);
|
||||||
|
--safe-bottom: max(env(safe-area-inset-bottom, 0px), 28px);
|
||||||
|
}
|
||||||
|
|
||||||
|
html.is-ios {
|
||||||
|
--safe-top: env(safe-area-inset-top, 0px);
|
||||||
|
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
||||||
}
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
@@ -488,20 +502,20 @@ a {
|
|||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.scrollY {
|
.scrollY {
|
||||||
padding: 0.75rem 1rem;
|
padding: 0.75rem 1rem calc(0.75rem + var(--safe-bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
.scrollY.padded-top {
|
.scrollY.padded-top {
|
||||||
padding-top: 4.8rem;
|
padding-top: calc(4.8rem + var(--safe-top));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 700px) {
|
@media (max-width: 700px) {
|
||||||
.MuiDialog-container .MuiDialog-paper {
|
.MuiDialog-container .MuiDialog-paper {
|
||||||
margin: 1rem;
|
margin: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
|
||||||
width: calc(100% - 2rem) !important;
|
width: calc(100% - 2rem) !important;
|
||||||
max-width: calc(100% - 2rem) !important;
|
max-width: calc(100% - 2rem) !important;
|
||||||
max-height: calc(100% - 2rem);
|
max-height: calc(100% - 2rem - var(--safe-top) - var(--safe-bottom));
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
background-color: rgb(20 20 27) !important;
|
background-color: rgb(20 20 27) !important;
|
||||||
background-image: none !important;
|
background-image: none !important;
|
||||||
|
|||||||
Reference in new issue
Block a user