Headers: - Every JavaScript file (sources, front, scripts, tests) starts with a /** @file … */ header, in the three levels used by sokko-g: a short description for simple files; Utilisé par / Attention / @see for shared modules; a full header (context, entry points, callers, dependencies, pitfalls) for index.js, the music queue, the web server, the storage manager and the jukebox page script. - No @author, @version or @since: git already knows. - test/fileHeaders.test.js fails `npm run check` when a header is missing or a central file's header is incomplete. Stylesheet (no visual change, checked by comparing every element's computed styles in Chromium at 1280, 800 and 400 px, hover included): - Role header and section comments. - Transparent shades derive from the colour variables with color-mix() instead of copied rgba() values; new tokens for repeated values (text, text on accent, accent gradient, white veils, shadow). - Native nesting for buttons, the live indicator, upload rows and home cards; drop the unused .hero__visual--large and redundant rules. - Utility classes move to the end so they win over components. The library list's u-mt-1, which never applied (.list reset it), is removed to keep the layout as it was. Docs: CONTRIBUTING.md describes the language, header and stylesheet conventions; CLAUDE.md points to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
258 lines
10 KiB
HTML
258 lines
10 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. 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"></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>
|