Update for Season 2026
All checks were successful
Build Formula12 Docker Image / pocketbase-docker (push) Successful in 39s

This commit is contained in:
2026-02-15 00:05:58 +01:00
parent ba307eb4c4
commit f8829cf401
22 changed files with 99 additions and 115 deletions

View File

@ -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

View File

@ -1,5 +1,5 @@
rec {
description = "Formula11";
description = "Formula12";
inputs = {
nixpkgs.url = "nixpkgs"; # Use nixpkgs from system registry

View File

@ -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
</Dropdown>
<!-- Doohan Starts -->
<Input
type="number"
min={0}
max={24}
bind:value={doohan_value}
<!-- Liveries -->
<Dropdown
bind:value={liveries_value}
options={team_dropdown_options(teams)}
{labelwidth}
{disabled}
{required}
>
Doohan Starts
</Input>
Most Liveries
</Dropdown>
<!-- Teamwinners autocomplete chips -->
<InputChip

View File

@ -88,7 +88,7 @@ export interface SeasonPick {
wccwinner: string;
mostovertakes: string;
mostdnfs: string;
doohanstarts: number;
liveries: string;
teamwinners: string[];
podiums: string[];
expand: {
@ -116,7 +116,7 @@ export interface SeasonPickResult {
wccwinner: string;
mostovertakes: string[];
mostdnfs: string[];
doohanstarts: number;
liveries: string;
teamwinners: string[];
podiums: string[];
}
@ -175,7 +175,7 @@ export interface SeasonPickPoints {
hottake_points: number;
wdc_points: number;
wcc_points: number;
doohan_points: number;
liveries_points: number;
overtakes_points: number;
dnfs_points: number;
teamwinner_points: number;

View File

@ -598,7 +598,7 @@
<!-- Site logo -->
<Button href="/racepicks" color="primary">
<span class="text-xl font-bold">Formula 11</span>
<span class="text-xl font-bold">Formula 12</span>
</Button>
</div>
</svelte:fragment>

View File

@ -25,7 +25,7 @@
</script>
<svelte:head>
<title>Formula 11 - Official Driver Standings</title>
<title>Formula 12 - Official Driver Standings</title>
</svelte:head>
{#await data.scraped_driverstandings then standings}

View File

@ -43,7 +43,7 @@
</script>
<svelte:head>
<title>Formula 11 - Official Race Results</title>
<title>Formula 12 - Official Race Results</title>
</svelte:head>
{#await data.scraped_raceresults then results}

View File

@ -37,7 +37,7 @@
</script>
<svelte:head>
<title>Formula 11 - Official Starting Grids</title>
<title>Formula 12 - Official Starting Grids</title>
</svelte:head>
{#await data.scraped_startinggrids then grids}

View File

@ -25,7 +25,7 @@
</script>
<svelte:head>
<title>Formula 11 - Official Team Standings</title>
<title>Formula 12 - Official Team Standings</title>
</svelte:head>
{#await data.scraped_teamstandings then standings}

View File

@ -91,7 +91,7 @@
</script>
<svelte:head>
<title>Formula 11 - Race Results</title>
<title>Formula 12 - Race Results</title>
</svelte:head>
<div class="pb-2">

View File

@ -72,7 +72,7 @@
</script>
<svelte:head>
<title>Formula 11 - Drivers</title>
<title>Formula 12 - Drivers</title>
</svelte:head>
<div class="flex gap-2 pb-2">

View File

@ -63,7 +63,7 @@
</script>
<svelte:head>
<title>Formula 11 - Races</title>
<title>Formula 12 - Races</title>
</svelte:head>
<div class="pb-2">

View File

@ -63,7 +63,7 @@
</script>
<svelte:head>
<title>Formula 11 - Substitutions</title>
<title>Formula 12 - Substitutions</title>
</svelte:head>
<div class="pb-2">

View File

@ -46,7 +46,7 @@
</script>
<svelte:head>
<title>Formula 11 - Teams</title>
<title>Formula 12 - Teams</title>
</svelte:head>
<div class="pb-2">

View File

@ -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 @@
</script>
<svelte:head>
<title>Formula 11 - Season Pick Results</title>
<title>Formula 12 - Season Pick Results</title>
</svelte:head>
<div class="pb-2">
@ -445,32 +438,31 @@
</Card>
</div>
<!-- Doohan Starts -->
<!-- Liveries -->
<div class="mt-2">
<Card
imgsrc={get_by_value<Driver>(drivers, "code", "DOO")?.headshot_url ??
get_driver_headshot_template(graphics)}
imgid="doohan_headshot"
imgsrc={get_by_value<Team>(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"
>
<h1 class="mb-2 text-lg font-bold">How often did JACK DOOHAN start?</h1>
<Input
bind:value={doohan_starts}
placeholder="JACK DOOHAN"
type="number"
required
min="0"
max="24"
<h1 class="mb-2 text-lg font-bold">Which constructor had the most liveries this season?</h1>
<Dropdown
bind:value={liveries}
options={team_dropdown_options(teams)}
{labelwidth}
{disabled}
class="w-full"
required
>
Doohan Starts
</Input>
Most Liveries
</Dropdown>
</Card>
</div>

View File

@ -40,7 +40,7 @@
</script>
<svelte:head>
<title>Formula 11 - Users</title>
<title>Formula 12 - Users</title>
</svelte:head>
<Table

View File

@ -62,7 +62,7 @@
p.dnfs_points +
p.teamwinner_points +
p.podium_points +
p.doohan_points
p.liveries_points
);
};
@ -148,7 +148,7 @@
</script>
<svelte:head>
<title>Formula 11 - Leaderboard</title>
<title>Formula 12 - Leaderboard</title>
</svelte:head>
<div class="card w-full bg-surface-100 p-2 shadow">

View File

@ -65,7 +65,7 @@
</script>
<svelte:head>
<title>Formula 11 - Race Picks</title>
<title>Formula 12 - Race Picks</title>
</svelte:head>
<!-- Only show the userguess if signed in and we have a next race -->

View File

@ -3,7 +3,7 @@
</script>
<svelte:head>
<title>Formula 11 - Rules</title>
<title>Formula 12 - Rules</title>
</svelte:head>
<div class="grid grid-cols-1 gap-2 xl:grid-cols-4">

View File

@ -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<SeasonPickedUser[]> = $derived.by(async () =>
(await data.seasonpickedusers).filter(
@ -87,7 +72,7 @@
</script>
<svelte:head>
<title>Formula 11 - Season Picks</title>
<title>Formula 12 - Season Picks</title>
</svelte:head>
<!-- Await this here so the accordion doesn't lag when opening -->
@ -125,14 +110,19 @@
<span class="text-sm">{data.seasonpick?.hottake}</span>
</div>
<!-- Doohanstarts -->
<div class="card w-full min-w-40 p-2 lg:max-w-40">
<h1 class="mb-2 text-nowrap font-bold">Doohan Starts:</h1>
{#if data.seasonpick}
<span class="text-sm">
Jack Doohan startet {data.seasonpick?.doohanstarts} mal.
</span>
{/if}
<!-- Liveries -->
<div class="card w-full min-w-40 p-2 pb-0 lg:max-w-40">
<h1 class="mb-2 text-nowrap font-bold">Most Liveries:</h1>
<LazyImage
src={get_by_value(teams, "id", data.seasonpick?.liveries ?? "")?.banner_url ??
get_team_banner_template(data.graphics)}
imgwidth={TEAM_BANNER_WIDTH}
imgheight={TEAM_BANNER_HEIGHT}
containerstyle="height: 80px; margin: auto;"
imgclass="bg-transparent cursor-pointer rounded-md"
hoverzoom
onclick={seasonpick_handler}
/>
</div>
<!-- WDC -->
@ -359,14 +349,16 @@
<span class="block rotate-90 text-nowrap text-xs font-bold lg:hidden">DNFs</span>
</div>
<!-- Doohan Starts -->
<!-- Liveries -->
<div class="card mt-1 flex h-20 w-7 flex-col !rounded-r-none bg-surface-400 p-2 lg:w-36">
<span class="hidden text-nowrap text-sm font-bold lg:block">Doohan Starts</span>
<span class="block rotate-90 text-nowrap text-xs font-bold lg:hidden">Doohan</span>
<span class="hidden text-nowrap text-sm font-bold lg:block">Most Liveries</span>
<span class="block rotate-90 text-nowrap text-xs font-bold lg:hidden">Liveries</span>
</div>
<!-- Teamwinners -->
<div class="card mt-1 flex h-64 w-7 flex-col !rounded-r-none bg-surface-400 p-2 lg:w-36">
<div
class="card mt-1 flex h-[278px] w-7 flex-col !rounded-r-none bg-surface-400 p-2 lg:w-36"
>
<span class="hidden text-nowrap text-sm font-bold lg:block"
>Team-Battle<br />Winners</span
>
@ -374,7 +366,9 @@
</div>
<!-- Podiums -->
<div class="card mt-1 flex h-64 w-7 flex-col !rounded-r-none bg-surface-400 p-2 lg:w-36">
<div
class="card mt-1 flex h-[278px] w-7 flex-col !rounded-r-none bg-surface-400 p-2 lg:w-36"
>
<span class="hidden text-nowrap text-sm font-bold lg:block">Podiums</span>
<span class="block rotate-90 text-nowrap text-xs font-bold lg:hidden">Podiums</span>
</div>
@ -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 @@
</div>
</div>
<!-- Doohan Starts -->
<!-- Liveries -->
<div
class="mt-1 h-20 w-full border bg-surface-200 p-1 px-1 py-2 leading-3 lg:px-2 {Math.abs(
(seasonpickresult?.doohanstarts ?? 0) - pick?.doohanstarts,
) === correct_doohanstarts
class="mt-1 h-20 w-full border bg-surface-200 p-1 px-1 py-2 leading-3 lg:px-2 {seasonpickresult?.liveries ===
liveries?.id
? '!bg-tertiary-500'
: seasonpickresult
? '!bg-primary-500'
: ''}"
>
<div class="mx-auto w-fit text-xs lg:text-sm">
Jack Doohan startet <span class="font-bold">{pick?.doohanstarts ?? "?"}</span> mal.
<div class="mx-auto w-fit">
<LazyImage
src={liveries?.banner_url ?? get_team_banner_template(data.graphics)}
imgwidth={TEAM_BANNER_WIDTH}
imgheight={TEAM_BANNER_HEIGHT}
containerstyle="height: 62px;"
imgclass="bg-surface-400 rounded-md"
tooltip={liveries?.name}
/>
</div>
</div>
<!-- Teamwinners -->
<div
class="mt-1 h-64 w-full overflow-y-scroll border bg-surface-200 p-1 px-1 py-2 leading-3 lg:px-2"
class="mt-1 h-[278px] w-full overflow-y-scroll border bg-surface-200 p-1 px-1 py-2 leading-3 lg:px-2"
>
{#if pick && pick.teamwinners}
<div class="grid grid-cols-2 gap-1">
@ -562,7 +563,7 @@
<!-- Podiums -->
<!-- TODO: Replace all style tags throughout the page with custom classes like height here -->
<div
class="mt-1 h-64 w-full overflow-y-scroll border bg-surface-200 p-1 px-1 py-2 leading-3 shadow lg:px-2"
class="mt-1 h-[278px] w-full overflow-y-scroll border bg-surface-200 p-1 px-1 py-2 leading-3 shadow lg:px-2"
>
{#if pick && pick.podiums}
<div class="grid grid-cols-2 gap-1">

View File

@ -91,7 +91,7 @@
</script>
<svelte:head>
<title>Formula 11 - Statistics</title>
<title>Formula 12 - Statistics</title>
</svelte:head>
<div class="card w-full bg-surface-100 p-2 shadow">