Add a parent to each photo on Viewer

Allows to animate the parent that has no transform/top
This commit is contained in:
2021-11-30 19:47:42 +01:00
parent 47fee17eb8
commit 2522233a0e
2 changed files with 137 additions and 111 deletions

View File

@@ -242,18 +242,20 @@
<div class="viewer-photo__carousel">
<div class="viewer-photo__images" use:swipe on:swipe={handleSwipe} on:tap={toggleFullscreen}>
{#each visiblePhotos as photo, index (photo.id)}
<Image
class="photo photo--{currentIndex === 0 ? index + 1 : index}"
id={photo.image.id}
alt={photo.title}
sizeKey="photo-list"
sizes={{
small: { width: 500 },
medium: { width: 850 },
large: { width: 1280 },
}}
ratio={1.5}
/>
<div class="viewer-photo__picture is-{currentIndex === 0 ? index + 1 : index}">
<Image
class="photo"
id={photo.image.id}
alt={photo.title}
sizeKey="photo-list"
sizes={{
small: { width: 500 },
medium: { width: 850 },
large: { width: 1280 },
}}
ratio={1.5}
/>
</div>
{/each}
<div class="viewer-photo__controls">