Skip to content

Commit 994a604

Browse files
committed
changed
1 parent 63b0f05 commit 994a604

File tree

2 files changed

+48
-20
lines changed

2 files changed

+48
-20
lines changed

css/style.css

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -387,49 +387,70 @@ footer {
387387
.hamburger {
388388
display: none;
389389
}
390-
391390
@media (max-width: 768px) {
392391

392+
393393
.navbar {
394-
position: relative;
395-
height: 60px;
396-
padding: 0 14px;
397-
}
394+
max-width: 1400px;
395+
margin: 0 auto;
396+
padding: 0 28px;
397+
height: 64px;
398+
display: flex;
399+
align-items: center;
400+
justify-content: space-between;
401+
}
398402

399403
/* hide links by default */
400-
.nav-links {
404+
.nav-links {
401405
position: absolute;
402406
top: 60px;
403407
left: 0;
404-
right: 0;
408+
width: 100%;
405409
background: linear-gradient(135deg, #0f172a, #0dcaf0);
410+
display: none;
406411
flex-direction: column;
407-
align-items: center;
408-
display: none; /* 👈 THIS is missing in your current view */
409412
z-index: 999;
413+
box-shadow: 0 12px 32px rgba(0,0,0,0.35);
414+
animation: slideDown 0.25s ease-out;
410415
}
411416

412417
.nav-links li {
413418
width: 100%;
414-
text-align: center;
415419
border-bottom: 1px solid rgba(255,255,255,0.15);
416420
}
417421

418422
.nav-links a {
419-
display: block;
420-
padding: 14px;
423+
width: 100%;
424+
padding: 16px 0;
425+
text-align: center;
421426
font-size: 15px;
427+
font-weight: 600;
422428
}
423429

424-
/* show hamburger */
425-
.hamburger {
430+
.nav-links.open {
426431
display: flex;
427-
flex-direction: column;
428-
gap: 4px;
429-
cursor: pointer;
430-
margin-left: auto;
431432
}
433+
}
434+
435+
/* smooth dropdown animation */
436+
@keyframes slideDown {
437+
from {
438+
opacity: 0;
439+
transform: translateY(-10px);
440+
}
441+
to {
442+
opacity: 1;
443+
transform: translateY(0);
444+
}
445+
}
432446

447+
/* show hamburger */
448+
.hamburger {
449+
display: block;
450+
font-size: 24px;
451+
color: #fff;
452+
cursor: pointer;
453+
}
433454
.hamburger span {
434455
width: 22px;
435456
height: 2px;
@@ -443,3 +464,4 @@ footer {
443464
}
444465
}
445466

467+

index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,21 @@ <h2>Disclaimer</h2>
184184
});
185185
</script>
186186

187-
<script>
187+
<script>
188188
const hamburger = document.getElementById("hamburger");
189189
const navLinks = document.querySelector(".nav-links");
190+
const links = document.querySelectorAll(".nav-links a");
190191

191192
hamburger.addEventListener("click", () => {
192193
navLinks.classList.toggle("open");
193194
});
194-
</script>
195195

196+
links.forEach(link => {
197+
link.addEventListener("click", () => {
198+
navLinks.classList.remove("open");
199+
});
200+
});
201+
</script>
196202

197203
</body>
198204

0 commit comments

Comments
 (0)