Make the jukebox the home page, add seeking and redesign the site
Seeking: the progress bar is now a slider. Releasing it calls POST /api/player/seek, which restarts ffmpeg at that position and swaps the audio resource without going through Idle, so the track is neither finished nor requeued in loop mode. Structure: the jukebox is served at / and the old home page is gone. /jukebox/ redirects to / with its query string, and the Discord login callback now returns to /. Redesign: a login screen until the visitor is signed in, then an app layout with a top bar, the library on the left and the player and queue on the right (sticky, two columns from 1000 px). Small screens get a mini player while the main one is out of view. Icon buttons, a single play/pause button, a drop zone for uploads, toast messages and a refined violet palette with checked contrast. A refused password now returns to the login screen instead of leaving an empty page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d14cc414b5
commit
25f22dd363
13 changed files with 1615 additions and 1051 deletions
|
|
@ -64,7 +64,8 @@ export function createStatusManager(statusElement) {
|
|||
function setStatus(message, type = "info", autoHide = true) {
|
||||
if (!statusElement) return;
|
||||
statusElement.textContent = message;
|
||||
statusElement.className = `status status--${type}`;
|
||||
// Le type (info, success, error) passe par un attribut : la classe reste celle de la page.
|
||||
statusElement.dataset.type = type;
|
||||
statusElement.hidden = false;
|
||||
|
||||
if (autoHide) {
|
||||
|
|
@ -118,10 +119,21 @@ export function formatDuration(seconds) {
|
|||
// Date courte en français, sans les secondes : « 2 déc. 2026, 11:24 ».
|
||||
const DATE_FORMAT = new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium", timeStyle: "short" });
|
||||
|
||||
export function formatDate(value) {
|
||||
// Date seule : « 2 déc. 2026 ».
|
||||
const DAY_FORMAT = new Intl.DateTimeFormat("fr-FR", { dateStyle: "medium" });
|
||||
|
||||
function formatWith(format, value) {
|
||||
if (!value) return "?";
|
||||
const date = new Date(value);
|
||||
return Number.isNaN(date.getTime()) ? String(value) : DATE_FORMAT.format(date);
|
||||
return Number.isNaN(date.getTime()) ? String(value) : format.format(date);
|
||||
}
|
||||
|
||||
export function formatDate(value) {
|
||||
return formatWith(DATE_FORMAT, value);
|
||||
}
|
||||
|
||||
export function formatDay(value) {
|
||||
return formatWith(DAY_FORMAT, value);
|
||||
}
|
||||
|
||||
export function createApiClient({ getApiKey, basePath = "" } = {}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue