add persistent win/loss and some frontend feedback
Build / Build-image (push) Successful in 50s

This commit is contained in:
2026-08-14 22:38:08 +02:00
parent 406458c33b
commit 11d440c6ed
2 changed files with 39 additions and 13 deletions
+19 -3
View File
@@ -17,6 +17,7 @@
victory: false,
loss: false,
maxGuesses: 10,
correct: false,
};
},
@@ -28,6 +29,7 @@
this.guesses = response.data.guesses;
this.tla = response.data.tla;
this.context = response.data.context;
this.correct = response.data.correct;
});
},
@@ -50,9 +52,13 @@
this.victory = !this.victory;
this.tla = response.data.tla;
this.context = response.data.context;
this.correct = response.data.correct;
}
else if (this.guesses.length == this.maxGuesses) {
this.loss = !this.loss;
this.tla = response.data.tla;
this.context = response.data.context;
this.correct = response.data.correct;
}
})
}
@@ -118,12 +124,18 @@
</GuessWord>
</template>
</div>
<template v-if="guesses.length < maxGuesses">
<template v-if="guesses.length < maxGuesses && !correct">
<form ref="main-form" @submit="onSubmit" onsubmit="return false">
<UInput v-model="guess" @keyup="onkeyup()"/>
</form>
</template>
<h3>{{ guesses.length }} / {{ maxGuesses }}</h3>
<template v-if="!correct && guesses.length >= maxGuesses">
You ran out of guesses. Todays TLA was {{ tla }}
</template>
<template v-if="correct">
You completed todays TLAdle! Todays TLA was {{ tla }}
</template>
<h3>Guesses: {{ guesses.length }} / {{ maxGuesses }}</h3>
</template>
</UCard>
@@ -131,10 +143,14 @@
<Modal v-model:open="victory">
<h1>Congratulations!</h1>
Todays TLA was: {{ tla }}
<h3>The context of todays TLA:</h3>
{{ context }}
</Modal>
<Modal v-model:open="loss">
<h1>What a shame!</h1>
Todays TLA was: whatever you didnt write
Todays TLA was: {{ tla }}
<h3>The context of todays TLA:</h3>
{{ context }}
</Modal>
</template>