Add link to Poster component and make a better hover
Buttons are now under the image, creating a parallax scale effect
This commit is contained in:
@@ -8,17 +8,19 @@
|
||||
|
||||
<div class="poster">
|
||||
{#if image}
|
||||
<Image
|
||||
id={image.id}
|
||||
sizeKey="product"
|
||||
sizes={{
|
||||
small: { width: 326 },
|
||||
medium: { width: 326 },
|
||||
large: { width: 326 },
|
||||
}}
|
||||
ratio={1.5}
|
||||
alt="Poster of {location.name}"
|
||||
/>
|
||||
<a href="/shop/poster-{location.slug}">
|
||||
<Image
|
||||
id={image.id}
|
||||
sizeKey="product"
|
||||
sizes={{
|
||||
small: { width: 326 },
|
||||
medium: { width: 326 },
|
||||
large: { width: 326 },
|
||||
}}
|
||||
ratio={1.5}
|
||||
alt="Poster of {location.name}"
|
||||
/>
|
||||
</a>
|
||||
{/if}
|
||||
<div class="buttons">
|
||||
<Button
|
||||
|
||||
@@ -9,7 +9,16 @@
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
& > a {
|
||||
display: block;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
// Poster image
|
||||
img {
|
||||
pointer-events: auto;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
@@ -21,26 +30,26 @@
|
||||
transition: transform 0.8s var(--ease-quart), border-radius 0.8s var(--ease-quart);
|
||||
}
|
||||
|
||||
// Buttons
|
||||
.buttons {
|
||||
display: flex;
|
||||
margin-top: 40px;
|
||||
justify-content: center;
|
||||
// opacity: 0;
|
||||
transform: translate3d(0, 48px, 0);
|
||||
transition: transform 0.8s var(--ease-quart), opacity 0.4s var(--ease-quart);
|
||||
transform: translate3d(0, 100%, 0);
|
||||
transition: transform 0.8s var(--ease-quart);
|
||||
|
||||
@include bp (sm) {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 4.25%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
bottom: 14px;
|
||||
left: 10%;
|
||||
right: 10%;
|
||||
}
|
||||
|
||||
a {
|
||||
margin-right: 8px;
|
||||
margin-left: 8px;
|
||||
margin: 0 clamp(4px, 0.3vw, 8px);
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@@ -52,10 +61,7 @@
|
||||
border-radius: 8px;
|
||||
}
|
||||
.buttons {
|
||||
opacity: 1;
|
||||
transform: translate3d(0,0,0);
|
||||
// transition-delay: 50ms;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user