Moved to an easier dictionary and added invalid word guesses back
All checks were successful
/ publish (push) Successful in 1m19s

Also added a spinner
This commit is contained in:
Leon Mika 2025-04-05 09:33:22 +11:00
parent 36b079681c
commit 566f55ed12
7 changed files with 105 additions and 57 deletions

View file

@ -5,7 +5,7 @@ import { WordSource } from "../models/words.js";
export default class extends Controller {
static targets = ["row", "playfield", "topMessage", "nextPuzzleButtons"];
static targets = ["row", "playfield", "topMessage", "nextPuzzleButtons", "loader"];
static outlets = ["overlay"];
async connect() {
@ -15,6 +15,8 @@ export default class extends Controller {
await this._gameController.start();
this._buildPlayfield();
this.loaderTarget.classList.add("hide");
}
tappedKey(key) {
@ -109,11 +111,16 @@ export default class extends Controller {
async loadNextPuzzle(ev) {
ev.preventDefault();
this.loaderTarget.classList.remove("hide");
if (await this._gameController.nextWord()) {
this._buildPlayfield();
} else {
this.overlayOutlet.showMessage("No more words available.");
}
this.loaderTarget.classList.add("hide");
}
_showWin() {