diff --git a/web/pw-server/src/lib/components/Leaderboard.svelte b/web/pw-server/src/lib/components/Leaderboard.svelte
new file mode 100644
index 0000000..75e4807
--- /dev/null
+++ b/web/pw-server/src/lib/components/Leaderboard.svelte
@@ -0,0 +1,72 @@
+
+
+
+
+
+ {#each leaderboard as entry, index}
+
+ {index + 1} |
+
+ {formatRating(entry)}
+ |
+ {entry["bot"]["name"]} |
+
+ {#if entry["author"]}
+ {entry["author"]["username"]}
+ {/if}
+ |
+
+ {/each}
+
+
+
+
diff --git a/web/pw-server/src/routes/index.svelte b/web/pw-server/src/routes/index.svelte
index 32efe69..243f4da 100644
--- a/web/pw-server/src/routes/index.svelte
+++ b/web/pw-server/src/routes/index.svelte
@@ -13,11 +13,13 @@
import SubmitPane from "$lib/components/SubmitPane.svelte";
import OutputPane from "$lib/components/OutputPane.svelte";
import RulesView from "$lib/components/RulesView.svelte";
+ import Leaderboard from "$lib/components/Leaderboard.svelte";
enum ViewMode {
Editor,
MatchVisualizer,
Rules,
+ Leaderboard,
}
let matches = [];
@@ -111,10 +113,10 @@
return log;
}
- function selectEditor() {
+ function setViewMode(viewMode_: ViewMode) {
selectedMatchId = undefined;
selectedMatchLog = undefined;
- viewMode = ViewMode.Editor;
+ viewMode = viewMode_;
}
function selectRules() {
@@ -140,17 +142,24 @@
+
{#each matches as match}
@@ -175,6 +184,8 @@
{:else if viewMode === ViewMode.Rules}
+ {:else if viewMode === ViewMode.Leaderboard}
+
{/if}