- You've guessed correctly {Number(
- $guessHistory.correct / $guessHistory.total
- )}% of the time
+
+
+
+
+
+
+
+ {#if hasGuessingHistoryBeenLoaded}
+
+
+
+
+
+ {#if $guessingHistory.mostRecentGuessDate === todaysDateString}
+
+ You've already guessed today. Come back tomorrow.
+
+ {/if}
+
+
+
+
+
Your Score
+ {#if $guessingHistory.mostRecentGuessDate !== undefined}
+
+ You've guessed correctly {Number(
+ $guessingHistory.correctDays.length /
+ $guessingHistory.totalNumberOfGuesses
+ ) * 100}% of the time
+
+ {:else}
+
You've not guessed yet.
+ {/if}
+
+
{/if}
-
+
diff --git a/src/routes/sunrise-sunset/ISunriseSunsetGuessingHistory.ts b/src/routes/sunrise-sunset/ISunriseSunsetGuessingHistory.ts
new file mode 100644
index 0000000..9cdf2eb
--- /dev/null
+++ b/src/routes/sunrise-sunset/ISunriseSunsetGuessingHistory.ts
@@ -0,0 +1,9 @@
+type SunriseSunsetOption = 'sunrise' | 'sunset';
+
+export interface ISunriseSunsetGuessingHistory {
+ mostRecentGuessDate: undefined | string; // e.g. "2023-01-26"
+ totalNumberOfGuesses: number;
+ guesses: SunriseSunsetOption[];
+ incorrectDays: string[]; // e.g. ["2023-01-26", "2023-01-27"]
+ correctDays: string[]; // e.g. ["2023-01-28", "2023-01-29"]
+}