Disable lazyloaded images for Collage

This commit is contained in:
2022-05-23 12:08:20 +02:00
parent 5b3fbb7ece
commit f417b80aab
2 changed files with 8 additions and 4 deletions

View File

@@ -9,6 +9,7 @@
export let location: any = undefined export let location: any = undefined
export let city: string = undefined export let city: string = undefined
export let hovered: boolean = false export let hovered: boolean = false
export let lazy: boolean = true
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const sizes = { const sizes = {
@@ -30,11 +31,12 @@
{#if url} {#if url}
<a href={url} sveltekit:noscroll> <a href={url} sveltekit:noscroll>
<Image <Image
id={id} {id}
sizeKey="postcard" sizeKey="postcard"
{sizes} {sizes}
ratio={1.5} ratio={1.5}
alt={alt} {alt}
{lazy}
/> />
{#if title && location} {#if title && location}
<div class="photo-card__info"> <div class="photo-card__info">
@@ -51,11 +53,12 @@
</a> </a>
{:else} {:else}
<Image <Image
id={id} {id}
sizeKey="postcard" sizeKey="postcard"
{sizes} {sizes}
ratio={1.5} ratio={1.5}
alt={alt} {alt}
{lazy}
/> />
{/if} {/if}
</div> </div>

View File

@@ -17,6 +17,7 @@
location={location} location={location}
city={city} city={city}
hovered={hovered === index} hovered={hovered === index}
lazy={false}
on:hover={({ detail }) => hovered = detail ? index : null} on:hover={({ detail }) => hovered = detail ? index : null}
/> />
{/each} {/each}