diff --git a/public/img/apple-touch-icon.png b/public/img/apple-touch-icon.png new file mode 100644 index 0000000..ca6ea21 Binary files /dev/null and b/public/img/apple-touch-icon.png differ diff --git a/public/img/favicon.png b/public/img/favicon.png new file mode 100644 index 0000000..f5db864 Binary files /dev/null and b/public/img/favicon.png differ diff --git a/public/img/palico-index.png b/public/img/palico-index.png deleted file mode 100644 index dc389a7..0000000 Binary files a/public/img/palico-index.png and /dev/null differ diff --git a/public/img/palico-index.webp b/public/img/palico-index.webp new file mode 100644 index 0000000..567eabc Binary files /dev/null and b/public/img/palico-index.webp differ diff --git a/public/img/palico-jukebox.png b/public/img/palico-jukebox.png deleted file mode 100644 index 3196cab..0000000 Binary files a/public/img/palico-jukebox.png and /dev/null differ diff --git a/public/img/palico-jukebox.webp b/public/img/palico-jukebox.webp new file mode 100644 index 0000000..6451a0f Binary files /dev/null and b/public/img/palico-jukebox.webp differ diff --git a/public/index.html b/public/index.html index 9739f4c..7d47b6b 100644 --- a/public/index.html +++ b/public/index.html @@ -4,12 +4,16 @@ Palico Bot + + + +
- Palico Bot + Palico Bot
diff --git a/public/jukebox.html b/public/jukebox.html index b7990d7..c892c74 100644 --- a/public/jukebox.html +++ b/public/jukebox.html @@ -4,19 +4,22 @@ Palico Jukebox + + +
- Palico Jukebox + Palico Jukebox

Le Jukebox du Palico Bot

Un peu de son pour le Discord !

Tu veux chill avec les autres sur un petit fond musical ?
- T'inquietes pas, je peux m'occuper de ca !
+ T'inquiète pas, je peux m'occuper de ça !

Uploade des fichiers et gère la playlist depuis cette interface web. Tout est synchronisé avec le salon vocal. @@ -31,7 +34,8 @@

Authentification

- La clé reste dans cet onglet jusqu'à sa fermeture. + Sans « Se souvenir de moi », le mot de passe est oublié à la + fermeture de l'onglet.

@@ -56,6 +60,10 @@ />
+
@@ -65,7 +73,7 @@
- +
diff --git a/public/scripts/common.js b/public/scripts/common.js index bf328bb..0d1f823 100644 --- a/public/scripts/common.js +++ b/public/scripts/common.js @@ -1,20 +1,52 @@ const API_KEY_STORAGE_KEY = "palico-api-key"; const DISPLAY_NAME_STORAGE_KEY = "palico-display-name"; -export function getStoredApiKey() { - return sessionStorage.getItem(API_KEY_STORAGE_KEY) || ""; +// Le stockage peut être indisponible (navigation privée, cookies bloqués) : la page doit +// fonctionner quand même, simplement sans mémoire. +function storageGet(storage, key) { + try { + return storage.getItem(key); + } catch { + return null; + } } -export function setStoredApiKey(value) { - sessionStorage.setItem(API_KEY_STORAGE_KEY, value || ""); +function storageSet(storage, key, value) { + try { + if (value) { + storage.setItem(key, value); + } else { + storage.removeItem(key); + } + } catch { + // Stockage indisponible. + } +} + +export function getStoredApiKey() { + return ( + storageGet(sessionStorage, API_KEY_STORAGE_KEY) || + storageGet(localStorage, API_KEY_STORAGE_KEY) || + "" + ); +} + +export function isApiKeyRemembered() { + return Boolean(storageGet(localStorage, API_KEY_STORAGE_KEY)); +} + +// remember : garde la clé sur l'appareil (localStorage) au lieu de l'onglet (sessionStorage). +export function setStoredApiKey(value, { remember = false } = {}) { + storageSet(remember ? localStorage : sessionStorage, API_KEY_STORAGE_KEY, value); + storageSet(remember ? sessionStorage : localStorage, API_KEY_STORAGE_KEY, ""); } export function getStoredDisplayName() { - return localStorage.getItem(DISPLAY_NAME_STORAGE_KEY) || ""; + return storageGet(localStorage, DISPLAY_NAME_STORAGE_KEY) || ""; } export function setStoredDisplayName(value) { - localStorage.setItem(DISPLAY_NAME_STORAGE_KEY, value || ""); + storageSet(localStorage, DISPLAY_NAME_STORAGE_KEY, value); } export function createStatusManager(statusElement) { diff --git a/public/scripts/jukebox.js b/public/scripts/jukebox.js index ed9f8c9..447a3e4 100644 --- a/public/scripts/jukebox.js +++ b/public/scripts/jukebox.js @@ -5,6 +5,7 @@ import { getStoredApiKey, getStoredDisplayName, formatBytes, + isApiKeyRemembered, formatDate, setStoredApiKey, setStoredDisplayName, @@ -22,6 +23,7 @@ const state = { const elements = { status: document.getElementById("status"), apiKeyInput: document.getElementById("apiKey"), + rememberKeyCheckbox: document.getElementById("rememberKey"), displayNameInput: document.getElementById("displayName"), settingsForm: document.getElementById("settingsForm"), uploadForm: document.getElementById("uploadForm"), @@ -171,8 +173,8 @@ function renderQueue() {
- - + +
`; @@ -312,7 +314,9 @@ function bindEvents() { event.preventDefault(); state.apiKey = elements.apiKeyInput.value.trim(); state.displayName = elements.displayNameInput.value.trim(); - setStoredApiKey(state.apiKey); + setStoredApiKey(state.apiKey, { + remember: elements.rememberKeyCheckbox?.checked, + }); setStoredDisplayName(state.displayName); setStatus("Paramètres sauvegardés", "success"); refreshAll({ silent: true }); @@ -403,6 +407,9 @@ function bindEvents() { function initialize() { elements.apiKeyInput.value = state.apiKey; elements.displayNameInput.value = state.displayName; + if (elements.rememberKeyCheckbox) { + elements.rememberKeyCheckbox.checked = isApiKeyRemembered(); + } bindEvents(); updatePauseResumeButton(); refreshAll(); diff --git a/public/style/styles.css b/public/style/styles.css index 7324d20..71cf1d9 100644 --- a/public/style/styles.css +++ b/public/style/styles.css @@ -109,6 +109,7 @@ p { .hero__visual img { max-width: 200px; width: 100%; + height: auto; filter: drop-shadow(0 25px 45px rgba(0, 0, 0, 0.45)); }