From 3484cd1c076096a39141775cc432320fbf9ea74c Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 4 Nov 2024 22:35:36 +0100 Subject: [PATCH] Better feedback --- src/alfagok/static/game.js | 3 +++ src/alfagok/templates/index.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/alfagok/static/game.js b/src/alfagok/static/game.js index 46886ba..3c35b1c 100644 --- a/src/alfagok/static/game.js +++ b/src/alfagok/static/game.js @@ -1,12 +1,14 @@ /* API calls **/ async function doGuess(guessWord) { Alpine.store('alfagok').loading = true; + Alpine.store('alfagok').guessError = null; if (guessWord === '') { console.log('Nothing filled in'); Alpine.store('alfagok').guessError = 'Vul een woord in'; return; } + Alpine.store('alfagok').nrGuesses++; if (Alpine.store('alfagok').startTime === '') { console.log('Setting startTime to now'); } @@ -33,6 +35,7 @@ async function doGuess(guessWord) { } if (result.hint && result.hint === 'it') { console.log('gevonden'); + Alpine.store('alfagok').winTime = 'yay'; } } diff --git a/src/alfagok/templates/index.html b/src/alfagok/templates/index.html index ee0f36c..83abe81 100644 --- a/src/alfagok/templates/index.html +++ b/src/alfagok/templates/index.html @@ -79,7 +79,7 @@ -

Je huidige gok is:

+{#

Je huidige gok is:

#}