Hide fixed nav ShopLocationSwitcher on mobile

This commit is contained in:
2022-09-27 17:29:58 +02:00
parent c618a95188
commit 17ad74a59f
2 changed files with 9 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
const { shop, shopLocations }: any = getContext('shop')
let innerWidth: number
let navObserver: IntersectionObserver
let introEl: HTMLElement, navChooseEl: HTMLElement
let scrolledPastIntro = false
@@ -104,6 +105,9 @@
})
</script>
<svelte:window bind:innerWidth />
<section class="shop-page__intro" bind:this={introEl}>
<div class="top container">
<a href="/" class="back" data-sveltekit-noscroll>
@@ -155,6 +159,8 @@
class:is-visible={scrolledPastIntro}
class:is-overlaid={$cartOpen}
>
{#if innerWidth > 768}
<ShopLocationSwitcher />
{/if}
<ButtonCart />
</nav>

View File

@@ -11,7 +11,7 @@
top: var(--inset);
left: var(--inset);
right: var(--inset);
justify-content: space-between;
justify-content: flex-end;
transform: translate3d(0, -88px, 0);
transition: transform 1s var(--ease-quart);
transition-delay: 100ms;
@@ -19,6 +19,7 @@
@include bp (sm) {
--inset: 32px;
justify-content: space-between;
}
}
// Visible state