Fix Shop issues

- Move ButtonCart from nav to position it on top right
- ButtonCart amount indicator position (center left => top left)
- Bring back updating label when changing cart (+ other transitions)
- Make ShopHeader picture gradient a bit bigger
This commit is contained in:
2022-07-11 12:30:42 +02:00
parent f0907b0497
commit 120771efa1
7 changed files with 59 additions and 41 deletions

View File

@@ -150,7 +150,7 @@
/> />
{/each} {/each}
{:else} {:else}
<div class="cart__empty shadow-small"> <div class="cart__empty shadow-small" transition:fade={{ duration: 600 }}>
<div class="icon"> <div class="icon">
<Icon icon="bag" label="Shopping bag icon" /> <Icon icon="bag" label="Shopping bag icon" />
</div> </div>
@@ -159,7 +159,10 @@
{/if} {/if}
{#if !$cartData || $cartIsUpdating} {#if !$cartData || $cartIsUpdating}
<div class="cart__update" transition:fade={{ duration: 400 }}> <div class="cart__update"
in:fly={{ y: -4, duration: 600, easing: quartOut }}
out:fly={{ y: 4, duration: 600, easing: quartOut }}
>
<p>Updating…</p> <p>Updating…</p>
</div> </div>
{/if} {/if}

View File

@@ -53,7 +53,7 @@
// Hero title // Hero title
timeline.add({ timeline.add({
targets: '.shop-page__intro h1', targets: '.shop-page__title h1',
translateY: [32, 0], translateY: [32, 0],
opacity: [0, 1], opacity: [0, 1],
}, 500) }, 500)
@@ -67,8 +67,10 @@
// Intro navbar // Intro navbar
timeline.add({ timeline.add({
targets: '.shop-page__nav .container > *', targets: '.shop-page__nav .container > *, .shop-page__intro .button-cart',
opacity: [0, 1],
translateY: [100, 0], translateY: [100, 0],
translateZ: 0,
delay: anime.stagger(250), delay: anime.stagger(250),
}, 700) }, 700)
@@ -93,7 +95,9 @@
</a> </a>
</div> </div>
<h1>Shop</h1> <div class="shop-page__title">
<h1>Shop</h1>
</div>
<nav class="shop-page__nav"> <nav class="shop-page__nav">
<div class="container"> <div class="container">
@@ -109,11 +113,11 @@
{/each} {/each}
</ul> </ul>
</nav> </nav>
<ButtonCart />
</div> </div>
</nav> </nav>
<ButtonCart />
<Image <Image
class="shop-page__background" class="shop-page__background"
id={shop.page_heroimage.id} id={shop.page_heroimage.id}

View File

@@ -24,9 +24,9 @@
.quantity { .quantity {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
top: 50%; top: 0;
left: 2px; left: 0;
transform: translate3d(-50%, -50%, 0); transform: translateX(-33%);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@@ -185,7 +185,7 @@
// Updating message // Updating message
&__update { &__update {
position: absolute; position: absolute;
z-index: -1; z-index: 10;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
@@ -195,9 +195,6 @@
justify-content: center; justify-content: center;
font-size: rem(20px); font-size: rem(20px);
color: $color-secondary; color: $color-secondary;
transition: opacity 0.6s var(--ease-quart), transform 0.6s var(--ease-quart);
opacity: 0;
transform: translate3d(0, -8px, 0);
} }
// Location switcher // Location switcher
@@ -225,17 +222,13 @@
background: rgba($color-primary, 0.9); background: rgba($color-primary, 0.9);
cursor: w-resize; cursor: w-resize;
} }
}
// Updating state // Updating state
:global(.is-updating) { &.is-updating {
:global(.cart-item) { :global(.cart-item) {
opacity: 0.1; opacity: 0.1;
pointer-events: none; pointer-events: none;
user-select: none; user-select: none;
} }
:global(.cart__update) {
opacity: 1;
transform: translate3d(0,0,0);
} }
} }

View File

@@ -3,6 +3,7 @@
background: #fff; background: #fff;
color: $color-text; color: $color-text;
border-radius: 8px; border-radius: 8px;
transform: translateZ(0);
@include bp (sd) { @include bp (sd) {
border-radius: 12px; border-radius: 12px;

View File

@@ -71,18 +71,13 @@
} }
// Site Title // Site Title
:global(h1) { .shop-page__title {
position: absolute; position: absolute;
z-index: 2; z-index: 2;
top: 50%; top: 42%;
left: 50%; left: 50%;
width: 100%; width: 100%;
transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0);
font-size: clamp(#{rem(48px)}, 7vw, #{rem(56px)});
font-weight: 400;
text-shadow: 0px 8px 12px rgba(#000, 0.25);
text-align: center;
letter-spacing: -0.02em;
@include bp (sm) { @include bp (sm) {
// top: clamp(#{rem(40px)}, 16vw, #{rem(144px)}); // top: clamp(#{rem(40px)}, 16vw, #{rem(144px)});
@@ -91,11 +86,19 @@
transform: none; transform: none;
} }
:global(span), :global(strong) { :global(h1) {
color: #fff; font-size: clamp(#{rem(48px)}, 7vw, #{rem(56px)});
} font-weight: 400;
:global(span) { text-shadow: 0px 8px 12px rgba(#000, 0.25);
font-weight: 300; text-align: center;
letter-spacing: -0.02em;
:global(span), :global(strong) {
color: #fff;
}
:global(span) {
font-weight: 300;
}
} }
} }
@@ -120,15 +123,29 @@
// Gradient // Gradient
&:before { &:before {
display: block;
content: ""; content: "";
display: block;
position: absolute; position: absolute;
z-index: 1; z-index: 1;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background: linear-gradient(180deg, rgba(45, 4, 88, 0) 84.2%, #1E0538 100%); background: linear-gradient(180deg, rgba(45, 4, 88, 0) 72.5%, #1E0538 100%);
}
}
// Cart button
:global(.button-cart) {
position: absolute;
z-index: 2;
top: 16px;
right: 16px;
@include bp (sm) {
top: auto;
bottom: 32px;
right: 32px;
} }
} }
} }

View File

@@ -2,8 +2,8 @@
** Shop: Posters ** Shop: Posters
*/ */
.shop-page__posters { .shop-page__posters {
background-color: $color-primary-darker;
padding: clamp(56px, 10vw, 120px) 20px 72px; padding: clamp(56px, 10vw, 120px) 20px 72px;
background: $color-primary-darker;
border-bottom: solid 1px $color-primary-tertiary20 ; border-bottom: solid 1px $color-primary-tertiary20 ;
@include bp (sd) { @include bp (sd) {