Skip to content

Commit 63b0f05

Browse files
committed
humburgger added
1 parent d1b68fa commit 63b0f05

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

css/style.css

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -382,34 +382,37 @@ footer {
382382
.navbar-wrapper.scrolled .navbar {
383383
height: 65px;
384384
}
385-
/* MOBILE MENU */
385+
/* ================= MOBILE MENU ================= */
386+
386387
.hamburger {
387388
display: none;
388389
}
389390

390-
/* Mobile view */
391391
@media (max-width: 768px) {
392392

393393
.navbar {
394-
height: 58px;
394+
position: relative;
395+
height: 60px;
395396
padding: 0 14px;
396397
}
397398

399+
/* hide links by default */
398400
.nav-links {
399401
position: absolute;
400-
top: 58px;
402+
top: 60px;
401403
left: 0;
402404
right: 0;
403405
background: linear-gradient(135deg, #0f172a, #0dcaf0);
404406
flex-direction: column;
405-
gap: 0;
406-
display: none;
407-
border-bottom: 1px solid rgba(255,255,255,0.1);
407+
align-items: center;
408+
display: none; /* 👈 THIS is missing in your current view */
409+
z-index: 999;
408410
}
409411

410412
.nav-links li {
413+
width: 100%;
411414
text-align: center;
412-
border-bottom: 1px solid rgba(255,255,255,0.1);
415+
border-bottom: 1px solid rgba(255,255,255,0.15);
413416
}
414417

415418
.nav-links a {
@@ -418,11 +421,13 @@ footer {
418421
font-size: 15px;
419422
}
420423

424+
/* show hamburger */
421425
.hamburger {
422426
display: flex;
423427
flex-direction: column;
424428
gap: 4px;
425429
cursor: pointer;
430+
margin-left: auto;
426431
}
427432

428433
.hamburger span {
@@ -432,7 +437,9 @@ footer {
432437
border-radius: 2px;
433438
}
434439

440+
/* open state */
435441
.nav-links.open {
436442
display: flex;
437443
}
438444
}
445+

index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,15 @@ <h2>Disclaimer</h2>
185185
</script>
186186

187187
<script>
188-
const hamburger = document.getElementById('hamburger');
189-
const navLinks = document.querySelector('.nav-links');
188+
const hamburger = document.getElementById("hamburger");
189+
const navLinks = document.querySelector(".nav-links");
190190

191-
hamburger.addEventListener('click', () => {
192-
navLinks.classList.toggle('open');
193-
});
191+
hamburger.addEventListener("click", () => {
192+
navLinks.classList.toggle("open");
193+
});
194194
</script>
195195

196+
196197
</body>
197198

198199
</html>

0 commit comments

Comments
 (0)