Awale-1000 commited on
Commit
50a5559
·
verified ·
1 Parent(s): 42cdc0b

add a nav bar

Browse files
Files changed (2) hide show
  1. components/navbar.js +35 -12
  2. index.html +0 -1
components/navbar.js CHANGED
@@ -4,8 +4,9 @@ class CustomNavbar extends HTMLElement {
4
  this.shadowRoot.innerHTML = `
5
  <style>
6
  nav {
7
- background: rgba(255, 255, 255, 0.95);
8
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
 
9
  position: fixed;
10
  top: 0;
11
  left: 0;
@@ -15,8 +16,9 @@ class CustomNavbar extends HTMLElement {
15
  display: flex;
16
  justify-content: space-between;
17
  align-items: center;
 
18
  }
19
- .logo {
20
  color: #ec4899;
21
  font-weight: bold;
22
  font-size: 1.5rem;
@@ -33,11 +35,12 @@ class CustomNavbar extends HTMLElement {
33
  .desktop-menu a {
34
  color: #4b5563;
35
  text-decoration: none;
36
- font-weight: 500;
37
- transition: color 0.3s;
38
  position: relative;
 
39
  }
40
- .desktop-menu a:hover {
41
  color: #ec4899;
42
  }
43
  .desktop-menu a::after {
@@ -57,9 +60,13 @@ class CustomNavbar extends HTMLElement {
57
  display: none;
58
  background: none;
59
  border: none;
60
- color: #4b5563;
61
  font-size: 1.5rem;
62
  cursor: pointer;
 
 
 
 
63
  }
64
  .mobile-menu {
65
  display: none;
@@ -68,10 +75,21 @@ class CustomNavbar extends HTMLElement {
68
  left: 0;
69
  right: 0;
70
  background: white;
71
- padding: 1rem;
72
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
73
  }
74
- .mobile-menu ul {
 
 
 
 
 
 
 
 
 
 
75
  list-style: none;
76
  padding: 0;
77
  margin: 0;
@@ -79,14 +97,19 @@ class CustomNavbar extends HTMLElement {
79
  .mobile-menu li {
80
  padding: 0.75rem 0;
81
  border-bottom: 1px solid #f3f4f6;
 
 
 
 
82
  }
83
  .mobile-menu a {
84
  color: #4b5563;
85
  text-decoration: none;
86
- font-weight: 500;
87
  display: block;
 
88
  }
89
- .mobile-menu a:hover {
90
  color: #ec4899;
91
  }
92
  @media (max-width: 768px) {
 
4
  this.shadowRoot.innerHTML = `
5
  <style>
6
  nav {
7
+ background: rgba(255, 255, 255, 0.98);
8
+ backdrop-filter: blur(10px);
9
+ box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
10
  position: fixed;
11
  top: 0;
12
  left: 0;
 
16
  display: flex;
17
  justify-content: space-between;
18
  align-items: center;
19
+ transition: all 0.3s ease;
20
  }
21
+ .logo {
22
  color: #ec4899;
23
  font-weight: bold;
24
  font-size: 1.5rem;
 
35
  .desktop-menu a {
36
  color: #4b5563;
37
  text-decoration: none;
38
+ font-weight: 600;
39
+ transition: all 0.3s;
40
  position: relative;
41
+ padding: 0.5rem 0;
42
  }
43
+ .desktop-menu a:hover {
44
  color: #ec4899;
45
  }
46
  .desktop-menu a::after {
 
60
  display: none;
61
  background: none;
62
  border: none;
63
+ color: #ec4899;
64
  font-size: 1.5rem;
65
  cursor: pointer;
66
+ transition: transform 0.3s;
67
+ }
68
+ .mobile-menu-button:hover {
69
+ transform: scale(1.1);
70
  }
71
  .mobile-menu {
72
  display: none;
 
75
  left: 0;
76
  right: 0;
77
  background: white;
78
+ padding: 1rem 2rem;
79
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
80
+ animation: slideDown 0.3s ease-out;
81
  }
82
+ @keyframes slideDown {
83
+ from {
84
+ opacity: 0;
85
+ transform: translateY(-10px);
86
+ }
87
+ to {
88
+ opacity: 1;
89
+ transform: translateY(0);
90
+ }
91
+ }
92
+ .mobile-menu ul {
93
  list-style: none;
94
  padding: 0;
95
  margin: 0;
 
97
  .mobile-menu li {
98
  padding: 0.75rem 0;
99
  border-bottom: 1px solid #f3f4f6;
100
+ transition: all 0.3s;
101
+ }
102
+ .mobile-menu li:hover {
103
+ background: #fdf2f8;
104
  }
105
  .mobile-menu a {
106
  color: #4b5563;
107
  text-decoration: none;
108
+ font-weight: 600;
109
  display: block;
110
+ padding: 0.5rem 0;
111
  }
112
+ .mobile-menu a:hover {
113
  color: #ec4899;
114
  }
115
  @media (max-width: 768px) {
index.html CHANGED
@@ -176,6 +176,5 @@
176
  zoom: 0.85
177
  });
178
  </script>
179
- <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
180
  </body>
181
  </html>
 
176
  zoom: 0.85
177
  });
178
  </script>
 
179
  </body>
180
  </html>