diff --git a/ToDo.md b/ToDo.md index 088b5ec..de685df 100644 --- a/ToDo.md +++ b/ToDo.md @@ -1,5 +1,6 @@ [ ] Improove: In the preview page, add full header. [ ] Improove: In the preview page, add possibility select custom color for each target. +[ ] Add Games: Logo Quiz, Emblem Quiz Done: [v] Strategy: Add quiz game to guess the logo or flags and invert diff --git a/src/App.svelte b/src/App.svelte index 6e8d409..44309bd 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -6,6 +6,7 @@ import Preview from "./pages/Preview.svelte"; import Game from "./pages/Game.svelte"; import FlagQuiz from "./pages/FlagQuiz.svelte"; + import CapitalsQuiz from "./pages/CapitalsQuiz.svelte"; import NotFound from "./pages/NotFound.svelte"; import Header from "./components/Header.svelte"; @@ -14,6 +15,7 @@ "/preview/:logoName": Preview, "/game": Game, "/game/flags": FlagQuiz, + "/game/capitals": CapitalsQuiz, "*": NotFound, }; diff --git a/src/pages/CapitalsQuiz.svelte b/src/pages/CapitalsQuiz.svelte new file mode 100644 index 0000000..c7f58d5 --- /dev/null +++ b/src/pages/CapitalsQuiz.svelte @@ -0,0 +1,1526 @@ + + + + Capitals Quiz + + +
(showAchievements = true)} +/> + +
+
+ + + + + (showAchievements = false)} + on:achievementsUnlocked={handleAchievementsUnlocked} + /> + + {#if quizSubpage === "welcome"} + + (showSettings = true)} + on:closeResults={() => (showSessionResults = false)} + /> + + 0} + on:action={handleActionButtonClick} + /> + {:else if quizSubpage === "quiz"} + + {#if gameState === "loading"} +
Loading countries...
+ {:else if currentQuestion} +
+
+
+ Question {currentSessionQuestions + 1} from {sessionLength} +
+
+ What is the capital of this country? +
+
+ + +
+ {#if showResult} +
+ {#if selectedAnswer === correctAnswer} +
+ Correct! +
+ {:else} +
+ + Wrong! + + The correct answer is: {getCapitalName(currentQuestion.correct)}. + + {#if showResultCountryInfo} + + {/if} + +
+ {/if} +
+ {/if} +
+ +
+
+ Flag +

+ {getCountryName(currentQuestion.correct)} + {#if currentQuestion.correct?.meta?.description} + + {#if showCountryInfo} + + {/if} + {/if} +

+
+
+ +
+ {#each currentQuestion.options as option, index} + + {/each} +
+ + {#if gameState === "question"} + + {:else if (!autoAdvance && gameState === "answered") || (autoAdvance && gameState === "answered" && sessionRestoredFromReload)} + + {/if} + + + {#if autoAdvance && gameState === "answered" && timerProgress > 0 && !sessionRestoredFromReload} +
+
+
+
+ Next question in {Math.ceil( + (timerDuration - (timerProgress / 100) * timerDuration) / + 1000, + )}s +
+ {/if} +
+ {/if} + + + {/if} +
+
+ +