From 040724455495aa83a47986684c77f4e3141aef6a Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 27 Jun 2026 14:14:28 +0200 Subject: [PATCH] QR code par photo : popup QR dynamique + page vue photo sur booth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - afficherQR() génère un QR vers /g/{event}/view/{photo}?p= - Page photo-view.html : plein écran + bouton télécharger + galerie - QR accueil reste la galerie complète, QR après capture = la photo Co-Authored-By: Claude Opus 4.6 --- frontend/css/style.css | 21 +++++++++++++++++++++ frontend/index.html | 5 +++++ frontend/js/app.js | 17 +++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/frontend/css/style.css b/frontend/css/style.css index 495d503..831c106 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -627,6 +627,27 @@ html, body { } /* Choix exemplaires impression */ +.popup-qr { + display: flex; + flex-direction: column; + align-items: center; + gap: 1rem; + margin: 1rem 0; + padding: 1.5rem; + background: rgba(255,255,255,0.05); + border-radius: 16px; +} +.qr-photo-img { + width: 200px; + height: 200px; + border-radius: 12px; + background: #fff; +} +.qr-label { + font-size: 1rem; + color: #aaa; +} + .form-impression { display: flex; gap: 1rem; diff --git a/frontend/index.html b/frontend/index.html index 58bff7a..0e7533a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -146,6 +146,11 @@ QR Code +
diff --git a/frontend/js/app.js b/frontend/js/app.js index 91c29b4..b50a6ac 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -372,6 +372,23 @@ async function chargerBoothInfo() { } } +async function afficherQR() { + const booth = config.booth || {}; + if (!booth.actif || !booth.url || !photoFinale) return; + try { + const info = await apiGet('/api/booth/info'); + if (!info.password) return; + const eventId = (config.evenement || {}).event_id || booth.event_id || 'default'; + const qrUrl = `${booth.url}/g/${eventId}/view/${photoFinale}?p=${info.password}`; + document.getElementById('qr-photo').src = `/api/qr?url=${encodeURIComponent(qrUrl)}`; + document.getElementById('popup-qr').classList.remove('cache'); + } catch (e) {} +} + +function fermerQR() { + document.getElementById('popup-qr').classList.add('cache'); +} + function afficherStatut(message, type = 'succes') { const el = document.getElementById('statut-partage'); el.textContent = message;