Galerie Live
-
Les photos sont envoyees en temps reel sur un site web. Les invites scannent le QR code sur l'ecran d'accueil.
+
Photos envoyees en temps reel. QR code + code sur l'ecran d'accueil.
-
+ Galerie live active
URL du serveur
Cle API
ID evenement
-
+
Code invites : --
-
+
-
-
-
+
Galerie locale
- Photos prises : 0
- Exports : 0
+ Photos prises : 0 | Exports : 0
URL galerie en ligne
@@ -400,10 +467,9 @@
-
-
-
+
Systeme
+
diff --git a/frontend/js/app.js b/frontend/js/app.js
index bae7863..afd18e4 100644
--- a/frontend/js/app.js
+++ b/frontend/js/app.js
@@ -152,11 +152,11 @@ function validerMdpAdmin() {
const input = document.getElementById('input-mdp-admin');
if (input.value === MDP_ADMIN) {
fermerPopupMdp();
- allerA('admin');
+ allerA('wizard');
+ wizardInit();
} else {
document.getElementById('mdp-erreur').classList.remove('cache');
input.value = '';
- input.focus();
}
}
@@ -252,5 +252,121 @@ wsOnMessage('config_maj', (msg) => {
appliquerConfig();
});
+// === WIZARD ===
+
+let wizardStep = 1;
+const WIZARD_TOTAL = 6;
+let wizardData = {
+ nom: '',
+ theme: 'base',
+ modes: { simple: true, multi: true },
+ nbPhotos: 4,
+ fonctions: {},
+};
+
+function wizardInit() {
+ wizardStep = 1;
+ wizardData.nom = config.evenement?.nom || '';
+ wizardData.theme = config.evenement?.theme || 'base';
+ wizardData.nbPhotos = config.multi_shot?.nombre_photos || 4;
+ document.getElementById('wiz-nom').value = wizardData.nom;
+ document.getElementById('wiz-nb-photos').textContent = wizardData.nbPhotos;
+ wizardAfficherStep();
+}
+
+function wizardAfficherStep() {
+ document.querySelectorAll('.wizard-step').forEach(s => s.classList.remove('actif'));
+ const step = document.querySelector(`.wizard-step[data-step="${wizardStep}"]`);
+ if (step) step.classList.add('actif');
+
+ // Progress dots
+ const prog = document.getElementById('wizard-progress');
+ prog.innerHTML = '';
+ for (let i = 1; i <= WIZARD_TOTAL; i++) {
+ const dot = document.createElement('div');
+ dot.className = 'wizard-dot' + (i === wizardStep ? ' actif' : '') + (i < wizardStep ? ' fait' : '');
+ prog.appendChild(dot);
+ }
+}
+
+function wizardSuivant() {
+ // Sauvegarder l'etape courante
+ if (wizardStep === 1) wizardData.nom = document.getElementById('wiz-nom').value;
+ if (wizardStep === 4) wizardData.nbPhotos = parseInt(document.getElementById('wiz-nb-photos').textContent);
+
+ wizardStep++;
+ if (wizardStep > WIZARD_TOTAL) wizardStep = WIZARD_TOTAL;
+
+ // Resume
+ if (wizardStep === WIZARD_TOTAL) {
+ const modes = Object.keys(wizardData.modes).filter(k => wizardData.modes[k]);
+ const foncs = Object.keys(wizardData.fonctions).filter(k => wizardData.fonctions[k]);
+ document.getElementById('wiz-resume').innerHTML = `
+
Evenement : ${wizardData.nom || 'Photobooth'}
+
Theme : ${wizardData.theme}
+
Modes : ${modes.join(', ') || 'photo'}
+
Photos/pellicule : ${wizardData.nbPhotos}
+
Partage : ${foncs.join(', ') || 'aucun'}
+ `;
+ }
+
+ wizardAfficherStep();
+}
+
+function wizardChoisir(btn, key) {
+ btn.closest('.wizard-choix').querySelectorAll('.wizard-card').forEach(c => c.classList.remove('actif'));
+ btn.classList.add('actif');
+ wizardData[key] = btn.dataset.val;
+}
+
+function wizardToggle(btn) {
+ btn.classList.toggle('actif');
+ const val = btn.dataset.val;
+ const isActive = btn.classList.contains('actif');
+
+ if (['simple', 'multi'].includes(val)) {
+ wizardData.modes[val] = isActive;
+ } else {
+ wizardData.fonctions[val] = isActive;
+ }
+}
+
+function wizardNbPhotos(delta) {
+ const el = document.getElementById('wiz-nb-photos');
+ let n = parseInt(el.textContent) + delta;
+ n = Math.max(2, Math.min(8, n));
+ el.textContent = n;
+ wizardData.nbPhotos = n;
+}
+
+async function wizardTerminer() {
+ // Sauvegarder toute la config
+ await apiPost('/api/config', {
+ evenement: {
+ nom: wizardData.nom || 'Photobooth',
+ theme: wizardData.theme,
+ },
+ fonctionnalites: {
+ photo_simple: wizardData.modes.simple !== false,
+ multi_shot: wizardData.modes.multi !== false,
+ impression: !!wizardData.fonctions.impression,
+ email: !!wizardData.fonctions.email,
+ qr_code: !!wizardData.fonctions.qr,
+ },
+ multi_shot: {
+ nombre_photos: wizardData.nbPhotos,
+ mode: 'strip',
+ },
+ booth: {
+ actif: !!wizardData.fonctions.galerie_live,
+ },
+ });
+
+ config = await apiGet('/api/config');
+ appliquerConfig();
+ chargerBoothInfo();
+ allerA('accueil');
+}
+
// Demarrage
document.addEventListener('DOMContentLoaded', init);