From cf4d98f480069b33339abb5f48d7650fc6b7b93a Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Tue, 18 Mar 2025 12:40:31 +0100 Subject: [PATCH] Seasonpicks: Add tooltips to small images (e.g. avatars, podiums, ...) --- src/routes/seasonpicks/+page.svelte | 55 ++++++++++++++++++----------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/src/routes/seasonpicks/+page.svelte b/src/routes/seasonpicks/+page.svelte index a1d71a7..d6a70cc 100644 --- a/src/routes/seasonpicks/+page.svelte +++ b/src/routes/seasonpicks/+page.svelte @@ -68,13 +68,13 @@ ? data.seasonpick.teamwinners .map((id: string) => get_by_value(drivers, "id", id) as Driver) .sort((a: Driver, b: Driver) => a.team.localeCompare(b.team)) - : [undefined]} + : undefined} {@const podiums = data.seasonpick ? data.seasonpick.podiums .map((id: string) => get_by_value(drivers, "id", id) as Driver) .sort((a: Driver, b: Driver) => a.code.localeCompare(b.code)) .sort((a: Driver, b: Driver) => a.team.localeCompare(b.team)) - : [undefined]} + : undefined} @@ -164,15 +164,18 @@

Teamwinners:

- {#each teamwinners as winner} - - {/each} + {#if teamwinners} + {#each teamwinners as winner} + + {/each} + {/if}
@@ -180,15 +183,18 @@

Podiums:

- {#each podiums as podium} - - {/each} + {#if podiums} + {#each podiums as podium} + + {/each} + {/if}
@@ -205,6 +211,7 @@ imgheight={AVATAR_HEIGHT} containerstyle="height: 35px; width: 35px;" imgclass="bg-surface-400 rounded-full" + tooltip={user.firstname} /> {/each} @@ -223,6 +230,7 @@ imgheight={AVATAR_HEIGHT} containerstyle="height: 35px; width: 35px;" imgclass="bg-surface-400 rounded-full" + tooltip={user.firstname} /> {/each} @@ -338,6 +346,7 @@ imgheight={AVATAR_HEIGHT} containerstyle="height: 40px; width: 40px;" imgclass="bg-surface-400 rounded-full" + tooltip={user.firstname} />
@@ -379,6 +389,7 @@ imgheight={TEAM_BANNER_HEIGHT} containerstyle="height: 62px;" imgclass="bg-surface-400 rounded-md" + tooltip={wccwinner?.name} /> @@ -392,6 +403,9 @@ imgheight={DRIVER_HEADSHOT_WIDTH} containerstyle="height: 62px;" imgclass="bg-surface-400 rounded-md" + tooltip={mostovertakes + ? `${mostovertakes.firstname} ${mostovertakes.lastname}` + : undefined} /> @@ -405,6 +419,7 @@ imgheight={DRIVER_HEADSHOT_WIDTH} containerstyle="height: 62px;" imgclass="bg-surface-400 rounded-md" + tooltip={mostdnfs ? `${mostdnfs.firstname} ${mostdnfs.lastname}` : undefined} />