diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index bc7ef2f..7e9ca2f 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -327,6 +327,7 @@ "raceresults", "races", "seasonpicks", + "seasonpickresults", "substitutions", "teams", "scraped_startinggrids", @@ -346,6 +347,7 @@ "raceresults", "races", "seasonpicks", + "seasonpickresults", "substitutions", "teams", "scraped_startinggrids", @@ -403,6 +405,15 @@ + + {:else} + + {/if} + +{#await Promise.all( [data.graphics, data.seasonpicks, data.users, data.seasonpickresults, data.drivers, data.teams], ) then [graphics, seasonpicks, users, seasonpickresults, drivers, teams]} +
+ + (drivers, "id", wdcwinner_select_value)?.headshot_url ?? + get_driver_headshot_template(graphics)} + imgid="wdcwinner_headshot" + width="w-full h-24" + imgwidth={DRIVER_HEADSHOT_WIDTH} + imgheight={DRIVER_HEADSHOT_HEIGHT} + imgleft={true} + imgshadow={false} + extraimgclass="mt-[11px]" + extraclass="w-full" + > +

Which driver fucking obliterated this season?

+ + WDC Winner + +
+ + + (teams, "id", wccwinner_select_value)?.banner_url ?? + get_team_banner_template(graphics)} + imgid="wccwinner_banner" + width="w-full h-24" + imgwidth={TEAM_BANNER_WIDTH} + imgheight={TEAM_BANNER_HEIGHT} + imgleft={true} + imgshadow={false} + extraimgclass="mt-[10px] rounded-r-md" + extraclass="w-full" + > +

Which constructor constructed the best this season?

+ + WCC Winner + +
+
+ + +
+ (drivers, "code", "DOO")?.headshot_url ?? + get_driver_headshot_template(graphics)} + imgid="doohan_headshot" + width="w-full h-24" + imgwidth={DRIVER_HEADSHOT_WIDTH} + imgheight={DRIVER_HEADSHOT_HEIGHT} + imgleft={true} + imgshadow={false} + extraimgclass="mt-[11px]" + extraclass="w-full" + > +

How often did JACK DOOHAN start?

+ + Doohan Starts + +
+
+ + +
+ {#each seasonpicks as seasonpick} + {@const user = get_by_value(users, "id", seasonpick.user)} + +
+
+ +
+ +
+

{user?.username ?? "INVALID"}'s Hottake 💀

+

+ "{seasonpick.hottake}" +

+
+ +
+

Correct:

+ +
+
+
+ {/each} +
+ +
+ + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
+ +
+
+{/await} diff --git a/src/routes/data/seasonpickresults/+page.ts b/src/routes/data/seasonpickresults/+page.ts new file mode 100644 index 0000000..ab559b5 --- /dev/null +++ b/src/routes/data/seasonpickresults/+page.ts @@ -0,0 +1,20 @@ +import { + fetch_drivers, + fetch_seasonpickresults, + fetch_teams, + fetch_users, + fetch_visibleseasonpicks, +} from "$lib/fetch"; +import type { PageLoad } from "../../$types"; + +export const load: PageLoad = async ({ fetch, depends }) => { + depends("data:drivers", "data:seasonpickresults", "data:users", "data:seasonpicks", "data:teams"); + + return { + users: fetch_users(fetch), + drivers: fetch_drivers(fetch), + teams: fetch_teams(fetch), + seasonpicks: fetch_visibleseasonpicks(fetch), + seasonpickresults: fetch_seasonpickresults(fetch), + }; +};