|
9 | 9 | import { Badge } from "$lib/components/ui/badge"; |
10 | 10 |
|
11 | 11 | let stats = $derived(game.allStats); |
12 | | - let gated = $derived(game.needsFundamentalsPlacement); |
13 | 12 | let confirmReset = $state(false); |
14 | 13 | let confirmYesEl: HTMLElement | null = $state(null); |
15 | 14 | let resetButtonEl: HTMLElement | null = $state(null); |
|
47 | 46 | > |
48 | 47 | Learn The FAR |
49 | 48 | </h1> |
50 | | - {#if !gated} |
51 | | - <p class="text-xs text-muted-foreground sm:text-sm"> |
52 | | - A fun way to learn the FAR, one scenario at a time. |
53 | | - </p> |
54 | | - {/if} |
| 49 | + <p class="text-xs text-muted-foreground sm:text-sm"> |
| 50 | + A fun way to learn the FAR, one scenario at a time. |
| 51 | + </p> |
55 | 52 | </div> |
56 | 53 | <div |
57 | 54 | class="flex items-center gap-1.5 rounded-full border bg-card px-3 py-1.5 text-sm font-semibold sm:gap-2 sm:px-4 sm:py-2 sm:text-base" |
|
64 | 61 | </header> |
65 | 62 |
|
66 | 63 | <div class="mt-4 sm:mt-6"> |
67 | | - <PieWheel {stats} hubPercent={game.masteryPercent} locked={gated} /> |
| 64 | + <PieWheel {stats} hubPercent={game.masteryPercent} /> |
68 | 65 | </div> |
69 | 66 |
|
70 | | - {#if !gated} |
71 | | - <div |
72 | | - class={`mt-4 grid gap-2 sm:mt-6 sm:gap-3 ${game.shakyQuestions.length > 0 ? "sm:grid-cols-2" : ""}`} |
| 67 | + <div |
| 68 | + class={`mt-4 grid gap-2 sm:mt-6 sm:gap-3 ${game.shakyQuestions.length > 0 ? "sm:grid-cols-2" : ""}`} |
| 69 | + > |
| 70 | + <button |
| 71 | + type="button" |
| 72 | + disabled={game.dailyDoneToday} |
| 73 | + onclick={() => game.startDaily()} |
| 74 | + class="flex items-center gap-3 rounded-2xl border-2 p-4 text-left transition-all enabled:hover:border-primary/50 enabled:hover:bg-muted/40 disabled:opacity-60 sm:gap-4 sm:p-5 lg:p-6" |
73 | 75 | > |
| 76 | + <span class="text-2xl sm:text-3xl" aria-hidden="true">{game.dailyDoneToday ? "✅" : "📰"}</span> |
| 77 | + <div class="min-w-0 flex-1"> |
| 78 | + <p class="font-semibold leading-tight sm:text-lg">Daily challenge</p> |
| 79 | + <p class="text-xs text-muted-foreground sm:text-sm"> |
| 80 | + {game.dailyDoneToday ? "Done today — back tomorrow" : "5 mixed questions, feeds your streak"} |
| 81 | + </p> |
| 82 | + </div> |
| 83 | + <span class="shrink-0 text-lg text-muted-foreground sm:text-xl" aria-hidden="true">›</span> |
| 84 | + </button> |
| 85 | + |
| 86 | + {#if game.shakyQuestions.length > 0} |
74 | 87 | <button |
75 | 88 | type="button" |
76 | | - disabled={game.dailyDoneToday} |
77 | | - onclick={() => game.startDaily()} |
78 | | - class="flex items-center gap-3 rounded-2xl border-2 p-4 text-left transition-all enabled:hover:border-primary/50 enabled:hover:bg-muted/40 disabled:opacity-60 sm:gap-4 sm:p-5 lg:p-6" |
| 89 | + onclick={() => game.startStudyMisses()} |
| 90 | + class="flex items-center gap-3 rounded-2xl border-2 p-4 text-left transition-all hover:border-primary/50 hover:bg-muted/40 sm:gap-4 sm:p-5 lg:p-6" |
79 | 91 | > |
80 | | - <span class="text-2xl sm:text-3xl" aria-hidden="true">{game.dailyDoneToday ? "✅" : "📰"}</span> |
| 92 | + <span class="text-2xl sm:text-3xl" aria-hidden="true">📖</span> |
81 | 93 | <div class="min-w-0 flex-1"> |
82 | | - <p class="font-semibold leading-tight sm:text-lg">Daily challenge</p> |
| 94 | + <p class="font-semibold leading-tight sm:text-lg">Here's the missing picture</p> |
83 | 95 | <p class="text-xs text-muted-foreground sm:text-sm"> |
84 | | - {game.dailyDoneToday ? "Done today — back tomorrow" : "5 mixed questions, feeds your streak"} |
| 96 | + {game.shakyQuestions.length} concept{game.shakyQuestions.length === 1 ? "" : "s"} to |
| 97 | + re-read — not a soft quiz |
85 | 98 | </p> |
86 | 99 | </div> |
87 | 100 | <span class="shrink-0 text-lg text-muted-foreground sm:text-xl" aria-hidden="true">›</span> |
88 | 101 | </button> |
89 | | - |
90 | | - {#if game.shakyQuestions.length > 0} |
91 | | - <button |
92 | | - type="button" |
93 | | - onclick={() => game.startStudyMisses()} |
94 | | - class="flex items-center gap-3 rounded-2xl border-2 p-4 text-left transition-all hover:border-primary/50 hover:bg-muted/40 sm:gap-4 sm:p-5 lg:p-6" |
95 | | - > |
96 | | - <span class="text-2xl sm:text-3xl" aria-hidden="true">📖</span> |
97 | | - <div class="min-w-0 flex-1"> |
98 | | - <p class="font-semibold leading-tight sm:text-lg">Here’s the missing picture</p> |
99 | | - <p class="text-xs text-muted-foreground sm:text-sm"> |
100 | | - {game.shakyQuestions.length} concept{game.shakyQuestions.length === 1 ? "" : "s"} to |
101 | | - re-read — not a soft quiz |
102 | | - </p> |
103 | | - </div> |
104 | | - <span class="shrink-0 text-lg text-muted-foreground sm:text-xl" aria-hidden="true">›</span> |
105 | | - </button> |
106 | | - {/if} |
107 | | - </div> |
108 | | - {/if} |
| 102 | + {/if} |
| 103 | + </div> |
109 | 104 |
|
110 | 105 | {#if showGlossaryOnHome} |
111 | 106 | <button |
|
130 | 125 | </h2> |
131 | 126 | <div class="flex flex-col gap-2 sm:gap-3"> |
132 | 127 | {#each stats as s (s.unit.id)} |
133 | | - {@const lifecycleLocked = game.isUnitLocked(s.unit.id)} |
134 | | - <div |
135 | | - class={`rounded-2xl border-2 p-3 sm:p-4 lg:p-5 ${ |
136 | | - lifecycleLocked |
137 | | - ? "border-border/50 bg-muted/40" |
138 | | - : "border-border bg-card" |
139 | | - }`} |
140 | | - > |
| 128 | + <div class="rounded-2xl border-2 border-border bg-card p-3 sm:p-4 lg:p-5"> |
141 | 129 | <div class="flex items-start gap-3 sm:gap-4"> |
142 | 130 | <span |
143 | | - class={`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-bold sm:h-12 sm:w-12 sm:text-base ${ |
144 | | - lifecycleLocked ? "bg-muted text-foreground/80" : "text-white" |
145 | | - }`} |
146 | | - style={lifecycleLocked ? undefined : `background:hsl(${s.unit.hue} 70% 27%)`} |
| 131 | + class="flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-sm font-bold text-white sm:h-12 sm:w-12 sm:text-base" |
| 132 | + style={`background:hsl(${s.unit.hue} 70% 27%)`} |
147 | 133 | > |
148 | 134 | {Math.round(s.ratio * 100)}% |
149 | 135 | </span> |
150 | 136 | <div class="min-w-0 flex-1"> |
151 | 137 | <div class="flex flex-wrap items-center gap-2 sm:gap-x-3"> |
152 | | - <h3 |
153 | | - class={`font-semibold leading-tight sm:text-lg ${ |
154 | | - lifecycleLocked ? "text-muted-foreground" : "" |
155 | | - }`} |
156 | | - > |
| 138 | + <h3 class="font-semibold leading-tight sm:text-lg"> |
157 | 139 | {s.unit.title} |
158 | 140 | </h3> |
159 | | - {#if lifecycleLocked} |
160 | | - <Badge variant="secondary" class="shrink-0 text-[0.65rem] sm:text-xs">Locked</Badge> |
161 | | - {:else if s.level !== "new"} |
| 141 | + {#if s.level !== "new"} |
162 | 142 | <Badge variant="secondary" class="shrink-0 text-[0.65rem] sm:text-xs" |
163 | 143 | >{s.levelLabel}</Badge |
164 | 144 | > |
165 | 145 | {/if} |
166 | | - {#if lifecycleLocked} |
167 | | - <span class="text-[0.65rem] text-muted-foreground sm:text-xs"> |
168 | | - Complete Basics to unlock |
169 | | - </span> |
170 | | - {:else if game.workingTier(s.unit.id) === "advanced"} |
| 146 | + {#if game.workingTier(s.unit.id) === "advanced"} |
171 | 147 | <span class="text-[0.65rem] text-muted-foreground sm:text-xs"> |
172 | 148 | {DIFFICULTY_LABEL.advanced} |
173 | 149 | </span> |
|
176 | 152 | <p class="mt-0.5 text-xs text-muted-foreground sm:text-sm">{s.unit.blurb}</p> |
177 | 153 | <div |
178 | 154 | class="mt-1.5 flex h-1.5 w-full overflow-hidden rounded-full bg-muted sm:mt-2 sm:h-2" |
179 | | - class:opacity-50={lifecycleLocked} |
180 | 155 | > |
181 | 156 | {#if s.masteredRatio > 0} |
182 | 157 | <div |
|
199 | 174 | <Button |
200 | 175 | class="flex-1" |
201 | 176 | size="sm" |
202 | | - disabled={lifecycleLocked} |
203 | 177 | onclick={() => game.startUnit(s.unit.id)} |
204 | 178 | > |
205 | 179 | Quiz me |
|
213 | 187 | Start learning |
214 | 188 | </Button> |
215 | 189 | </div> |
216 | | - {#if gated && s.unit.id === "fundamentals"} |
217 | | - <div class="mt-2 flex flex-col gap-2 sm:mt-3 sm:gap-3"> |
218 | | - <Button |
219 | | - size="sm" |
220 | | - variant="secondary" |
221 | | - class="w-full" |
222 | | - onclick={() => game.startTestOut()} |
223 | | - > |
224 | | - Test out of basics |
225 | | - </Button> |
226 | | - {#if game.hasFundamentalsAttempt && game.fundamentalsGaps.length > 0} |
227 | | - <Button |
228 | | - size="sm" |
229 | | - variant="outline" |
230 | | - class="w-full" |
231 | | - onclick={() => game.startStudyFundamentalsGaps()} |
232 | | - > |
233 | | - Here’s the missing picture |
234 | | - </Button> |
235 | | - {/if} |
236 | | - </div> |
237 | | - {/if} |
238 | 190 | </div> |
239 | 191 | {/each} |
240 | 192 | </div> |
|
0 commit comments