- Follow the queue live through /api/events (read with fetch so the key can be sent), reconnect with backoff and reload the state meanwhile; an indicator shows whether the page is live. - Log in with Discord when enabled, the password stays available as a fallback; explain failed logins and expired sessions. - Show a progress bar and durations, the queue length and total time, and a hint when the queue waits for listeners. - Shuffle and loop buttons; search, rename and add the whole library, optionally shuffled. - Upload several files at once with per-file progress (XMLHttpRequest), add a direct link, drag and drop files; allow 40 uploads per 15 minutes. - Style password, URL and search fields, focus rings, and the phone layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
250 lines
9.6 KiB
HTML
250 lines
9.6 KiB
HTML
<!doctype html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>Palico Jukebox</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="theme-color" content="#140b24" />
|
|
<link rel="icon" type="image/png" href="/img/favicon.png" />
|
|
<link rel="apple-touch-icon" href="/img/apple-touch-icon.png" />
|
|
<link rel="stylesheet" href="/style/styles.css" />
|
|
</head>
|
|
<body>
|
|
<div class="hero">
|
|
<div class="hero__visual">
|
|
<img src="/img/palico-jukebox.webp" alt="Palico Jukebox" width="400" height="857" />
|
|
</div>
|
|
<div class="hero__content">
|
|
<p class="pill">Le Jukebox du Palico Bot</p>
|
|
<h1>Un peu de son pour le Discord !</h1>
|
|
<p>
|
|
Tu veux chill avec les autres sur un petit fond musical ?<br />
|
|
T'inquiète pas, je peux m'occuper de ça !<br />
|
|
<br />
|
|
Ajoute des morceaux et gère la playlist depuis cette page, ou avec
|
|
<code>/play</code> sur Discord. Tout est synchronisé avec le salon vocal.
|
|
</p>
|
|
<div class="hero__actions">
|
|
<button id="heroUploadBtn" class="btn" type="button">Ajouter une musique</button>
|
|
<button id="heroQueueBtn" class="btn btn--ghost" type="button">Voir la file</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="hero__auth">
|
|
<div class="panel panel--glass">
|
|
<h2>Connexion</h2>
|
|
|
|
<div id="loggedIn" hidden>
|
|
<p class="panel__subtitle">
|
|
Connecté en tant que <strong id="userName"></strong>.
|
|
</p>
|
|
<button id="logoutBtn" class="btn btn--ghost btn--small" type="button">
|
|
Se déconnecter
|
|
</button>
|
|
</div>
|
|
|
|
<div id="discordLogin" hidden>
|
|
<p class="panel__subtitle">Réservé aux membres du serveur Discord.</p>
|
|
<a class="btn btn--discord" href="/auth/discord">Se connecter avec Discord</a>
|
|
</div>
|
|
|
|
<details id="keyLogin" class="key-login">
|
|
<summary id="keyLoginSummary">Utiliser le mot de passe</summary>
|
|
<p class="panel__subtitle">
|
|
Sans « Se souvenir de moi », le mot de passe est oublié à la
|
|
fermeture de l'onglet.
|
|
</p>
|
|
<form id="settingsForm">
|
|
<div class="grid grid--two">
|
|
<div>
|
|
<label for="displayName">Nom affiché</label>
|
|
<input
|
|
type="text"
|
|
id="displayName"
|
|
name="displayName"
|
|
placeholder="Shinuwa"
|
|
autocomplete="nickname"
|
|
maxlength="80"
|
|
/>
|
|
</div>
|
|
<div>
|
|
<label for="apiKey">Mot de passe</label>
|
|
<input
|
|
type="password"
|
|
id="apiKey"
|
|
name="apiKey"
|
|
placeholder="Mot de passe"
|
|
autocomplete="current-password"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<label class="form-checkbox u-mt-1">
|
|
<input type="checkbox" id="rememberKey" class="form-checkbox__input" />
|
|
<span>Se souvenir de moi sur cet appareil</span>
|
|
</label>
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn">Sauvegarder</button>
|
|
</div>
|
|
</form>
|
|
</details>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<main>
|
|
<div id="status" class="status status--info" role="status" aria-live="polite" hidden></div>
|
|
|
|
<section class="panel panel--glass" aria-labelledby="playerTitle">
|
|
<div class="panel__header">
|
|
<div>
|
|
<h2 id="playerTitle">Lecture en cours</h2>
|
|
<p class="panel__subtitle">État du player Discord, mis à jour en direct.</p>
|
|
</div>
|
|
<span id="liveIndicator" class="live-indicator" data-live="false">Hors ligne</span>
|
|
</div>
|
|
<div id="currentTrack" class="player-current player-current--empty">
|
|
En attente de lecture...
|
|
</div>
|
|
<div class="progress" id="progress" hidden>
|
|
<div
|
|
class="progress__track"
|
|
role="progressbar"
|
|
aria-label="Progression du morceau"
|
|
aria-valuemin="0"
|
|
aria-valuemax="100"
|
|
aria-valuenow="0"
|
|
id="progressTrack"
|
|
>
|
|
<div class="progress__bar" id="progressBar"></div>
|
|
</div>
|
|
<div class="progress__times">
|
|
<span id="progressElapsed">0:00</span>
|
|
<span id="progressTotal"></span>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<button class="btn" type="button" data-player-action="play" title="Lance la file si elle est en attente">
|
|
Play
|
|
</button>
|
|
<button id="pauseResumeBtn" class="btn btn--secondary" type="button" data-player-action="pause">
|
|
Pause
|
|
</button>
|
|
<button class="btn" type="button" data-player-action="skip">Suivante</button>
|
|
<button class="btn btn--secondary" type="button" data-player-action="shuffle">Mélanger</button>
|
|
<button id="loopBtn" class="btn btn--secondary" type="button" aria-pressed="false">
|
|
Boucle : non
|
|
</button>
|
|
<button class="btn btn--danger" type="button" data-player-action="stop">
|
|
Stop & vider la file
|
|
</button>
|
|
</div>
|
|
</section>
|
|
|
|
<section class="panel panel--glass" id="queueSection" aria-labelledby="queueTitle">
|
|
<div class="panel__header">
|
|
<div>
|
|
<h2 id="queueTitle">File d'attente</h2>
|
|
<p class="panel__subtitle">
|
|
Réorganise les morceaux, supprime-les ou ajoute ceux de la
|
|
bibliothèque.
|
|
</p>
|
|
</div>
|
|
<span id="queueSummary" class="badge" hidden></span>
|
|
</div>
|
|
<ul id="queueList" class="list list--stack"></ul>
|
|
<p id="queueEmpty" class="text--muted">Aucun morceau en attente.</p>
|
|
</section>
|
|
|
|
<section class="panel panel--glass" aria-labelledby="libraryTitle">
|
|
<div class="panel__header">
|
|
<div>
|
|
<h2 id="libraryTitle">Bibliothèque permanente</h2>
|
|
<p class="panel__subtitle">
|
|
Les fichiers conservés sont listés ici. Ajoute-les à la file,
|
|
renomme-les ou supprime-les.
|
|
</p>
|
|
</div>
|
|
<div class="toolbar">
|
|
<button id="enqueueAllBtn" class="btn btn--secondary btn--small" type="button">Tout ajouter</button>
|
|
<button id="enqueueAllShuffledBtn" class="btn btn--secondary btn--small" type="button">
|
|
Tout ajouter, mélangé
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<label for="librarySearch" class="visually-hidden">Rechercher dans la bibliothèque</label>
|
|
<input
|
|
type="search"
|
|
id="librarySearch"
|
|
placeholder="Rechercher un morceau…"
|
|
autocomplete="off"
|
|
/>
|
|
<ul id="libraryList" class="list list--stack u-mt-1"></ul>
|
|
<p id="libraryEmpty" class="text--muted">Aucun fichier permanent enregistré.</p>
|
|
</section>
|
|
|
|
<section class="panel panel--glass" id="uploadSection" aria-labelledby="uploadTitle">
|
|
<div class="panel__header">
|
|
<div>
|
|
<h2 id="uploadTitle">Ajouter de la musique</h2>
|
|
<p class="panel__subtitle">
|
|
Fichiers audio (150 Mo au plus chacun) ou lien direct vers un
|
|
fichier. Les morceaux temporaires sont supprimés après lecture.
|
|
</p>
|
|
</div>
|
|
<div class="badge">Glisser-déposer accepté</div>
|
|
</div>
|
|
|
|
<div class="grid grid--two">
|
|
<label class="form-checkbox">
|
|
<input type="checkbox" id="permanentFile" class="form-checkbox__input" />
|
|
<span>Conserver dans la bibliothèque après lecture</span>
|
|
</label>
|
|
<label class="form-checkbox">
|
|
<input type="checkbox" id="enqueueFile" checked class="form-checkbox__input" />
|
|
<span>Ajouter directement à la file d'attente</span>
|
|
</label>
|
|
</div>
|
|
|
|
<form id="uploadForm" class="u-mt-1">
|
|
<label for="musicFile">Fichiers audio</label>
|
|
<input type="file" id="musicFile" name="musicFile" accept="audio/*,video/*" multiple required />
|
|
|
|
<label for="uploadNotes" class="u-mt-1">Titre (optionnel, pour un seul fichier)</label>
|
|
<input
|
|
type="text"
|
|
id="uploadNotes"
|
|
name="notes"
|
|
maxlength="200"
|
|
placeholder="Par défaut : les tags du fichier, sinon son nom"
|
|
/>
|
|
|
|
<button type="submit" class="btn u-mt-1">Envoyer</button>
|
|
</form>
|
|
|
|
<ul id="uploadList" class="list upload-list" aria-live="polite"></ul>
|
|
|
|
<form id="urlForm" class="u-mt-1 url-form">
|
|
<label for="musicUrl">Lien direct vers un fichier audio</label>
|
|
<div class="url-form__row">
|
|
<input
|
|
type="url"
|
|
id="musicUrl"
|
|
name="url"
|
|
required
|
|
maxlength="2000"
|
|
placeholder="https://exemple.com/morceau.mp3"
|
|
/>
|
|
<button type="submit" class="btn">Ajouter</button>
|
|
</div>
|
|
<p class="hint">YouTube et Spotify ne sont pas pris en charge.</p>
|
|
</form>
|
|
</section>
|
|
</main>
|
|
|
|
<div class="hero__actions hero__actions--centered">
|
|
<a class="btn btn--ghost btn--small" href="/">Retour à l'accueil</a>
|
|
</div>
|
|
|
|
<script type="module" src="/scripts/jukebox.js"></script>
|
|
</body>
|
|
</html>
|