Renomme la marque en Gauthier Chombart & Nathan Chauwin et finalise le jeu Memory
Header, footer, titres et balises meta de toutes les pages actives : remplace NextGN Formation par Gauthier Chombart & Nathan Chauwin. Nouveau pied de page uniforme mentionnant les droits reserves et le statut de formateurs independants (dossier archives/ laisse inchange). Integre aussi la refonte du jeu Memory (CSS/JS/HUD/leaderboard) et ajoute le rapport de veille Certibiocide semaine 28.
This commit is contained in:
@@ -175,7 +175,6 @@ class GameSessionState {
|
||||
this.moves = 0;
|
||||
this.score = 0;
|
||||
this.matched = 0;
|
||||
this.isPaused = false;
|
||||
this.gameActive = false;
|
||||
}
|
||||
|
||||
@@ -190,7 +189,6 @@ class GameSessionState {
|
||||
this.score = 0;
|
||||
this.matched = 0;
|
||||
this.gameActive = true;
|
||||
this.isPaused = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -192,17 +192,18 @@ class LeaderboardManager {
|
||||
const medal = index < 3 ? `class="rank-number medal-${index + 1}"` : 'class="rank-number"';
|
||||
|
||||
rankItem.innerHTML = `
|
||||
<div ${medal}>${rankNumber}</div>
|
||||
<div class="rank-top">
|
||||
<div ${medal}>${rankNumber}</div>
|
||||
<div class="rank-score">${formatNumber(score.score)}</div>
|
||||
</div>
|
||||
<div class="rank-info">
|
||||
<div class="player-name">${this.escapeHTML(score.playerName)}</div>
|
||||
<div class="rank-meta">
|
||||
<span>⏱ ${formatTime(score.timeSeconds)}</span>
|
||||
<span>🎯 ${score.moves} mouvements</span>
|
||||
${score.isPerfect ? '<span>✨ Parfait</span>' : ''}
|
||||
<span>🎯 ${score.moves}</span>
|
||||
${score.isPerfect ? '<span>✨</span>' : ''}
|
||||
</div>
|
||||
</div>
|
||||
<div class="rank-score">${formatNumber(score.score)}</div>
|
||||
<div class="rank-difficulty ${score.difficulty}">${DIFFICULTY_MODES[score.difficulty].name}</div>
|
||||
`;
|
||||
|
||||
leaderboardList.appendChild(rankItem);
|
||||
|
||||
@@ -14,7 +14,6 @@ class MemoryGameEngine {
|
||||
moves: 0,
|
||||
score: 0,
|
||||
isProcessing: false,
|
||||
isPaused: false,
|
||||
gameStarted: false
|
||||
};
|
||||
this.startTime = null;
|
||||
@@ -128,8 +127,7 @@ class MemoryGameEngine {
|
||||
if (this.gameState.flipped.length === 2) return;
|
||||
if (this.cards[cardIndex].isMatched) return;
|
||||
if (this.gameState.flipped.includes(cardIndex)) return;
|
||||
if (this.gameState.isPaused) return;
|
||||
|
||||
|
||||
// Retourner la carte
|
||||
this.flipCard(cardIndex);
|
||||
this.gameState.flipped.push(cardIndex);
|
||||
@@ -260,9 +258,7 @@ class MemoryGameEngine {
|
||||
this.startTime = Date.now();
|
||||
|
||||
this.timerInterval = setInterval(() => {
|
||||
if (!this.gameState.isPaused) {
|
||||
this.updateTimer();
|
||||
}
|
||||
this.updateTimer();
|
||||
}, 100);
|
||||
|
||||
this.analytics.trackGameStart(this.difficulty);
|
||||
@@ -429,7 +425,6 @@ class MemoryGameEngine {
|
||||
moves: 0,
|
||||
score: 0,
|
||||
isProcessing: false,
|
||||
isPaused: false,
|
||||
gameStarted: false
|
||||
};
|
||||
|
||||
@@ -444,34 +439,13 @@ class MemoryGameEngine {
|
||||
document.getElementById('timer-display').style.animation = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Pause/Reprise
|
||||
*/
|
||||
togglePause() {
|
||||
if (!this.gameState.gameStarted) return;
|
||||
|
||||
this.gameState.isPaused = !this.gameState.isPaused;
|
||||
const pauseBtn = document.getElementById('pause-btn');
|
||||
|
||||
if (this.gameState.isPaused) {
|
||||
pauseBtn.textContent = '▶ Reprendre';
|
||||
pauseBtn.classList.add('paused');
|
||||
} else {
|
||||
pauseBtn.textContent = '⏸ Pause';
|
||||
pauseBtn.classList.remove('paused');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup event listeners
|
||||
*/
|
||||
setupEventListeners() {
|
||||
// Bouton restart
|
||||
document.getElementById('restart-btn').addEventListener('click', () => this.restart());
|
||||
|
||||
// Bouton pause
|
||||
document.getElementById('pause-btn').addEventListener('click', () => this.togglePause());
|
||||
|
||||
|
||||
// Sélecteur de difficulté
|
||||
document.querySelectorAll('.btn-difficulty').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
@@ -512,14 +486,51 @@ class MemoryGameEngine {
|
||||
// ============================================
|
||||
let game;
|
||||
|
||||
/**
|
||||
* Demander le nom du joueur à la première partie
|
||||
*/
|
||||
function setupPlayerNameModal(onReady) {
|
||||
const nameConfirmed = localStorage.getItem('nextgn_name_confirmed') === 'true';
|
||||
|
||||
if (nameConfirmed) {
|
||||
onReady();
|
||||
return;
|
||||
}
|
||||
|
||||
const modal = document.getElementById('player-name-modal');
|
||||
const input = document.getElementById('player-name-input');
|
||||
const confirmBtn = document.getElementById('player-name-confirm');
|
||||
|
||||
modal.classList.remove('hidden');
|
||||
input.focus();
|
||||
|
||||
const confirmName = () => {
|
||||
const name = input.value.trim();
|
||||
localStorage.setItem('nextgn_playerName', name || getPlayerName());
|
||||
localStorage.setItem('nextgn_name_confirmed', 'true');
|
||||
modal.classList.add('hidden');
|
||||
onReady();
|
||||
};
|
||||
|
||||
confirmBtn.addEventListener('click', confirmName, { once: true });
|
||||
input.addEventListener('keydown', (e) => {
|
||||
if (e.key === 'Enter') confirmName();
|
||||
}, { once: true });
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Initialiser le jeu
|
||||
game = new MemoryGameEngine('normal');
|
||||
|
||||
// Afficher le leaderboard initial
|
||||
LeaderboardManager.updateDisplay('all');
|
||||
LeaderboardManager.updatePlayerStats();
|
||||
|
||||
|
||||
setupPlayerNameModal(() => {
|
||||
LeaderboardManager.updateDisplay('all');
|
||||
LeaderboardManager.updatePlayerStats();
|
||||
});
|
||||
|
||||
// Initialiser le jeu
|
||||
game = new MemoryGameEngine('normal');
|
||||
|
||||
// Scroll progress
|
||||
window.addEventListener('scroll', () => {
|
||||
game.updateHUD();
|
||||
|
||||
@@ -18,8 +18,8 @@ const PICTOGRAMMES = [
|
||||
id: 2,
|
||||
nom: "Exclamation",
|
||||
filename: "nocif_irritant_ozone.jpg",
|
||||
texte: "Je nuis gravement à la santé",
|
||||
danger: "Danger pour la santé",
|
||||
texte: "J'altère la santé ou la couche d'ozone",
|
||||
danger: "Danger pour la santé/Environnement",
|
||||
couleur: "teal"
|
||||
},
|
||||
{
|
||||
@@ -72,10 +72,10 @@ const PICTOGRAMMES = [
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
nom: "Santé/Environnement",
|
||||
nom: "Santé (CMR)",
|
||||
filename: "cmr.jpg",
|
||||
texte: "J'altère la santé ou la couche d'ozone",
|
||||
danger: "Danger pour la santé/Environnement",
|
||||
texte: "Je nuis gravement à la santé",
|
||||
danger: "Danger pour la santé",
|
||||
couleur: "teal"
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user