Skip to content

Commit

Permalink
Finish first take on mobile nav
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Jul 26, 2023
1 parent 729559d commit 319e385
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
20 changes: 9 additions & 11 deletions components/Nav/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ const dismiss = (id: string) => {
</script>

<template>
<ClientOnly>
<BaseContainer v-if="banner && bannerVisible" class="banner-container">
<NuxtLink class="banner" :href="banner.link ?? undefined">
<BaseIcon v-if="banner.icon" :name="banner.icon" size="small" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="content" v-html="banner.content" />
<BaseIcon class="arrow" name="arrow_forward" size="small" />
<button class="dismiss" @click="dismiss(banner.id)"><BaseIcon name="close" size="small" /></button>
</NuxtLink>
</BaseContainer>
</ClientOnly>
<BaseContainer v-if="banner && bannerVisible" class="banner-container">
<NuxtLink class="banner" :href="banner.link ?? undefined">
<BaseIcon v-if="banner.icon" :name="banner.icon" size="small" />
<!-- eslint-disable-next-line vue/no-v-html -->
<span class="content" v-html="banner.content" />
<BaseIcon class="arrow" name="arrow_forward" size="small" />
<button class="dismiss" @click="dismiss(banner.id)"><BaseIcon name="close" size="small" /></button>
</NuxtLink>
</BaseContainer>
</template>
<style scoped lang="scss">
Expand Down
12 changes: 10 additions & 2 deletions components/Nav/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ watch(route, () => {

<template>
<BaseContainer class="header-container">
<ClientOnly>
<NavBanner class="banner-bar" />
</ClientOnly>

<header class="header">
<NuxtLink to="/" class="logo">
<img src="~/assets/svg/logo-dark.svg" alt="Directus Logo" />
Expand Down Expand Up @@ -111,20 +115,24 @@ a {
}
.header-container {
position: sticky;
position: fixed;
top: 0;
z-index: 5;
background-color: rgba(255, 255, 255, 0.8);
padding-block: var(--space-4);
backdrop-filter: blur(10px);
max-height: 100vh;
overflow: auto;
}
.banner-bar {
grid-area: full;
}
.header {
display: flex;
flex-wrap: wrap;
align-items: center;
padding-block: var(--space-4);
}
.logo {
Expand Down
1 change: 0 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script setup lang="ts"></script>

<template>
<NavBanner />
<NavHeader />
<slot />
<NavFooter />
Expand Down

0 comments on commit 319e385

Please sign in to comment.