File tree 3 files changed +73
-11
lines changed
3 files changed +73
-11
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,14 @@ <h3 id="h3head" class="header2-title" >Bringing Quantum Technologies to HEP</h3>
8
8
</ div >
9
9
10
10
</ div >
11
- < nav >
12
- < ul >
11
+ < nav class =" navbar " >
12
+ < ul class =" nav-links " >
13
13
< li > < a href ="index.html "> Home</ a > </ li >
14
14
< li > < a href ="projects.html "> Projects</ a > </ li >
15
15
< li > < a href ="peoples.html "> Peoples</ a > </ li >
16
16
< li > < a href ="future.html "> Future Ideas</ a > </ li >
17
17
< li > < a href ="https://github.com/Quantum4HEP "> Github Repository</ a > </ li >
18
18
</ ul >
19
+ < button class ="menu-toggle " aria-label ="Open menu "> ☰</ button >
19
20
</ nav >
20
21
</ header >
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ async function loadHeader() {
25
25
26
26
lastScrollTop = scrollTop ;
27
27
} ) ;
28
+ document . querySelector ( ".menu-toggle" ) . addEventListener ( "click" , function ( ) {
29
+ document . querySelector ( ".nav-links" ) . classList . toggle ( "show" ) ;
30
+ } ) ;
28
31
} catch ( error ) {
29
32
console . error ( "Error loading header:" , error ) ;
30
33
}
Original file line number Diff line number Diff line change @@ -91,23 +91,23 @@ header h1 {
91
91
color : # fff ;
92
92
}
93
93
94
- nav ul {
94
+ . nav-links {
95
95
list-style : none;
96
96
display : flex;
97
97
justify-content : center;
98
98
}
99
99
100
- nav ul li {
100
+ . nav-links li {
101
101
margin : 0 1rem ;
102
102
}
103
103
104
- nav ul li a {
104
+ . nav-links li a {
105
105
color : # fff ;
106
106
text-decoration : none;
107
107
font-weight : bold;
108
108
}
109
109
110
- nav ul li a : hover {
110
+ . nav-links li a : hover {
111
111
color : # ffb000 ;
112
112
}
113
113
@@ -197,16 +197,74 @@ a:hover {
197
197
198
198
}
199
199
/* Responsive Design */
200
+
201
+ .menu-toggle {
202
+ display : none; /* Hidden by default */
203
+ font-size : 1.5rem ;
204
+ background : none;
205
+ border : none;
206
+ color : white;
207
+ cursor : pointer;
208
+ }
209
+
200
210
@media (max-width : 768px ) {
201
- nav ul {
202
- flex-direction : column;
211
+ .nav-links {
212
+ display : none; /* Hide links by default on mobile */
213
+ flex-direction : column;
214
+ position : absolute;
215
+ top : 100px ;
216
+ left : 0px ;
217
+ background-color : # 333 ;
218
+ padding : 1rem ;
219
+ width : 150px ;
220
+ border-radius : 5px ;
221
+ background-color : # 0a0316 ;
203
222
}
204
-
205
- nav ul li {
223
+ .nav-links .show {
224
+ display : flex; /* Show menu when toggled */
225
+ }
226
+ .nav-links li {
206
227
margin : 0.5rem 0 ;
207
228
}
208
-
229
+ .menu-toggle {
230
+ display : block; /* Show the toggle button on mobile */
231
+ }
232
+ header {
233
+ width : 100% ;
234
+ background-color : # 0a0316 ;
235
+ color : # fff ;
236
+ text-align : center;
237
+ justify-content : space-between;
238
+ align-items : center;
239
+ transition : padding 0.8s ease, font-size 0.8s ease;
240
+ z-index : 56 ;
241
+ padding : 10px 10px ;
242
+ }
243
+ header h1 {
244
+ font-size : 18px ;
245
+ }
246
+ header h3 {
247
+ font-size : 0px ;
248
+ }
249
+ header .header-image {
250
+ width : 50px ; /* Set a fixed width for the image */
251
+ height : auto; /* Maintain aspect ratio */
252
+ margin-right : 10px ; /* Space between image and heading */
253
+ padding : 0.3rem 0 ;
254
+ }
209
255
main {
210
256
padding : 1rem ;
211
257
}
258
+ .header-small {
259
+ width : 100% ;
260
+ background-color : # 0a0316 ;
261
+ color : # fff ;
262
+ text-align : center;
263
+ justify-content : space-between;
264
+ align-items : center;
265
+ transition : padding 0.8s ease, font-size 0.8s ease;
266
+ z-index : 56 ;
267
+ padding : 10px 10px ;
268
+
269
+ }
212
270
}
You can’t perform that action at this time.
0 commit comments