Rework Location page photos ratio and hover

Defines if the photo is under 3/2 by calculating ratio from width and height
This commit is contained in:
2022-06-13 22:19:38 +02:00
parent 0272e7ed18
commit d5b860da03
5 changed files with 71 additions and 69 deletions

View File

@@ -54,7 +54,6 @@ export async function get({ params }: RequestEvent): Promise<RequestHandlerOutpu
id
title
}
orientation
city
}

View File

@@ -264,14 +264,14 @@
{#if photos.length}
<section class="location-page__houses grid" bind:this={photosListEl}>
{#each photos as { title, image: { id, title: alt }, orientation, slug, city, date_taken }, index}
{#each photos as { title, image: { id, title: alt, width, height }, slug, city, date_taken }, index}
<House
{title}
photoId={id}
photoAlt={alt}
{orientation}
url="/{params.country}/{params.location}/{slug}"
{city}
ratio={width / height}
date={date_taken}
index={(totalPhotos - index < 10) ? '0' : ''}{totalPhotos - index}
/>

View File

@@ -8,8 +8,8 @@ export const photoFields = `
image {
id
title
width, height
}
orientation
date_taken
date_created
`