|
1 | 1 | <script setup lang="ts"> |
| 2 | +import ColorModeButton from './ColorModeButton.vue'; |
2 | 3 |
|
| 4 | +const open = ref(false); |
| 5 | +
|
| 6 | +// toggle open state of the slideover when the route or hash changes |
| 7 | +
|
| 8 | +const route = useRoute(); |
| 9 | +watch(() => route.path + route.hash, () => { |
| 10 | + open.value = false; |
| 11 | +}); |
3 | 12 | const navITems = [ |
4 | 13 | {label: 'Home', to: '/', exactHash: true}, |
5 | 14 | {label: 'About', to: '/#about', exactHash: true}, |
6 | 15 | {label: 'Services', to: '/#services', exactHash: true}, |
7 | 16 | {label: 'Skills', to: '/#skills', exactHash: true}, |
8 | 17 | {label: 'Portfolio', to: '/#portfolio', exactHash: true}, |
9 | | - {label: 'Testimonials', to: '/#testimonials', exactHash: true}, |
| 18 | + {label: 'Background', to: '/#background', exactHash: true}, |
10 | 19 | {label: 'Blog', to: '/blog'}, |
11 | | - {label: 'Contact', to: '/contact'}, |
| 20 | + {label: 'Contact', to: '/contact', icon: 'i-heroicons-envelope-solid',}, |
12 | 21 | ] |
13 | 22 | </script> |
14 | 23 | <template> |
15 | | - <header class="flex items-center justify-between px-4 w-full top-0 sticky bg-elevated"> |
16 | | - <div class="text-lg font-bold">My Website</div> |
17 | | - <nav class="flex space-x-4"> |
18 | | - <UNavigationMenu :items="navITems" variant='link' orientation="horizontal"/> |
| 24 | + <header class="flex items-center justify-between px-4 w-full top-0 z-99 sticky "> |
| 25 | + <ULink to="/#" class="flex items-center space-x-2"> |
| 26 | + <img src="/images/logo.jpg" alt="Logo" class="w-10 h-10 rounded-full"> |
| 27 | + <div class="text-lg font-bold">Shadrack Odielo.</div> |
| 28 | + </ULink> |
| 29 | + <nav class="hidden md:flex space-x-4"> |
| 30 | + <UNavigationMenu :items="navITems" variant='link' orientation="horizontal" highlight /> |
19 | 31 | </nav> |
20 | | - <div class="flex items-center space-x-4"> |
21 | | - <UButton label="Login" variant="outline" color="neutral" /> |
22 | | - <UButton label="Sign Up" color="primary" /> |
23 | | - </div> |
| 32 | + <div class="flex items-center space-x-2"> |
| 33 | + <ColorModeButton /> |
| 34 | + <UButton color="neutral" icon="i-lucide-github" variant='link' href="https://github.com/ShadrackOdielo" target="_blank" /> |
| 35 | + <UButton color="neutral" icon="i-lucide-linkedin" variant='link' href="https://www.linkedin.com/in/shadrack-odielo/" target="_blank" /> |
| 36 | + <UButton color="neutral" icon="i-lucide-twitter" variant='link' href="https://twitter.com/ShadrackOdielo" target="_blank" /> |
| 37 | + <USlideover |
| 38 | +v-model:open="open" |
| 39 | + class="md:hidden" |
| 40 | + title="Menu"> |
| 41 | + <UButton icon="i-lucide-menu" color="neutral" variant="ghost" /> |
| 42 | + |
| 43 | + <template #body> |
| 44 | + <nav class="flex flex-col space-y-2"> |
| 45 | + <!-- close slideover when a lin is clicked --> |
| 46 | + <UNavigationMenu :items="navITems" variant='link' orientation="vertical" highlight /> |
| 47 | + </nav> |
| 48 | + </template> |
| 49 | + </USlideover> |
| 50 | + </div> |
24 | 51 | </header> |
25 | 52 | </template> |
0 commit comments