/* Module galerie */ async function chargerGalerie() { const photos = await apiGet('/api/galerie'); const grille = document.getElementById('grille-galerie'); grille.innerHTML = ''; if (photos.length === 0) { grille.innerHTML = '

Aucune photo pour le moment

'; return; } for (const photo of photos) { const img = document.createElement('img'); img.src = '/' + photo.chemin; img.alt = photo.nom; img.loading = 'lazy'; img.addEventListener('click', () => voirPhoto(photo)); grille.appendChild(img); } } function voirPhoto(photo) { photoFinale = photo.nom; document.getElementById('photo-partage').src = '/' + photo.chemin; allerA('partage'); }