Skip to content

Commit aa37796

Browse files
committed
feat(guess-the-word): render a spinner as placeholder for tries indicator
1 parent 6285a55 commit aa37796

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

vanilla/guess-the-word/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@
3737
<%- include("RingSpinner") %>
3838
</div>
3939
<section class="info | grid">
40-
<section class="tries | flex flex-wrap">
40+
<section class="tries | flex items-center flex-wrap">
4141
<p class="tries__description">
4242
Tries (<span id="current-tries">0</span>/<span id="max-tries"
4343
>?</span
4444
>)<span aria-hidden="true">:</span>
4545
</p>
46+
<%- include("EllipsisSpinner") %>
4647
<%- include("StepIndicator") %>
4748
</section>
4849
<section class="mistakes">

vanilla/guess-the-word/src/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { setupEventListeners } from "./events/listeners/setup";
66
import { generateRandomWord } from "./events/handlers/random-word";
77
import { applyDifficulty } from "./utils/difficulty/apply";
88
import { DefinitionPages } from "./ui/definition/pages";
9+
import { removeSpinner } from "./ui/spinner";
10+
import { $triesContainer } from "./ui/tries";
911
import "@lib/alert/styles.css";
1012
import "@fontsource-variable/outfit";
1113
import "@fontsource/outfit/400.css";
@@ -19,6 +21,7 @@ import "./styles/main.css";
1921
await removeAvailableWord(word, { difficulty, isInitialization: true });
2022
});
2123
await applyDifficulty(difficulty);
24+
removeSpinner($triesContainer);
2225

2326
if (words.length === 0)
2427
await import("./events/handlers/difficulty-complete").then(

vanilla/guess-the-word/src/styles/game-card/info.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@
2929
gap: 0.25rem 1ch;
3030
}
3131

32+
.game-card .info .tries {
33+
--spinner-size: 2.75em;
34+
--spinner-color: var(--slate-600);
35+
}
36+
.game-card .info .tries .ellipsis-spinner {
37+
height: var(--_ball-size);
38+
aspect-ratio: unset;
39+
}
40+
.game-card .info .tries .ellipsis-spinner div {
41+
top: unset;
42+
}
43+
3244
.game-card .hints .button {
3345
--icon-size: 1.875em;
3446
}

0 commit comments

Comments
 (0)