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:
@@ -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}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user