From 3a2b6330220ccb186231d3df2acaa7943d84d735 Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Thu, 27 Jan 2022 20:18:29 +0000 Subject: [PATCH] flash screen red when user enters a word not in wordlist or not enough letters --- game.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/game.js b/game.js index d2f1c65..85318ff 100644 --- a/game.js +++ b/game.js @@ -32,7 +32,11 @@ function checkGridRow() { getGridRow(row).items.forEach(item => rowWord += item.letter) console.log(rowWord) - if (!wordlist.includes(rowWord)) return + if (!wordlist.includes(rowWord)) { + body.classList.add("incorrect") + setTimeout( () => body.classList.remove("incorrect"), 500) + return + } var correct_letters = 0 var dedupword = word