diff --git a/public/jeu.css b/public/jeu.css index d14fbc3..6179969 100644 --- a/public/jeu.css +++ b/public/jeu.css @@ -339,3 +339,15 @@ h1 { font-size: 24px; } } + +.emoji-carre-rouge { + color: red; +} + +.emoji-cercle-jaune { + color: yellow; +} + +.emoji-carre-bleu { + color: skyblue; +} diff --git a/ts/finDePartiePanel.ts b/ts/finDePartiePanel.ts index 3fdba24..171a090 100644 --- a/ts/finDePartiePanel.ts +++ b/ts/finDePartiePanel.ts @@ -11,6 +11,7 @@ export default class FinDePartiePanel { private readonly _statsButton: HTMLElement; private _resumeTexte: string = ""; + private _resumeTexteLegacy: string = ""; private _motATrouver: string = ""; private _estVictoire: boolean = false; private _partieEstFinie: boolean = false; @@ -43,6 +44,21 @@ export default class FinDePartiePanel { } }, "") ); + + let resultatsEmojisLegacy = resultats.map((mot) => + mot + .map((resultat) => resultat.statut) + .reduce((ligne, statut) => { + switch (statut) { + case LettreStatut.BienPlace: + return ligne + '🟥'; + case LettreStatut.MalPlace: + return ligne + '🟡'; + default: + return ligne + '🟦'; + } + }, "") + ); let dateGrille = this._datePartie.getTime(); let origine = InstanceConfiguration.dateOrigine.getTime(); this._motATrouver = motATrouver; @@ -52,6 +68,7 @@ export default class FinDePartiePanel { let numeroGrille = Math.floor((dateGrille - origine) / (24 * 3600 * 1000)) + 1; this._resumeTexte = "SUTOM #" + numeroGrille + " " + (estBonneReponse ? resultats.length : "-") + "/6\n\n" + resultatsEmojis.join("\n"); + this._resumeTexteLegacy = "SUTOM #" + numeroGrille + " " + (estBonneReponse ? resultats.length : "-") + "/6\n\n" + resultatsEmojisLegacy.join("\n"); } private attacherPartage(): void { @@ -106,7 +123,7 @@ export default class FinDePartiePanel { contenu += '

Résumé de ta partie − Partager

\
' +
-        this._resumeTexte +
+        this._resumeTexteLegacy +
         "
"; }