diff --git a/src/lib/components/DriverCard.svelte b/src/lib/components/DriverCard.svelte index cc5124c..652c9db 100644 --- a/src/lib/components/DriverCard.svelte +++ b/src/lib/components/DriverCard.svelte @@ -6,7 +6,12 @@ import type { Driver } from "$lib/schema"; import Input from "./Input.svelte"; import LazyDropdown, { type LazyDropdownOption } from "./LazyDropdown.svelte"; - import { DRIVER_HEADSHOT_HEIGHT, DRIVER_HEADSHOT_WIDTH } from "$lib/config"; + import { + DRIVER_CARD_ASPECT_HEIGHT, + DRIVER_CARD_ASPECT_WIDTH, + DRIVER_HEADSHOT_HEIGHT, + DRIVER_HEADSHOT_WIDTH, + } from "$lib/config"; interface DriverCardProps { /** The [Driver] object used to prefill values. */ @@ -43,7 +48,8 @@ - // The first element of a group of cards (e.g. driver cards or team cards) - // will register its height here, once its fully loaded. - // This height is then used as the height of following components. - // This is necessary, because for lazy loading depending on viewport intersection, - // the elements must have their actual height from the beginning. - let group_heights: { [key: string]: number } = {}; - - -
- {#if group_heights[group]} - -
- - {#if imgsrc !== undefined} -
- {:else} - -
- - {#if imgsrc !== undefined} -
diff --git a/src/lib/components/RaceCard.svelte b/src/lib/components/RaceCard.svelte index 3015cc4..f59247c 100644 --- a/src/lib/components/RaceCard.svelte +++ b/src/lib/components/RaceCard.svelte @@ -6,7 +6,12 @@ import type { Race } from "$lib/schema"; import Input from "./Input.svelte"; import { format } from "date-fns"; - import { RACE_PICTOGRAM_HEIGHT, RACE_PICTOGRAM_WIDTH } from "$lib/config"; + import { + RACE_CARD_ASPECT_HEIGHT, + RACE_CARD_ASPECT_WIDTH, + RACE_PICTOGRAM_HEIGHT, + RACE_PICTOGRAM_WIDTH, + } from "$lib/config"; interface RaceCardProps { /** The [Race] object used to prefill values. */ @@ -56,7 +61,8 @@