feat: add global Toast with 10% offer for posters

This commit is contained in:
2023-06-11 22:41:01 +02:00
parent eb2be69957
commit fb21015f99
3 changed files with 38 additions and 1 deletions

View File

@@ -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">
import '../style/global.scss'
@@ -16,6 +32,7 @@
import SmoothScroll from '$components/SmoothScroll.svelte'
import Analytics from '$components/Analytics.svelte'
import Switcher from '$components/molecules/Switcher.svelte'
import Toast from '$components/molecules/Toast.svelte'
import Footer from '$components/organisms/Footer.svelte'
export let data
@@ -99,6 +116,21 @@
{/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 />
<SmoothScroll />