From 2936654c18f34fce9317cdd8b8416474e8db2ccd Mon Sep 17 00:00:00 2001 From: Arne Keller Date: Wed, 23 Feb 2022 15:15:26 +0100 Subject: [PATCH] Shrink used cells --- index.css | 7 +++++++ index.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/index.css b/index.css index a486ede..971b9bc 100644 --- a/index.css +++ b/index.css @@ -56,6 +56,10 @@ body.wide { vertical-align: top; } +.cell.done { + height: 0.5em; +} + #keyboard { margin-top: 1em; } @@ -108,6 +112,9 @@ body.wide { width: 9vw; height: 9vw; } + .cell.done { + height: 4.5vw; + } .key { box-sizing: border-box; width: 7.6vw; diff --git a/index.js b/index.js index 838b53e..152ee25 100644 --- a/index.js +++ b/index.js @@ -161,6 +161,10 @@ function processKey(e) { } for (let pos = 0; pos < 4; pos++) { if (done[pos]) { + for (let i = 0; i < WORD_LENGTH; i++) { + const el = data[pos * MAX_GUESSES + guessed.length][i]; + el.className = "cell done"; + } continue; } let used = []; @@ -201,9 +205,11 @@ function processKey(e) { for (let i = 0; i < WORD_LENGTH; i++) { const el = data[pos * MAX_GUESSES + guessed.length][i]; if (hints[i] === "correct") { - el.className = "correct cell"; + el.className = "correct cell done"; } else if (hints[i] === "position") { - el.className = "wrong-position cell"; + el.className = "wrong-position cell done"; + } else { + el.className = "cell done"; } } if (input === word) {