feat: add reveal answer functionality to reset score and update selected characters
All checks were successful
Build Docker Image / build (push) Successful in 1m10s

This commit is contained in:
2026-03-05 22:57:09 +01:00
parent 1035a98eca
commit 5978963939

View File

@@ -177,6 +177,13 @@
columnVisibility[column] = !columnVisibility[column]; columnVisibility[column] = !columnVisibility[column];
columnVisibility = columnVisibility; // Trigger reactivity columnVisibility = columnVisibility; // Trigger reactivity
} }
function revealAnswer() {
// Reset score (strike)
score = 0;
// Add the current character as the correct answer
selectedCharacters = [currentCharacter, ...selectedCharacters];
}
</script> </script>
<svelte:head> <svelte:head>
@@ -312,6 +319,15 @@
{selectedCharacters} {selectedCharacters}
on:select={handleCharacterSelect} on:select={handleCharacterSelect}
/> />
<div class="flex justify-center">
<button
type="button"
onclick={revealAnswer}
class="rounded-full border border-red-500/40 bg-transparent px-5 py-2 text-sm font-semibold text-red-300 transition hover:border-red-500 hover:bg-red-900/20"
>
Révéler la réponse
</button>
</div>
{/if} {/if}
{:else} {:else}
<div class="rounded-3xl border border-white/10 bg-white/5 p-6 shadow-[0_24px_60px_rgba(0,0,0,0.45)] backdrop-blur"> <div class="rounded-3xl border border-white/10 bg-white/5 p-6 shadow-[0_24px_60px_rgba(0,0,0,0.45)] backdrop-blur">