Hide fixed nav ShopLocationSwitcher on mobile
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
const { shop, shopLocations }: any = getContext('shop')
|
const { shop, shopLocations }: any = getContext('shop')
|
||||||
|
|
||||||
|
let innerWidth: number
|
||||||
let navObserver: IntersectionObserver
|
let navObserver: IntersectionObserver
|
||||||
let introEl: HTMLElement, navChooseEl: HTMLElement
|
let introEl: HTMLElement, navChooseEl: HTMLElement
|
||||||
let scrolledPastIntro = false
|
let scrolledPastIntro = false
|
||||||
@@ -104,6 +105,9 @@
|
|||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<svelte:window bind:innerWidth />
|
||||||
|
|
||||||
|
|
||||||
<section class="shop-page__intro" bind:this={introEl}>
|
<section class="shop-page__intro" bind:this={introEl}>
|
||||||
<div class="top container">
|
<div class="top container">
|
||||||
<a href="/" class="back" data-sveltekit-noscroll>
|
<a href="/" class="back" data-sveltekit-noscroll>
|
||||||
@@ -155,6 +159,8 @@
|
|||||||
class:is-visible={scrolledPastIntro}
|
class:is-visible={scrolledPastIntro}
|
||||||
class:is-overlaid={$cartOpen}
|
class:is-overlaid={$cartOpen}
|
||||||
>
|
>
|
||||||
<ShopLocationSwitcher />
|
{#if innerWidth > 768}
|
||||||
|
<ShopLocationSwitcher />
|
||||||
|
{/if}
|
||||||
<ButtonCart />
|
<ButtonCart />
|
||||||
</nav>
|
</nav>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
top: var(--inset);
|
top: var(--inset);
|
||||||
left: var(--inset);
|
left: var(--inset);
|
||||||
right: var(--inset);
|
right: var(--inset);
|
||||||
justify-content: space-between;
|
justify-content: flex-end;
|
||||||
transform: translate3d(0, -88px, 0);
|
transform: translate3d(0, -88px, 0);
|
||||||
transition: transform 1s var(--ease-quart);
|
transition: transform 1s var(--ease-quart);
|
||||||
transition-delay: 100ms;
|
transition-delay: 100ms;
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
@include bp (sm) {
|
@include bp (sm) {
|
||||||
--inset: 32px;
|
--inset: 32px;
|
||||||
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Visible state
|
// Visible state
|
||||||
|
|||||||
Reference in New Issue
Block a user