feat: add global Toast with 10% offer for posters
This commit is contained in:
@@ -132,7 +132,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="cart__total--checkout">
|
<div class="cart__total--checkout">
|
||||||
<p>Free shipping worldwide!</p>
|
<p>Save 10% on your order with the code <strong>WORLDCITIZEN</strong>. Free shipping.</p>
|
||||||
{#if $cartData && $cartAmount > 0 && $cartData.checkout_url}
|
{#if $cartData && $cartAmount > 0 && $cartData.checkout_url}
|
||||||
<div transition:fly={{ y: 8, duration: 600, easing: quartOut }}>
|
<div transition:fly={{ y: 8, duration: 600, easing: quartOut }}>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
<style lang="scss">
|
||||||
|
// Toast
|
||||||
|
:global(.toast--global) {
|
||||||
|
position: fixed;
|
||||||
|
z-index: 20;
|
||||||
|
max-width: 420px;
|
||||||
|
bottom: var(--offset-sides);
|
||||||
|
right: var(--offset-sides);
|
||||||
|
left: calc(var(--offset-sides) + 44px + 24px);
|
||||||
|
|
||||||
|
@include bp (mob-lg) {
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import '../style/global.scss'
|
import '../style/global.scss'
|
||||||
|
|
||||||
@@ -16,6 +32,7 @@
|
|||||||
import SmoothScroll from '$components/SmoothScroll.svelte'
|
import SmoothScroll from '$components/SmoothScroll.svelte'
|
||||||
import Analytics from '$components/Analytics.svelte'
|
import Analytics from '$components/Analytics.svelte'
|
||||||
import Switcher from '$components/molecules/Switcher.svelte'
|
import Switcher from '$components/molecules/Switcher.svelte'
|
||||||
|
import Toast from '$components/molecules/Toast.svelte'
|
||||||
import Footer from '$components/organisms/Footer.svelte'
|
import Footer from '$components/organisms/Footer.svelte'
|
||||||
|
|
||||||
export let data
|
export let data
|
||||||
@@ -99,6 +116,21 @@
|
|||||||
{/key}
|
{/key}
|
||||||
|
|
||||||
|
|
||||||
|
{#if !['/[photo]'].some(sub => $page.route.id.includes(sub))}
|
||||||
|
<Toast
|
||||||
|
type="global"
|
||||||
|
id="posters-promo"
|
||||||
|
text="Upgrade your walls! <strong>10% off</strong> in cart with free shipping on our graphic posters."
|
||||||
|
cta={{
|
||||||
|
label: 'View posters',
|
||||||
|
url: '/shop',
|
||||||
|
color: 'pink',
|
||||||
|
}}
|
||||||
|
images={data.shop.module_images.map(({ directus_files_id: { id, title } }) => ({ id, title }))}
|
||||||
|
class="toast-home"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<SVGSprite />
|
<SVGSprite />
|
||||||
<SmoothScroll />
|
<SmoothScroll />
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,11 @@
|
|||||||
@include bp (md) {
|
@include bp (md) {
|
||||||
max-width: 304px;
|
max-width: 304px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:global(strong) {
|
||||||
|
font-weight: normal;
|
||||||
|
color: $color-secondary;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user