Skip to content

Commit 678fbbf

Browse files
committed
done finaaly
1 parent 994a604 commit 678fbbf

File tree

2 files changed

+82
-65
lines changed

2 files changed

+82
-65
lines changed

css/style.css

Lines changed: 77 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -382,86 +382,103 @@ footer {
382382
.navbar-wrapper.scrolled .navbar {
383383
height: 65px;
384384
}
385-
/* ================= MOBILE MENU ================= */
385+
386+
/* ===== HAMBURGER FIX (NO HTML CHANGES) ===== */
386387

387388
.hamburger {
388389
display: none;
389390
}
390-
@media (max-width: 768px) {
391391

392-
393-
.navbar {
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;
392+
/* hamburger icon styling */
393+
.hamburger span {
394+
display: block;
395+
width: 22px;
396+
height: 2px;
397+
background: #ffffff;
398+
margin: 5px 0;
399+
border-radius: 2px;
401400
}
402401

403-
/* hide links by default */
404-
.nav-links {
405-
position: absolute;
406-
top: 60px;
407-
left: 0;
408-
width: 100%;
409-
background: linear-gradient(135deg, #0f172a, #0dcaf0);
410-
display: none;
411-
flex-direction: column;
412-
z-index: 999;
413-
box-shadow: 0 12px 32px rgba(0,0,0,0.35);
414-
animation: slideDown 0.25s ease-out;
415-
}
402+
/* MOBILE ONLY */
403+
@media (max-width: 768px) {
416404

417-
.nav-links li {
418-
width: 100%;
419-
border-bottom: 1px solid rgba(255,255,255,0.15);
405+
.navbar-wrapper {
406+
position: relative;
420407
}
421408

422-
.nav-links a {
423-
width: 100%;
424-
padding: 16px 0;
425-
text-align: center;
426-
font-size: 15px;
427-
font-weight: 600;
409+
.hamburger {
410+
display: block;
411+
position: absolute;
412+
right: 18px;
413+
top: 18px;
414+
cursor: pointer;
415+
z-index: 1200;
428416
}
429417

430-
.nav-links.open {
418+
/* ===== SLIDE-IN MENU ===== */
419+
.nav-links {
420+
position: fixed;
421+
top: 0;
422+
right: -100%;
423+
width: 33%;
424+
height: 98vh;
425+
align-items: center;
426+
border-radius: 2%;
427+
428+
/* PROFESSIONAL CONSULTING BACKGROUND */
429+
background:
430+
linear-gradient(180deg,
431+
#0b1f2a 0%,
432+
#0e2f3f 55%,
433+
#0dcaf0 120%);
431434
display: flex;
432-
}
433-
}
435+
flex-direction: column;
436+
justify-content: flex-start;
437+
padding-top: 90px;
438+
transition: right 0.35s ease;
439+
z-index: 1000;
440+
box-shadow:
441+
inset 1px 0 0 rgba(255, 255, 255, 0.08),
442+
-18px 0 40px rgba(0, 0, 0, 0.45);
443+
transform: translateX(0);
444+
opacity: 0;
434445

435-
/* smooth dropdown animation */
436-
@keyframes slideDown {
437-
from {
438-
opacity: 0;
439-
transform: translateY(-10px);
440446
}
441-
to {
447+
448+
.nav-links.open {
449+
color: #0f172a;
450+
font-weight: 600;
451+
right: 0;
442452
opacity: 1;
443-
transform: translateY(0);
444453
}
445-
}
446454

447-
/* show hamburger */
448-
.hamburger {
449-
display: block;
450-
font-size: 24px;
451-
color: #fff;
452-
cursor: pointer;
453-
}
454-
.hamburger span {
455-
width: 22px;
456-
height: 2px;
457-
background: #ffffff;
458-
border-radius: 2px;
455+
.nav-links li {
456+
text-align: center;
457+
458+
459+
459460
}
460461

461-
/* open state */
462-
.nav-links.open {
463-
display: flex;
462+
.nav-links a {
463+
padding: 10px 0;
464+
letter-spacing: 0.3px;
465+
color: #e5f6ff;
466+
display: block;
467+
align-items: center;
464468
}
465-
}
466469

470+
.nav-links li::after {
471+
margin: 10px auto 0;
472+
opacity: 0.6;
473+
}
467474

475+
/* ===== BLUR OVERLAY ===== */
476+
body.menu-open::before {
477+
content: "";
478+
position: fixed;
479+
inset: 0;
480+
background: rgba(2, 8, 23, 0.55);
481+
backdrop-filter: blur(5px);
482+
z-index: 900;
483+
}
484+
}

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,23 @@ <h2>Disclaimer</h2>
183183
});
184184
});
185185
</script>
186-
187-
<script>
186+
<script>
188187
const hamburger = document.getElementById("hamburger");
189188
const navLinks = document.querySelector(".nav-links");
190-
const links = document.querySelectorAll(".nav-links a");
191189

192190
hamburger.addEventListener("click", () => {
193191
navLinks.classList.toggle("open");
192+
document.body.classList.toggle("menu-open");
194193
});
195194

196-
links.forEach(link => {
195+
// Close menu when clicking a link
196+
document.querySelectorAll(".nav-links a").forEach(link => {
197197
link.addEventListener("click", () => {
198198
navLinks.classList.remove("open");
199+
document.body.classList.remove("menu-open");
199200
});
200201
});
201202
</script>
202-
203203
</body>
204204

205205
</html>

0 commit comments

Comments
 (0)