bonpoint/web/public/index.html
jmartin c4ebb5b2d8 Initialise le dépôt Bonpoint avec docs et prototype web.
Structure docs/, web/ (app Node existante) et mobile/ (placeholder Flutter).
2026-06-12 11:39:51 +02:00

72 lines
2.4 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#667eea">
<title>Bons Points</title>
<link rel="manifest" href="/manifest.json">
<link rel="icon" type="image/png" sizes="192x192" href="/icons/icon-192.png">
<link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Bons Points">
<meta name="mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="/css/style.css?v=39">
</head>
<body>
<div class="container">
<h1>⭐ Bons Points ⭐</h1>
<p class="sous-titre">Qui est le plus sage ?</p>
<div id="liste-enfants"></div>
<a href="/parent" class="btn-parent">
<div class="avatar-cercle avatar-parent-accueil" aria-hidden="true">
<img src="/photos/parents.png" alt="">
</div>
<span class="btn-parent-texte">Espace parents</span>
</a>
</div>
<script>
const PHOTOS = {
Ariana: '/photos/ariana.png',
Pablo: '/photos/pablo.png',
'Hélia': '/photos/helia.png',
};
function slug(prenom) {
return prenom.toLowerCase()
.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
}
async function chargerScores() {
try {
const res = await fetch('/api/public/scores');
const data = await res.json();
const conteneur = document.getElementById('liste-enfants');
conteneur.innerHTML = data.enfants.map((e) => `
<a class="carte-enfant carte-lien" href="/enfant/${slug(e.prenom)}">
<div class="avatar-cercle" style="border-color:${e.couleur}">
<img src="${PHOTOS[e.prenom]}" alt="${e.prenom}">
</div>
<div class="info-enfant">
<div class="prenom">${e.prenom}</div>
</div>
<div class="score" style="color:${e.couleur}">${e.score}</div>
<span class="fleche-fiche"></span>
</a>
`).join('');
} catch {
document.getElementById('liste-enfants').innerHTML =
'<p style="color:#fff;text-align:center">Chargement impossible</p>';
}
}
chargerScores();
setInterval(chargerScores, 30000);
</script>
<script src="/js/pwa.js" defer></script>
</body>
</html>