-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6bc57b
commit 94194f5
Showing
6 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,35 @@ | ||
<template> | ||
<div | ||
:class="[isVisible, 'fixed top-0 right-[-100vw] md:right-[-50vw] w-[100vw] md:w-[50vw] h-screen bg-theme z-10 transition-transform duration-300 ease-in-out']"> | ||
<button @click="isMenuOpen.set(!$isMenuOpen)">X</button> | ||
<h1>Menu</h1> | ||
</div> | ||
<aside :class="[isVisible, 'fixed top-0 right-[-100vw] md:right-[-25vw] w-[100vw] md:w-[25vw] h-screen bg-theme z-10 transition-transform duration-300 ease-in-out border-red']"> | ||
<div class="p-[2rem] relative"> | ||
<button @click="isMenuOpen.set(!$isMenuOpen)" class="absolute top-5 right-5"> | ||
<IconClose /> | ||
</button> | ||
<nav class="text-center"> | ||
<h1>Menu</h1> | ||
<ul class="menu-links flex flex-col gap-y-4 mt-10"> | ||
<li> | ||
<a href="/">Home</a> | ||
</li> | ||
<li> | ||
<a href="/projects">Projects</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
</div> | ||
</aside> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { isMenuOpen } from '../stores/menu'; | ||
import { useStore } from '@nanostores/vue'; | ||
import IconClose from '../components/icons/IconClose.vue' | ||
// State | ||
const $isMenuOpen = useStore(isMenuOpen); | ||
// Computed | ||
const isVisible = computed(() => ({ | ||
'translate-x-[-50vw]': $isMenuOpen.value, | ||
'translate-x-[-100vw] md:translate-x-[-25vw]': $isMenuOpen.value, | ||
})) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<template> | ||
<div class="close-icon"> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> | ||
<path fill="none" d="M0 0h24v24H0z" /> | ||
<path class="stroke-theme" d="M18 6L6 18M6 6l12 12" /> | ||
</svg> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<template> | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"> | ||
<path fill="currentColor" d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /> | ||
<path class="fill-theme-heading" d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" /> | ||
</svg> | ||
</template> |