From af04709fe16ea9463179a0c3c11d227e83b548d1 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Fri, 4 Mar 2022 20:23:58 +0100 Subject: add save bot form --- web/pw-server/src/lib/components/SubmitPane.svelte | 46 ++++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'web/pw-server/src/lib') diff --git a/web/pw-server/src/lib/components/SubmitPane.svelte b/web/pw-server/src/lib/components/SubmitPane.svelte index cfdb672..d647b46 100644 --- a/web/pw-server/src/lib/components/SubmitPane.svelte +++ b/web/pw-server/src/lib/components/SubmitPane.svelte @@ -4,6 +4,7 @@ let availableBots: object[] = []; let selectedOpponent = "simplebot"; + let botName: string | undefined = undefined; const optionIdentifier = "name"; const labelIdentifier = "name"; @@ -23,8 +24,14 @@ const dispatch = createEventDispatcher(); - function submit() { - dispatch("submit"); + function submitBot() { + dispatch("submitBot"); + } + + function saveBot() { + dispatch("saveBot", { + botName: botName, + }); } @@ -39,7 +46,12 @@ bind:value={selectedOpponent} /> - + + +
+

Save your bot

+ +
@@ -47,12 +59,29 @@ .submit-pane { margin: 20px; flex: 1; + display: flex; + flex-direction: column; } .opponentSelect { margin: 20px 0; } + .save-form { + margin-top: 8em; + } + + .submit-button { + padding: 8px 16px; + border-radius: 8px; + border: 0; + font-size: 18pt; + display: block; + margin: 10px auto; + background-color: lightgreen; + cursor: pointer; + } + .play-button { padding: 8px 16px; border-radius: 8px; @@ -63,4 +92,15 @@ background-color: lightgreen; cursor: pointer; } + + .bot-name-input { + width: 100%; + } + + .save-button { + background-color: lightgreen; + cursor: pointer; + padding: 8px 16px; + border: 0; + } -- cgit v1.2.3