From 675bf6fd073097eeb29955fa34eee611c85971bd Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 15 Mar 2022 19:24:50 +0100 Subject: add a simple view with game rules --- web/pw-server/src/routes/index.svelte | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'web/pw-server/src/routes/index.svelte') diff --git a/web/pw-server/src/routes/index.svelte b/web/pw-server/src/routes/index.svelte index 1ed7b8b..8680588 100644 --- a/web/pw-server/src/routes/index.svelte +++ b/web/pw-server/src/routes/index.svelte @@ -13,10 +13,12 @@ import { debounce } from "$lib/utils"; import SubmitPane from "$lib/components/SubmitPane.svelte"; import OutputPane from "$lib/components/OutputPane.svelte"; + import RulesView from "$lib/components/RulesView.svelte"; enum ViewMode { Editor, MatchVisualizer, + Rules, } let matches = []; @@ -113,6 +115,12 @@ viewMode = ViewMode.Editor; } + function selectRules() { + selectedMatchId = undefined; + selectedMatchLog = undefined; + viewMode = ViewMode.Rules; + } + function formatMatchTimestamp(timestampString: string): string { let timestamp = DateTime.fromISO(timestampString, { zone: "utc" }).toLocal(); if (timestamp.startOf("day").equals(DateTime.now().startOf("day"))) { @@ -134,6 +142,13 @@ > Editor +