Skip to content

Commit

Permalink
Rotate dropdown arrow when the menu is active
Browse files Browse the repository at this point in the history
  • Loading branch information
creeperkatze committed Dec 21, 2024
1 parent 7376063 commit 8c5a565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
<nav class="hidden lg:block">
<div class="flex justify-start gap-4 mx-4">
<NuxtLink :to="localePath('/')" class="navbar-element">{{ $t('navbar.home') }}</NuxtLink>
<div class="dropdown relative inline-flex">
<div class="dropdown relative inline-flex" @mouseenter="dropdownOpen = true" @mouseleave="dropdownOpen = false">
<NuxtLink id="dropdown-hover-event" :to="localePath('/projects')" type="button"
class="inline-flex navbar-element items-center" aria-haspopup="menu" aria-expanded="false"
aria-label="Dropdown">
{{ $t('navbar.projects') }}
<IconDown class="size-4" />
<IconDown class="size-4 transform transition-all" :class="{ 'rotate-180': dropdownOpen }" />
</NuxtLink>

<div class="dropdown-menu transition duration-100 hidden rounded-md bg-black border border-gray-400 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full z-10"
Expand Down Expand Up @@ -117,6 +117,7 @@ const localePath = useLocalePath()
const showBanner = ref(false);
const drawerOpen = ref(false);
const dropdownOpen = ref(false);
function drawer()
{
Expand Down

0 comments on commit 8c5a565

Please sign in to comment.