From 96464ccca15d56d1cce995cb452de8df3c93b3c0 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 9 Sep 2026 15:32:27 +0200 Subject: [PATCH] =?UTF-8?q?Canon=20r=C3=A9veil:=20frontend=20attend=20conn?= =?UTF-8?q?exion=20+=20fix=20taille=20countdown=20CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - /api/camera/statut expose reveil_en_cours pour que le frontend sache - lancerCapture() poll toutes les 2s (max 60s) si Canon en réveil au lieu de fail immédiat - Fix CSS countdown: .compte-a-rebours span était à 14rem (écrasait .anim-texte par spécificité) → chiffres clamp(2rem, 8vw, 5rem), texte clamp(0.8rem, 3vw, 1.5rem) - Bump cache versions (style v17, camera v18) Co-Authored-By: Claude Opus 4.6 --- backend/main.py | 1 + frontend/css/style.css | 10 +++++++--- frontend/index.html | 2 +- frontend/js/camera.js | 13 +++++++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/backend/main.py b/backend/main.py index 2c6f1a1..1fd0e41 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1067,6 +1067,7 @@ async def api_camera_statut(): return { "connectee": camera.connectee, "mode": camera.mode, + "reveil_en_cours": _reveil_en_cours, "appareils": camera.lister_appareils(), } diff --git a/frontend/css/style.css b/frontend/css/style.css index abd592e..4940ef2 100644 --- a/frontend/css/style.css +++ b/frontend/css/style.css @@ -389,13 +389,17 @@ html, body { } .compte-a-rebours span { - font-size: 14rem; + font-size: clamp(2rem, 8vw, 5rem); font-weight: 800; color: #ffffff; text-shadow: 0 0 40px rgba(0,0,0,0.8), 0 0 80px var(--primaire); animation: pop 0.5s ease; } +.compte-a-rebours span.anim-texte { + font-size: clamp(0.8rem, 3vw, 1.5rem); +} + @keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 60% { transform: scale(1.2); } @@ -1761,13 +1765,13 @@ h3 { } .anim-chiffre { - font-size: 8rem; + font-size: clamp(2rem, 6vw, 4rem); font-weight: 700; color: var(--primaire); } .anim-texte { - font-size: clamp(0.9rem, 2.5vw, 1.6rem); + font-size: clamp(0.7rem, 2vw, 1.2rem); max-width: 80vw; text-align: center; line-height: 1.2; diff --git a/frontend/index.html b/frontend/index.html index c82ad71..5f4bc8c 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,7 +7,7 @@ - + diff --git a/frontend/js/camera.js b/frontend/js/camera.js index 3a97b1b..b3c8c01 100644 --- a/frontend/js/camera.js +++ b/frontend/js/camera.js @@ -249,9 +249,18 @@ async function lancerCapture() { await chargerCadreImpose(); majCompteurAccueil(); - // Verifier l'etat de la camera avant de commencer + // Verifier l'etat de la camera — attendre si reveil en cours try { - const statut = await apiGet('/api/camera/statut'); + let statut = await apiGet('/api/camera/statut'); + if ((!statut.connectee || statut.mode === 'erreur') && statut.reveil_en_cours) { + afficherStatut('Appareil photo en preparation...', 'succes'); + for (let att = 0; att < 30; att++) { + await pause(2000); + statut = await apiGet('/api/camera/statut'); + if (statut.connectee && statut.mode !== 'erreur') break; + } + afficherStatut('', ''); + } if (!statut.connectee || statut.mode === 'erreur') { captureEnCours = false; afficherErreurCapture('Appareil photo non disponible', 'Verifiez la connexion USB du DSLR');