diff --git a/.gitea/workflows/formula11-docker.yaml b/.gitea/workflows/formula12-docker.yaml similarity index 70% rename from .gitea/workflows/formula11-docker.yaml rename to .gitea/workflows/formula12-docker.yaml index 2178fc4..25d8587 100644 --- a/.gitea/workflows/formula11-docker.yaml +++ b/.gitea/workflows/formula12-docker.yaml @@ -1,4 +1,4 @@ -name: Build Formula11 Docker Image +name: Build Formula12 Docker Image on: push: @@ -19,7 +19,7 @@ jobs: registry: gitea.vps.chriphost.de username: ${{ secrets.CONTAINER_REGISTRY_USER }} password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} - - name: Build Formula11 Docker Image - run: docker build --file formula11.dockerfile --tag gitea.vps.chriphost.de/christoph/formula11:latest . - - name: Push Formula11 Docker Image - run: docker push gitea.vps.chriphost.de/christoph/formula11:latest + - name: Build Formula12 Docker Image + run: docker build --file formula12.dockerfile --tag gitea.vps.chriphost.de/christoph/formula12:latest . + - name: Push Formula12 Docker Image + run: docker push gitea.vps.chriphost.de/christoph/formula12:latest diff --git a/flake.nix b/flake.nix index d5c4cb4..781acf5 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ rec { - description = "Formula11"; + description = "Formula12"; inputs = { nixpkgs.url = "nixpkgs"; # Use nixpkgs from system registry diff --git a/formula11.dockerfile b/formula12.dockerfile similarity index 100% rename from formula11.dockerfile rename to formula12.dockerfile diff --git a/src/lib/components/cards/SeasonPickCard.svelte b/src/lib/components/cards/SeasonPickCard.svelte index 7d7f586..e73c6d8 100644 --- a/src/lib/components/cards/SeasonPickCard.svelte +++ b/src/lib/components/cards/SeasonPickCard.svelte @@ -55,7 +55,7 @@ let wcc_value: string = $state(seasonpick?.wccwinner ?? ""); let overtakes_value: string = $state(seasonpick?.mostovertakes ?? ""); let dnfs_value: string = $state(seasonpick?.mostdnfs ?? ""); - let doohan_value: string = $state(seasonpick?.doohanstarts.toString() ?? ""); + let liveries_value: string = $state(seasonpick?.liveries ?? ""); let teamwinners_input: string = $state(""); let teamwinners_chips: string[] = $state([]); @@ -140,7 +140,7 @@ if (disabled || !drivers) return; // Can only select 10 drivers - if (teamwinners_chips.length >= 10) return; + if (teamwinners_chips.length >= 11) return; // Can only select a driver once if (teamwinners_chips.includes(event.detail.value)) return; @@ -208,18 +208,11 @@ toastStore.trigger(get_error_toast("Please select a driver for most DNFs!")); return; } - if ( - !doohan_value || - doohan_value === "" || - parseInt(doohan_value) <= 0 || - parseInt(doohan_value) > 24 - ) { - toastStore.trigger( - get_error_toast("Please enter between 0 and 24 starts for Jack Doohan!"), - ); + if (!liveries_value || liveries_value === "") { + toastStore.trigger(get_error_toast("Please select a team for most liveries!")); return; } - if (!teamwinners_ids || teamwinners_ids.length !== 10) { + if (!teamwinners_ids || teamwinners_ids.length !== 11) { toastStore.trigger(get_error_toast("Please select a winner for each team!")); return; } @@ -235,7 +228,7 @@ wccwinner: wcc_value, mostovertakes: overtakes_value, mostdnfs: dnfs_value, - doohanstarts: doohan_value, + liveries: liveries_value, teamwinners: teamwinners_ids, podiums: podiums_ids, }; @@ -324,18 +317,16 @@ Most DNFs - - + - Doohan Starts - + Most Liveries + diff --git a/src/routes/data/official/driverstandings/+page.svelte b/src/routes/data/official/driverstandings/+page.svelte index 44832c6..35e36c5 100644 --- a/src/routes/data/official/driverstandings/+page.svelte +++ b/src/routes/data/official/driverstandings/+page.svelte @@ -25,7 +25,7 @@ - Formula 11 - Official Driver Standings + Formula 12 - Official Driver Standings {#await data.scraped_driverstandings then standings} diff --git a/src/routes/data/official/raceresults/+page.svelte b/src/routes/data/official/raceresults/+page.svelte index 44febb6..a65f6f9 100644 --- a/src/routes/data/official/raceresults/+page.svelte +++ b/src/routes/data/official/raceresults/+page.svelte @@ -43,7 +43,7 @@ - Formula 11 - Official Race Results + Formula 12 - Official Race Results {#await data.scraped_raceresults then results} diff --git a/src/routes/data/official/startinggrids/+page.svelte b/src/routes/data/official/startinggrids/+page.svelte index a794578..9fe2d96 100644 --- a/src/routes/data/official/startinggrids/+page.svelte +++ b/src/routes/data/official/startinggrids/+page.svelte @@ -37,7 +37,7 @@ - Formula 11 - Official Starting Grids + Formula 12 - Official Starting Grids {#await data.scraped_startinggrids then grids} diff --git a/src/routes/data/official/teamstandings/+page.svelte b/src/routes/data/official/teamstandings/+page.svelte index c3255f9..688e3a1 100644 --- a/src/routes/data/official/teamstandings/+page.svelte +++ b/src/routes/data/official/teamstandings/+page.svelte @@ -25,7 +25,7 @@ - Formula 11 - Official Team Standings + Formula 12 - Official Team Standings {#await data.scraped_teamstandings then standings} diff --git a/src/routes/data/raceresults/+page.svelte b/src/routes/data/raceresults/+page.svelte index dee023d..e25d8be 100644 --- a/src/routes/data/raceresults/+page.svelte +++ b/src/routes/data/raceresults/+page.svelte @@ -91,7 +91,7 @@ - Formula 11 - Race Results + Formula 12 - Race Results
diff --git a/src/routes/data/season/drivers/+page.svelte b/src/routes/data/season/drivers/+page.svelte index f70ab69..183ab81 100644 --- a/src/routes/data/season/drivers/+page.svelte +++ b/src/routes/data/season/drivers/+page.svelte @@ -72,7 +72,7 @@ - Formula 11 - Drivers + Formula 12 - Drivers
diff --git a/src/routes/data/season/races/+page.svelte b/src/routes/data/season/races/+page.svelte index 0b84a0b..9c7a208 100644 --- a/src/routes/data/season/races/+page.svelte +++ b/src/routes/data/season/races/+page.svelte @@ -63,7 +63,7 @@ - Formula 11 - Races + Formula 12 - Races
diff --git a/src/routes/data/season/substitutions/+page.svelte b/src/routes/data/season/substitutions/+page.svelte index bb24a54..21196a4 100644 --- a/src/routes/data/season/substitutions/+page.svelte +++ b/src/routes/data/season/substitutions/+page.svelte @@ -63,7 +63,7 @@ - Formula 11 - Substitutions + Formula 12 - Substitutions
diff --git a/src/routes/data/season/teams/+page.svelte b/src/routes/data/season/teams/+page.svelte index e94bb90..db96b9a 100644 --- a/src/routes/data/season/teams/+page.svelte +++ b/src/routes/data/season/teams/+page.svelte @@ -46,7 +46,7 @@ - Formula 11 - Teams + Formula 12 - Teams
diff --git a/src/routes/data/seasonpickresults/+page.svelte b/src/routes/data/seasonpickresults/+page.svelte index d45cd6e..0e9a0cd 100644 --- a/src/routes/data/seasonpickresults/+page.svelte +++ b/src/routes/data/seasonpickresults/+page.svelte @@ -78,7 +78,7 @@ let wdcwinner_select_value: string = $state("INVALID"); let wccwinner_select_value: string = $state("INVALID"); - let doohan_starts: string = $state("INVALID"); + let liveries: string = $state("INVALID"); let overtakes_input: string = $state(""); let overtakes_chips: string[] = $state([]); @@ -99,7 +99,7 @@ wdcwinner_select_value = result.wdcwinner; wccwinner_select_value = result.wccwinner; - doohan_starts = result.doohanstarts.toString(); + liveries = result.liveries; }); // Set the teamwinners/podiums states once the drivers are loaded @@ -249,7 +249,7 @@ if (disabled || !drivers) return; // Can only select 10 drivers - if (teamwinners_chips.length >= 10) return; + if (teamwinners_chips.length >= 11) return; // Can only select a driver once if (teamwinners_chips.includes(event.detail.value)) return; @@ -313,18 +313,11 @@ toastStore.trigger(get_error_toast("Please select a driver for most DNFs!")); return; } - if ( - !doohan_starts || - doohan_starts === "" || - parseInt(doohan_starts) <= 0 || - parseInt(doohan_starts) > 24 - ) { - toastStore.trigger( - get_error_toast("Please enter between 0 and 24 starts for Jack Doohan!"), - ); + if (!liveries || liveries === "") { + toastStore.trigger(get_error_toast("Please select a team for most liveries!")); return; } - if (!teamwinners_ids || teamwinners_ids.length !== 10) { + if (!teamwinners_ids || teamwinners_ids.length !== 11) { toastStore.trigger(get_error_toast("Please select a winner for each team!")); return; } @@ -342,7 +335,7 @@ wccwinner: wccwinner_select_value, mostovertakes: overtakes_ids, mostdnfs: dnfs_ids, - doohanstarts: doohan_starts, + liveries: liveries, teamwinners: teamwinners_ids, podiums: podiums_ids, }; @@ -369,7 +362,7 @@ - Formula 11 - Season Pick Results + Formula 12 - Season Pick Results
@@ -445,32 +438,31 @@
- +
(drivers, "code", "DOO")?.headshot_url ?? - get_driver_headshot_template(graphics)} - imgid="doohan_headshot" + imgsrc={get_by_value(teams, "id", liveries)?.banner_url ?? + get_team_banner_template(graphics)} + imgid="liveries_banner" width="w-full h-32" - imgwidth={DRIVER_HEADSHOT_WIDTH} - imgheight={DRIVER_HEADSHOT_HEIGHT} + imgwidth={TEAM_BANNER_WIDTH} + imgheight={TEAM_BANNER_HEIGHT} imgleft={true} imgshadow={false} - extraimgclass="mt-[20px]" + extraimgclass="mt-[16px] rounded-r-md" extraclass="w-full" > -

How often did JACK DOOHAN start?

- Which constructor had the most liveries this season? + - Doohan Starts - + Most Liveries +
diff --git a/src/routes/data/users/+page.svelte b/src/routes/data/users/+page.svelte index 5e58a89..d6d93d1 100644 --- a/src/routes/data/users/+page.svelte +++ b/src/routes/data/users/+page.svelte @@ -40,7 +40,7 @@ - Formula 11 - Users + Formula 12 - Users - Formula 11 - Leaderboard + Formula 12 - Leaderboard
diff --git a/src/routes/racepicks/+page.svelte b/src/routes/racepicks/+page.svelte index 5631124..6cb4cd7 100644 --- a/src/routes/racepicks/+page.svelte +++ b/src/routes/racepicks/+page.svelte @@ -65,7 +65,7 @@ - Formula 11 - Race Picks + Formula 12 - Race Picks diff --git a/src/routes/rules/+page.svelte b/src/routes/rules/+page.svelte index 53a4851..3abd056 100644 --- a/src/routes/rules/+page.svelte +++ b/src/routes/rules/+page.svelte @@ -3,7 +3,7 @@ - Formula 11 - Rules + Formula 12 - Rules
diff --git a/src/routes/seasonpicks/+page.svelte b/src/routes/seasonpicks/+page.svelte index b0be61c..7ccde8f 100644 --- a/src/routes/seasonpicks/+page.svelte +++ b/src/routes/seasonpicks/+page.svelte @@ -56,21 +56,6 @@ } }); - let correct_doohanstarts: number | undefined = $state(undefined); - Promise.all([data.seasonpickresults, data.seasonpicks]).then( - ([results, picks]: [SeasonPickResult[], SeasonPick[]]) => { - if (results.length === 1) { - let result = results[0]; - - correct_doohanstarts = Math.min( - ...picks.map((pick: SeasonPick) => { - return Math.abs(pick.doohanstarts - result.doohanstarts); - }), - ); - } - }, - ); - // Users that have already picked the season let pickedusers: Promise = $derived.by(async () => (await data.seasonpickedusers).filter( @@ -87,7 +72,7 @@ - Formula 11 - Season Picks + Formula 12 - Season Picks @@ -125,14 +110,19 @@ {data.seasonpick?.hottake}
- -
-

Doohan Starts:

- {#if data.seasonpick} - - Jack Doohan startet {data.seasonpick?.doohanstarts} mal. - - {/if} + +
+

Most Liveries:

+
@@ -359,14 +349,16 @@ DNFs
- +
- - Doohan + + Liveries
-
+
@@ -374,7 +366,9 @@
-
+
Podiums
@@ -395,6 +389,7 @@ {@const mostovertakes = pick ? get_by_value(drivers, "id", pick.mostovertakes) : undefined} + {@const liveries = pick ? get_by_value(teams, "id", pick.liveries) : undefined} {@const mostdnfs = pick ? get_by_value(drivers, "id", pick.mostdnfs) : undefined} {@const drivers_startedactive = drivers .filter((driver: Driver) => driver.started_active) @@ -507,24 +502,30 @@
- +
-
- Jack Doohan startet {pick?.doohanstarts ?? "?"} mal. +
+
{#if pick && pick.teamwinners}
@@ -562,7 +563,7 @@
{#if pick && pick.podiums}
diff --git a/src/routes/statistics/+page.svelte b/src/routes/statistics/+page.svelte index a035603..a8456d7 100644 --- a/src/routes/statistics/+page.svelte +++ b/src/routes/statistics/+page.svelte @@ -91,7 +91,7 @@ - Formula 11 - Statistics + Formula 12 - Statistics