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

@@ -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}
/>