Skip to content

Commit 70f263c

Browse files
committed
Header fixed
1 parent 67fc0a4 commit 70f263c

File tree

1 file changed

+62
-30
lines changed

1 file changed

+62
-30
lines changed

src/components/shared/Header.vue

Lines changed: 62 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,82 @@
11
<template>
22
<nav id="nav" class="container mx-auto">
3-
<div class="md:flex items-center justify-between my-6">
3+
<div
4+
class="z-10 max-w-screen-lg xl:max-w-screen-xl block sm:flex sm:justify-between sm:items-center my-6"
5+
>
46
<div class="flex justify-between items-center">
5-
<div class="text-2xl font-bold text-gray-800 md:text-3xl">
7+
<div>
68
<router-link to="/"
79
><img
8-
src="../../assets/images/logo.svg"
10+
v-if="theme === 'light'"
11+
src="../../assets/images/logo-dark.svg"
12+
class="w-36"
13+
alt=""
14+
/>
15+
<img
16+
v-else
17+
src="../../assets/images/logo-light.svg"
918
class="w-36"
1019
alt=""
11-
/></router-link>
20+
/>
21+
</router-link>
1222
</div>
13-
<div class="md:hidden">
23+
24+
<theme-switcher
25+
:theme="theme"
26+
@themeChanged="updateTheme"
27+
class="block sm:hidden bg-ternary-light dark:bg-ternary-dark hover:bg-hover-light dark:hover:bg-hover-dark hover:shadow-sm px-2.5 py-2 rounded-lg ml-10"
28+
/>
29+
30+
<div class="sm:hidden">
1431
<button
15-
type="button"
16-
class="block text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light focus:text-gray-700 dark:focus:text-primary-light focus:outline-none"
32+
@click="isOpen = !isOpen"
33+
type="buttom"
34+
class="focus:outline-none"
1735
>
18-
<svg class="h-6 w-6 fill-current" viewBox="0 0 24 24">
36+
<svg
37+
xmlns="http://www.w3.org/2000/svg"
38+
viewBox="0 0 24 24"
39+
class="h-6 w-6 fill-current text-secondary-dark dark:text-ternary-light"
40+
>
1941
<path
20-
class="hidden"
21-
d="M16.24 14.83a1 1 0 0 1-1.41 1.41L12 13.41l-2.83 2.83a1 1 0 0 1-1.41-1.41L10.59 12 7.76 9.17a1 1 0 0 1 1.41-1.41L12 10.59l2.83-2.83a1 1 0 0 1 1.41 1.41L13.41 12l2.83 2.83z"
22-
/>
42+
v-if="isOpen"
43+
fill-rule="evenodd"
44+
d="M18.278 16.864a1 1 0 0 1-1.414 1.414l-4.829-4.828-4.828 4.828a1 1 0 0 1-1.414-1.414l4.828-4.829-4.828-4.828a1 1 0 0 1 1.414-1.414l4.829 4.828 4.828-4.828a1 1 0 1 1 1.414 1.414l-4.828 4.829 4.828 4.828z"
45+
clip-rule="evenodd"
46+
></path>
2347
<path
48+
v-if="!isOpen"
49+
fill-rule="evenodd"
2450
d="M4 5h16a1 1 0 0 1 0 2H4a1 1 0 1 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2zm0 6h16a1 1 0 0 1 0 2H4a1 1 0 0 1 0-2z"
25-
/>
51+
></path>
2652
</svg>
2753
</button>
2854
</div>
29-
<div class="sm:ml-4 mt-3">
30-
<router-link
31-
to="/projects"
32-
class="text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-6 mb-2 sm:py-2"
33-
>Projects</router-link
34-
>
35-
<router-link
36-
to="/about"
37-
class="text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-2 mb-2 sm:py-2"
38-
>About Me</router-link
39-
>
40-
<router-link
41-
to="/contact"
42-
class="text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-2 mb-2 sm:py-2"
43-
>Contact</router-link
44-
>
45-
</div>
4655
</div>
47-
<div class="flex justify-between items-center flex-col md:flex-row">
56+
57+
<div
58+
:class="isOpen ? 'block' : 'hidden'"
59+
class="ml-3 sm:ml-4 mt-5 sm:mt-3 sm:flex justify-center items-center"
60+
>
61+
<router-link
62+
to="/projects"
63+
class="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-6 mb-2 sm:py-2"
64+
>Projects</router-link
65+
>
66+
<router-link
67+
to="/about"
68+
class="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-2 mb-2 sm:py-2"
69+
>About Me</router-link
70+
>
71+
<router-link
72+
to="/contact"
73+
class="block text-left text-lg font-medium text-primary-dark dark:text-ternary-light hover:text-secondary-dark dark:hover:text-secondary-light md:mx-2 mb-2 sm:py-2"
74+
>Contact</router-link
75+
>
76+
</div>
77+
<div
78+
class="hidden sm:flex justify-between items-center flex-col md:flex-row"
79+
>
4880
<div>
4981
<button
5082
class="text-md font-medium bg-indigo-500 hover:bg-indigo-600 text-white shadow-sm rounded-lg px-5 py-2.5"

0 commit comments

Comments
 (0)