Init photobooth - borne photo evenementielle RPi4

Backend FastAPI complet : camera gphoto2, filtres/overlays Pillow,
chroma key OpenCV, multi-shot/collage, GIF, impression CUPS, email SMTP,
QR code. Frontend web vanilla (HTML/CSS/JS) pour Chromium kiosk.
Menu admin cache (appui long coin ecran). Toutes les fonctionnalites
activables/desactivables. Scripts install + systemd pour RPi4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 21:46:31 +01:00
commit c8e4ec80c1
29 changed files with 2854 additions and 0 deletions

51
frontend/js/share.js Normal file
View File

@@ -0,0 +1,51 @@
/* Module partage - Impression, email, QR code */
async function lancerImpression() {
if (!photoFinale) return;
afficherStatut('Impression en cours...', 'succes');
const resultat = await apiPost('/api/imprimer', { photo: photoFinale });
if (resultat.succes) {
afficherStatut('Photo envoyee a l\'imprimante !', 'succes');
} else {
afficherStatut('Erreur d\'impression', 'erreur');
}
}
function ouvrirEmail() {
document.getElementById('form-email').classList.remove('cache');
document.getElementById('input-email').focus();
}
function fermerEmail() {
document.getElementById('form-email').classList.add('cache');
document.getElementById('input-email').value = '';
}
async function envoyerEmail() {
const email = document.getElementById('input-email').value.trim();
if (!email || !photoFinale) return;
afficherStatut('Envoi en cours...', 'succes');
const resultat = await apiPost('/api/email', { email, photo: photoFinale });
if (resultat.succes) {
afficherStatut('Email envoye !', 'succes');
fermerEmail();
} else {
afficherStatut('Erreur d\'envoi email', 'erreur');
}
}
async function afficherQR() {
const zone = document.getElementById('zone-qr');
zone.classList.toggle('cache');
if (!zone.classList.contains('cache')) {
const resultat = await apiGet('/api/qr/galerie');
if (resultat.chemin) {
document.getElementById('img-qr').src = resultat.chemin;
} else {
afficherStatut('QR Code non configure', 'erreur');
zone.classList.add('cache');
}
}
}