A review of the phone experience (the issue) found a desktop page made smaller. What changes: feat: - The player bar is one row on a phone (cover, title, play and next, a thin line of progress) and is not there while nothing plays. A tap or a swipe up on it opens the full-screen player. - The Back gesture closes the full-screen player instead of leaving the page under it; a swipe down closes it too. The full queue is listed on a phone. - The queue is kept in the browser: a reload, or a tab that Android throws away, comes back paused on the same song at the same second. It belongs to the person signed in and is forgotten on sign-out. - Tabs have icons; the page starts at its top on a new route and back goes to where the list was; a swipe on the page no longer reloads it. fix: - The player now knows when the system pauses the audio (another app, a headset), so the button and the lock screen no longer say it plays. - The lock screen has a working seek bar and the right play/pause state. - The player bar was not hidden by max-sm:hidden: its grid rules were outside the Tailwind layers and won. They are in the components layer now. - Song rows give the title the room on a phone (no number column). - The album header is centred and the greeting is smaller on a phone; recent songs on Home show the artist. - Thumbnails ask for the small cover (300 px) and not the 1000 px one. - Pages use dvh, the viewport covers the notch, and the tabs keep clear of the gesture bar; the update notice no longer sits on the bar. - No grey tap flash, no double-tap delay, no image menu on a long press.
156 lines
4.8 KiB
CSS
156 lines
4.8 KiB
CSS
@import "tailwindcss";
|
|
@import "tw-animate-css";
|
|
@import "shadcn/tailwind.css";
|
|
@import "@fontsource/figtree/400.css";
|
|
@import "@fontsource/figtree/500.css";
|
|
@import "@fontsource/figtree/600.css";
|
|
@import "@fontsource/figtree/700.css";
|
|
@import "@fontsource/figtree/800.css";
|
|
@import "./theme/themes.css";
|
|
|
|
/* The dark variant follows the theme, not the OS setting. */
|
|
@custom-variant dark (&:is([data-theme="sonda"] *, [data-theme="tokyo-night"] *, [data-theme="gruvbox-dark"] *, [data-theme="dracula"] *, [data-theme="neon"] *));
|
|
|
|
@theme inline {
|
|
--font-heading: var(--font-sans);
|
|
--font-sans: 'Figtree', system-ui, sans-serif;
|
|
--color-ring: var(--ring);
|
|
--color-input: var(--input);
|
|
--color-border: var(--border);
|
|
--color-destructive: var(--destructive);
|
|
--color-friend-foreground: var(--friend-foreground);
|
|
--color-friend: var(--friend);
|
|
--color-accent-foreground: var(--accent-foreground);
|
|
--color-accent: var(--accent);
|
|
--color-muted-foreground: var(--muted-foreground);
|
|
--color-muted: var(--muted);
|
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
--color-secondary: var(--secondary);
|
|
--color-primary-foreground: var(--primary-foreground);
|
|
--color-primary: var(--primary);
|
|
--color-popover-foreground: var(--popover-foreground);
|
|
--color-popover: var(--popover);
|
|
--color-card-foreground: var(--card-foreground);
|
|
--color-card: var(--card);
|
|
--color-foreground: var(--foreground);
|
|
--color-background: var(--background);
|
|
--radius-sm: calc(var(--radius) * 0.6);
|
|
--radius-md: calc(var(--radius) * 0.8);
|
|
--radius-lg: var(--radius);
|
|
--radius-xl: calc(var(--radius) * 1.4);
|
|
--radius-2xl: calc(var(--radius) * 1.8);
|
|
--radius-3xl: calc(var(--radius) * 2.2);
|
|
--radius-4xl: calc(var(--radius) * 2.6);
|
|
}
|
|
|
|
:root {
|
|
--radius: 0.125rem;
|
|
}
|
|
|
|
@layer base {
|
|
* {
|
|
@apply border-border outline-ring/50;
|
|
}
|
|
/* A line of reading stays readable on a wide screen, and no line ends on a lone word. */
|
|
p {
|
|
max-width: 56ch;
|
|
text-wrap: pretty;
|
|
}
|
|
h1,
|
|
h2,
|
|
h3 {
|
|
text-wrap: balance;
|
|
}
|
|
body {
|
|
@apply bg-background text-foreground;
|
|
}
|
|
html {
|
|
@apply font-sans;
|
|
/* Pulling the page down at its top must not reload it, and a song is not lost to a stray swipe. */
|
|
overscroll-behavior-y: contain;
|
|
}
|
|
/* A finger: no grey flash on a tap, no wait for a double tap, and a tap on a control never selects text. */
|
|
a,
|
|
button,
|
|
label,
|
|
summary,
|
|
select,
|
|
[role='button'],
|
|
[role='tab'] {
|
|
touch-action: manipulation;
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
nav a,
|
|
nav button,
|
|
footer button,
|
|
[role='button'] {
|
|
user-select: none;
|
|
-webkit-touch-callout: none;
|
|
}
|
|
}
|
|
|
|
/*
|
|
* The player bar. On a phone it is one row, so that it leaves the page its room: what is playing, play and next, and a
|
|
* thin line of progress along its top edge (the rest is in the full-screen player, which the cover and the title open;
|
|
* the phone has its own volume). While nothing plays it is not there. From 640px up the words are on the left, the
|
|
* controls and the position in the middle, the extras on the right.
|
|
*/
|
|
@layer components {
|
|
.player-bar {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
grid-template-areas: 'info controls';
|
|
align-items: center;
|
|
}
|
|
.player-info { grid-area: info; }
|
|
.player-controls { grid-area: controls; }
|
|
.player-seek { grid-area: seek; }
|
|
.player-extras { grid-area: extras; }
|
|
@media (min-width: 640px) {
|
|
.player-bar {
|
|
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
|
|
grid-template-areas: 'info controls extras' 'info seek extras';
|
|
}
|
|
}
|
|
}
|
|
|
|
/* A card that is a link answers the pointer: it lifts a little and its picture grows inside its frame. */
|
|
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
|
|
.lift { transition: transform 150ms ease-out; }
|
|
.lift:hover { transform: translateY(-2px); }
|
|
.lift img { transition: transform 200ms ease-out; }
|
|
.lift:hover img { transform: scale(1.03); }
|
|
}
|
|
|
|
/* The volume slider has square corners like the rest: a thin track filled up to the knob, and a bar for a knob. The
|
|
browser's own slider is round, and no setting makes it square. */
|
|
.slider {
|
|
appearance: none;
|
|
background: transparent;
|
|
}
|
|
.slider::-webkit-slider-runnable-track {
|
|
height: 4px;
|
|
background: linear-gradient(to right, var(--primary) var(--fill), var(--input) var(--fill));
|
|
}
|
|
.slider::-webkit-slider-thumb {
|
|
appearance: none;
|
|
width: 8px;
|
|
height: 18px;
|
|
margin-top: -7px;
|
|
background: var(--primary);
|
|
}
|
|
.slider::-moz-range-track {
|
|
height: 4px;
|
|
background: var(--input);
|
|
}
|
|
.slider::-moz-range-progress {
|
|
height: 4px;
|
|
background: var(--primary);
|
|
}
|
|
.slider::-moz-range-thumb {
|
|
width: 8px;
|
|
height: 18px;
|
|
border: 0;
|
|
border-radius: 0;
|
|
background: var(--primary);
|
|
}
|