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:
@@ -9,7 +9,7 @@
|
||||
export let photoAlt: string
|
||||
export let title: string
|
||||
export let index: string
|
||||
export let orientation: string = undefined
|
||||
export let ratio: number
|
||||
export let date: string = undefined
|
||||
export let city: string = undefined
|
||||
</script>
|
||||
@@ -31,25 +31,27 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<figure class="house__photo"
|
||||
class:not-landscape={orientation && orientation !== 'landscape'}
|
||||
<div class="house__photo"
|
||||
class:not-landscape={ratio < 1.475}
|
||||
>
|
||||
<a href={url} sveltekit:noscroll tabindex="0">
|
||||
<Image
|
||||
id={photoId}
|
||||
sizeKey="photo-list"
|
||||
sizes={{
|
||||
small: { width: 500 },
|
||||
medium: { width: 850 },
|
||||
large: { width: 1280 },
|
||||
}}
|
||||
ratio={1.5}
|
||||
alt={photoAlt}
|
||||
class="photo shadow-photo"
|
||||
/>
|
||||
<figure class="house__image shadow-photo">
|
||||
<Image
|
||||
id={photoId}
|
||||
sizeKey="photo-list"
|
||||
sizes={{
|
||||
small: { width: 500 },
|
||||
medium: { width: 850 },
|
||||
large: { width: 1280 },
|
||||
}}
|
||||
ratio={1.5}
|
||||
alt={photoAlt}
|
||||
class="photo"
|
||||
/>
|
||||
</figure>
|
||||
<span class="house__index title-index">
|
||||
{index}
|
||||
</span>
|
||||
</a>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user