Shrink used cells
This commit is contained in:
parent
5127266fce
commit
2936654c18
@ -56,6 +56,10 @@ body.wide {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cell.done {
|
||||||
|
height: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
#keyboard {
|
#keyboard {
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
@ -108,6 +112,9 @@ body.wide {
|
|||||||
width: 9vw;
|
width: 9vw;
|
||||||
height: 9vw;
|
height: 9vw;
|
||||||
}
|
}
|
||||||
|
.cell.done {
|
||||||
|
height: 4.5vw;
|
||||||
|
}
|
||||||
.key {
|
.key {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 7.6vw;
|
width: 7.6vw;
|
||||||
|
10
index.js
10
index.js
@ -161,6 +161,10 @@ function processKey(e) {
|
|||||||
}
|
}
|
||||||
for (let pos = 0; pos < 4; pos++) {
|
for (let pos = 0; pos < 4; pos++) {
|
||||||
if (done[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;
|
continue;
|
||||||
}
|
}
|
||||||
let used = [];
|
let used = [];
|
||||||
@ -201,9 +205,11 @@ function processKey(e) {
|
|||||||
for (let i = 0; i < WORD_LENGTH; i++) {
|
for (let i = 0; i < WORD_LENGTH; i++) {
|
||||||
const el = data[pos * MAX_GUESSES + guessed.length][i];
|
const el = data[pos * MAX_GUESSES + guessed.length][i];
|
||||||
if (hints[i] === "correct") {
|
if (hints[i] === "correct") {
|
||||||
el.className = "correct cell";
|
el.className = "correct cell done";
|
||||||
} else if (hints[i] === "position") {
|
} else if (hints[i] === "position") {
|
||||||
el.className = "wrong-position cell";
|
el.className = "wrong-position cell done";
|
||||||
|
} else {
|
||||||
|
el.className = "cell done";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (input === word) {
|
if (input === word) {
|
||||||
|
Loading…
Reference in New Issue
Block a user