diff --git a/src/main.ts b/src/main.ts index 7a4b66f..17c8053 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,9 +4,18 @@ import './style.css'; const app = document.getElementById('app')!; -let currentView: 'quiz' | 'stats' = 'quiz'; +let currentView: 'quiz' | 'stats' | 'info' = 'quiz'; let typeChartView: 'attacking' | 'defending' = 'attacking'; const game = new Game(render); +const INFO_SEEN_KEY = 'pokemon-type-quiz-info-seen'; + +// Check if user has seen info screen before +const hasSeenInfo = localStorage.getItem(INFO_SEEN_KEY) === 'true'; + +if (!hasSeenInfo) { + currentView = 'info'; +} + game.nextQuestion(); function renderTypeBadge(name: TypeName, size: 'small' | 'large' = 'small'): string { @@ -15,12 +24,83 @@ function renderTypeBadge(name: TypeName, size: 'small' | 'large' = 'small'): str return `${info.name}`; } +function renderInfoScreen(): void { + app.innerHTML = ` +
Test your knowledge of type effectiveness!
+ ++ 1-6 to select answer + Enter to continue +
+