Skip to content

Commit

Permalink
fix(layout): hide elements on home page
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Jul 18, 2023
1 parent 82b4f42 commit 8aecd6c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
19 changes: 12 additions & 7 deletions components/layout/navigation/Navbar.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<script setup>
import { Bars3Icon, XMarkIcon } from '@heroicons/vue/24/outline'
const route = useRoute()
const { value: isMenuActive, toggle: toggleMenu } = useMenu()
const isHomePage = computed(() => route.path === '/')
</script>

<template>
<nav
id="navbar"
:class="[isHomePage ? 'border-b-transparent' : 'border-b-base-0/20']"
class="border-b border-b-base-0/20 bg-transparent"
>
<!-- -->
Expand Down Expand Up @@ -41,11 +45,12 @@
</div>

<!-- Center: Logo -->
<div
id="navbar-logo"
class="flex flex-1 items-center justify-center"
>
<div class="group flex-shrink-0">
<div class="flex flex-1 items-center justify-center">
<NuxtLink
v-if="!isHomePage"
class="focus-visible:focus-outline-util hover:hover-bg-util flex-shrink-0"
to="/"
>
<img
alt="Icon"
class="flip-vertical-fwd h-6 w-6 text-base-content-highlight"
Expand All @@ -54,7 +59,7 @@
src="/icon.svg"
width="16"
/>
</div>
</NuxtLink>
</div>

<!-- Right side: Actions -->
Expand Down
10 changes: 0 additions & 10 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,3 @@
<!-- TODO: Footer link to social media -->
</footer>
</template>

<style>
#navbar {
border-bottom: transparent;
}
#navbar-logo {
visibility: hidden;
}
</style>

0 comments on commit 8aecd6c

Please sign in to comment.