Sections: - The library can be split into named, ordered sections, stored in storage/runtime/sections.json; each track keeps its sectionId. - Sections are created, renamed, reordered and deleted from the page (/api/library/sections). Deleting one keeps its tracks, without a section. - A section, or the tracks without one, can be queued in one go, shuffled or not (enqueue-all takes a sectionId). - The upload form (file or link) picks the section of a kept track. - Without any section, the library stays a plain list. Covers: - A kept track takes the cover embedded in its file (MP3, FLAC...), from the web page or /play garder:. Older tracks are looked at once on startup; a track without one keeps cover: null. - "Renommer" becomes "Modifier": a dialog to change the title, the section and the cover (upload with preview, or removal). - ffmpeg turns covers into JPEGs of at most 512 px, stored in storage/covers and deleted with their track. An uploaded image is only passed to ffmpeg after its signature is checked (PNG, JPEG, WebP, GIF), with that decoder forced, so ffmpeg never guesses the format of an unknown file. - Covers are served under /covers without authentication, since an <img> cannot send the key; their random names are only given by the API and never change content (one-year cache). - The current track and the queue show the cover of their library track. Docs: README lists the new data to back up; storage/covers is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
293 lines
12 KiB
HTML
293 lines
12 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">
|
|
<svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false">
|
|
<path
|
|
fill="currentColor"
|
|
d="M18.59 5.89a15.6 15.6 0 0 0-3.92-1.23c-.17.3-.37.71-.5 1.04a14.5 14.5 0 0 0-4.34 0 10.6 10.6 0 0 0-.51-1.04c-1.38.24-2.69.66-3.92 1.23-2.48 3.74-3.15 7.39-2.82 10.98a15.7 15.7 0 0 0 4.81 2.46c.39-.53.73-1.1 1.03-1.69a10 10 0 0 1-1.62-.79l.4-.31c3.13 1.46 6.52 1.46 9.61 0l.4.31c-.51.31-1.06.57-1.62.79.3.59.64 1.16 1.03 1.69a15.6 15.6 0 0 0 4.81-2.46c.39-4.17-.67-7.78-2.82-10.98ZM8.84 14.67c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94 1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94Zm6.31 0c-.94 0-1.71-.87-1.71-1.94s.75-1.94 1.71-1.94 1.72.87 1.71 1.94c0 1.06-.75 1.94-1.71 1.94Z"
|
|
/>
|
|
</svg>
|
|
<span>Se connecter avec Discord</span>
|
|
</a>
|
|
</div>
|
|
|
|
<details id="keyLogin" class="key-login" hidden>
|
|
<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. Range-les en sections,
|
|
donne-leur une pochette, ajoute-les à la file.
|
|
</p>
|
|
</div>
|
|
<div class="toolbar">
|
|
<button id="newSectionBtn" class="btn btn--secondary btn--small" type="button">Nouvelle section</button>
|
|
<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"
|
|
/>
|
|
<div id="libraryList" class="library"></div>
|
|
<p id="libraryEmpty" class="text--muted">Aucun fichier permanent enregistré.</p>
|
|
</section>
|
|
|
|
<dialog id="trackDialog" class="dialog" aria-labelledby="trackDialogTitle">
|
|
<form id="trackForm">
|
|
<h2 id="trackDialogTitle">Modifier le morceau</h2>
|
|
|
|
<div class="track-editor">
|
|
<div id="trackCoverPreview" class="cover cover--large cover--empty" aria-hidden="true"></div>
|
|
<div class="track-editor__cover-fields">
|
|
<label for="trackCoverInput">Pochette</label>
|
|
<input type="file" id="trackCoverInput" accept="image/png,image/jpeg,image/webp,image/gif" />
|
|
<p class="hint">PNG, JPEG, WebP ou GIF, 10 Mo au plus. Recadrée à 512 px.</p>
|
|
<button id="trackCoverRemoveBtn" class="btn btn--ghost btn--small u-mt-1" type="button">
|
|
Retirer la pochette
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<label for="trackTitleInput" class="u-mt-1">Titre</label>
|
|
<input type="text" id="trackTitleInput" maxlength="200" required />
|
|
|
|
<label for="trackSectionSelect" class="u-mt-1">Section</label>
|
|
<select id="trackSectionSelect"></select>
|
|
|
|
<div class="form-actions toolbar">
|
|
<button id="trackCancelBtn" class="btn btn--ghost" type="button">Annuler</button>
|
|
<button id="trackSaveBtn" class="btn" type="submit">Enregistrer</button>
|
|
</div>
|
|
</form>
|
|
</dialog>
|
|
|
|
<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>
|
|
|
|
<div id="uploadSectionField" class="u-mt-1" hidden>
|
|
<label for="uploadSectionSelect">Section de la bibliothèque</label>
|
|
<select id="uploadSectionSelect"></select>
|
|
</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>
|