From 60349df3d7ecf88e7ac785cb39cce2c0a5914f84 Mon Sep 17 00:00:00 2001 From: Riley Smith Date: Wed, 24 Apr 2024 09:39:45 -0700 Subject: [PATCH 1/3] add sub ui for all time/quarters --- src/lib/components/leaderboard.svelte | 90 ++++++++++++++++----------- src/lib/db/quarter.ts | 1 - 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/src/lib/components/leaderboard.svelte b/src/lib/components/leaderboard.svelte index 84c1a0c..25773f4 100644 --- a/src/lib/components/leaderboard.svelte +++ b/src/lib/components/leaderboard.svelte @@ -8,51 +8,67 @@ export let leaderboardData: LeaderboardData; export let leaderboardQuarters: string[]; - console.log(leaderboardData); - console.log(leaderboardQuarters); leaderboard_store.init(leaderboardData); {#if $leaderboard_store}
- + - {#each leaderboardQuarters as quarter} - {#if quarter === 'all_time'} - All Time - {:else} - - {quarter} - - {/if} - {/each} + By Quarter + All Time - {#each leaderboardQuarters as quarter} - -
- {#if quarter === 'all_time'} - - - Heads up! - - This feature is still in beta! The all-time leaderboard may not be accurate nor - auto update! - - - {/if} -

- Quarter Total: {$leaderboard_store[quarter].total} -

-
    - {#each $leaderboard_store[quarter].data as player, i} -
  1. - {i + 1}. {player.resolved_username} - {player.total} -
  2. + +
    + + + Heads up! + + This feature is still in beta! The all-time leaderboard may not be accurate nor auto + update! + + +

    + All Time Total: {$leaderboard_store['all_time'].total} +

    +
      + {#each $leaderboard_store['all_time'].data as player, i} +
    1. + {i + 1}. {player.resolved_username} - {player.total} +
    2. + {/each} +
    +
    +
    + +
    + + + {#each leaderboardQuarters as quarter} + + {quarter} + {/each} -
-
-
- {/each} + + {#each leaderboardQuarters as quarter} + +
+

+ Quarter Total: {$leaderboard_store[quarter].total} +

+
    + {#each $leaderboard_store[quarter].data as player, i} +
  1. + {i + 1}. {player.resolved_username} - {player.total} +
  2. + {/each} +
+
+
+ {/each} +
+
+ {:else} diff --git a/src/lib/db/quarter.ts b/src/lib/db/quarter.ts index d05a46b..5425586 100644 --- a/src/lib/db/quarter.ts +++ b/src/lib/db/quarter.ts @@ -17,7 +17,6 @@ export async function getQuarters(env: ENV) { const quartersArr = Array.from(quarters).sort((a, b) => a === currentQuarter ? -1 : b === currentQuarter ? 1 : 0, ); - quartersArr.push("all_time") return quartersArr; } From 42e08e143e79ca8f36b16a3501527dc91589918c Mon Sep 17 00:00:00 2001 From: Riley Smith Date: Sat, 27 Apr 2024 22:46:52 -0700 Subject: [PATCH 2/3] funny number --- src/lib/components/counter.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/components/counter.svelte b/src/lib/components/counter.svelte index ab1a327..cd67cb9 100644 --- a/src/lib/components/counter.svelte +++ b/src/lib/components/counter.svelte @@ -28,13 +28,13 @@
-

+

Riley has said
Womp Womp

{$counter_store.total} times

@@ -49,7 +49,8 @@ {/if} From a48729690ea9bebf895f4cf581a8a0678e345afb Mon Sep 17 00:00:00 2001 From: Riley Smith Date: Sat, 27 Apr 2024 22:47:13 -0700 Subject: [PATCH 3/3] arrow stuff --- src/lib/components/leaderboard.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/components/leaderboard.svelte b/src/lib/components/leaderboard.svelte index 25773f4..0f87211 100644 --- a/src/lib/components/leaderboard.svelte +++ b/src/lib/components/leaderboard.svelte @@ -1,7 +1,7 @@