diff --git a/backend.light/backend.light b/backend.light/backend.light index 6a77d56..db788bc 100755 Binary files a/backend.light/backend.light and b/backend.light/backend.light differ diff --git a/backend.light/http.go b/backend.light/http.go index ceaeae3..abd6c26 100644 --- a/backend.light/http.go +++ b/backend.light/http.go @@ -49,8 +49,8 @@ func (app *App) RegisterWebRoutes() { display_v := app.Engine.Group("/display-v") display_v.Static("/", "./static/display-v") - display_m := app.Engine.Group("/display-m") - display_m.Static("/", "./static/display-m") + mobile := app.Engine.Group("/mobile") + mobile.Static("/", "./static/mobile") priority := app.Engine.Group("/priority") priority.Static("/", "./static/priority") diff --git a/backend.light/priority.go b/backend.light/priority.go index 53ac981..cde07ff 100644 --- a/backend.light/priority.go +++ b/backend.light/priority.go @@ -3,6 +3,7 @@ package main type Priority struct { Surfers []Surfer `json:"surfers"` Count int `json:"count"` + Round Round `json:"round"` } type Surfer struct { @@ -10,3 +11,9 @@ type Surfer struct { Color string `json:"color"` Priority string `json:"priority"` } + +type Round struct { + Name string `json:"name"` + Heat int `json:"heat"` + Category string `json:"category"` +} diff --git a/frontend.light/src/lib/stores/categories.js b/frontend.light/src/lib/stores/categories.js new file mode 100644 index 0000000..391acf3 --- /dev/null +++ b/frontend.light/src/lib/stores/categories.js @@ -0,0 +1,12 @@ +import { readable } from "svelte/store" + +export const categories = readable([ + "Under 12 Women", + "Under 12 Men", + "Under 14 Women", + "Under 14 Men", + "Under 16 Women", + "Under 16 Men", + "Under 18 Women", + "Under 18 Men", +]); \ No newline at end of file diff --git a/frontend.light/src/lib/stores/rounds.js b/frontend.light/src/lib/stores/rounds.js new file mode 100644 index 0000000..8210b74 --- /dev/null +++ b/frontend.light/src/lib/stores/rounds.js @@ -0,0 +1,13 @@ +import {readable} from "svelte/store" + +export const rounds = readable([ + "Qualifying", + "Opening", + "Elimination", + "Round of 48", + "Round of 32", + "Round of 16", + "Quarterfinal", + "Semifinal", + "Final", +]); \ No newline at end of file diff --git a/frontend.light/src/lib/stores/surfers.js b/frontend.light/src/lib/stores/surfers.js index 5ff51f3..ed9e8ff 100644 --- a/frontend.light/src/lib/stores/surfers.js +++ b/frontend.light/src/lib/stores/surfers.js @@ -26,4 +26,10 @@ function createSurfers() { export const surfers = createSurfers() -export const surfersCount = writable(4) \ No newline at end of file +export const surfersCount = writable(4) + +export const round = writable({ + name: '', + heat: 0, + category: '' +}); diff --git a/frontend.light/src/routes/display-m/+page.svelte b/frontend.light/src/routes/display-m/+page.svelte deleted file mode 100644 index 9279557..0000000 --- a/frontend.light/src/routes/display-m/+page.svelte +++ /dev/null @@ -1,163 +0,0 @@ - - - - -
- -
- - - - - - - - diff --git a/frontend.light/src/routes/mobile/+page.svelte b/frontend.light/src/routes/mobile/+page.svelte new file mode 100644 index 0000000..124cef1 --- /dev/null +++ b/frontend.light/src/routes/mobile/+page.svelte @@ -0,0 +1,205 @@ + + + + +
+ {$round.name} + {$round.category} + Heat {$round.heat} +
+ +
+ {#each Array($surfersCount) as _, id} +
+
+ {#if $surfers[id].priority != ''} + {$surfers[id].priority} + {/if} +
+
{$surfers[id].name}
+
+ {/each} +
+ + diff --git a/frontend.light/src/routes/priority/+page.svelte b/frontend.light/src/routes/priority/+page.svelte index 467ef86..a5c6544 100644 --- a/frontend.light/src/routes/priority/+page.svelte +++ b/frontend.light/src/routes/priority/+page.svelte @@ -1,6 +1,6 @@ {#if start} @@ -235,7 +205,7 @@ {$surfers[id].priority} {/if} -
+
{$surfers[id].name}
{/each} @@ -254,23 +224,17 @@ style="background-color: {$surfers[id].color};" > {#each $colors as color} - + {/each} -
+
{/each}