Skip to content

Commit

Permalink
Slide animation on the meta-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
tutaru99 committed Jun 5, 2024
1 parent f2d4ed5 commit a338f28
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
19 changes: 19 additions & 0 deletions assets/css/_transitions.css
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,22 @@
transform: translateX(0);
}
}

/* slide from top */
.slide-top-enter-active {
animation: slide-top 0.3s;
}

.slide-top-leave-active {
animation: slide-top 0.3s reverse;
}

@keyframes slide-top {
0% {
transform: translateY(-100%);
}

100% {
transform: translateY(0);
}
}
12 changes: 7 additions & 5 deletions components/globals/navigation/TheMetaMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ const closeOffCanvas = () => {
/>
<ClientOnly>
<TheOffCanvasMetaMenu
v-if="isOpen && activeNavItem === metaItem"
:nested-items="metaItem?.below"
class="meta-offcanvas"
/>
<Transition name="slide-top">
<TheOffCanvasMetaMenu
v-if="isOpen && activeNavItem === metaItem"
:nested-items="metaItem?.below"
class="meta-offcanvas"
/>
</Transition>
</ClientOnly>
</div>
</NuxtLink>
Expand Down

0 comments on commit a338f28

Please sign in to comment.