feat(player): restyle the floating media bar as liquid glass
Continuous Integration / build_web (push) Failing after 1s
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

- cover-tinted translucent surface with a specular rim, grain and glow
- centered transport dock and right-hand control capsule
- adaptive accent colour, glass cover treatment and shared artwork
  between the bar and the full player
This commit is contained in:
1xDed committed 2026-12-01 18:06:36 +03:00
1 parent 72909fd3b2
commit 94decd674c
7 files changed
+695 -451

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
const RETURN_KEY = "blink:audio-player-return";
/**
* The full player is a route, so reconstructing the exact page to return to
* keeps the SPA navigation (and its view transition) instead of using
* `history.back()`, which TanStack Router does not wrap in a view transition.
*/
export const rememberAudioPlayerReturn = () => {
sessionStorage.setItem(
RETURN_KEY,
`${window.location.pathname}${window.location.search}${window.location.hash}`,
);
};
export const consumeAudioPlayerReturn = () => {
const value = sessionStorage.getItem(RETURN_KEY);
sessionStorage.removeItem(RETURN_KEY);
return value;
};
+12 -1
View File
@@ -6,9 +6,15 @@ type Palette = {
base: string;
/** Darker end of the vertical gradient. */
deep: string;
/** Saturated cover hue used for glass highlights and controls. */
accent: string;
};
const FALLBACK: Palette = { base: "hsl(266 32% 22%)", deep: "hsl(266 40% 9%)" };
const FALLBACK: Palette = {
base: "hsl(266 32% 22%)",
deep: "hsl(266 40% 9%)",
accent: "hsl(337 96% 64%)",
};
const clamp = (value: number, min: number, max: number) =>
Math.min(max, Math.max(min, value));
@@ -77,6 +83,11 @@ export const getCoverPalette = (item?: BaseItemDto | null): Palette => {
return {
base: hsl(h, wallSaturation, wallLightness),
deep: hsl(h, wallSaturation, clamp(wallLightness * 0.45, 0.05, 0.12)),
accent: hsl(
h,
clamp(s + 0.4, 0.55, 0.9),
clamp(l + 0.28, 0.56, 0.7),
),
};
} catch {
return FALLBACK;
+29 -1
View File
@@ -3,4 +3,32 @@ import { ImageUrlsApi } from "@jellyfin/sdk/lib/utils/api/image-urls-api";
const getImageUrlsApi = (api: Api) => new ImageUrlsApi(api.configuration);
export default getImageUrlsApi;
type CoverItem = {
Id?: string | null;
AlbumId?: string | null;
ImageTags?: { Primary?: string | null } | null;
};
/**
* Shared cover URL for the floating bar and the full player, so the
* view-transition morph always blends the same artwork.
*/
export const getPlayerCoverUrl = (
api: Api | undefined,
item: CoverItem | null | undefined,
size = 600,
) => {
if (!api || !item?.Id) return undefined;
return getImageUrlsApi(api).getItemImageUrlById(
item.AlbumId ?? item.Id,
"Primary",
{
quality: 90,
fillHeight: size,
fillWidth: size,
...(item.AlbumId ? {} : { tag: item.ImageTags?.Primary ?? undefined }),
},
);
};
export default getImageUrlsApi;