Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7385bce

Browse files
Dondeti Pranay ReddyDondeti Pranay Reddy
authored andcommitted
UI: Implement dedicated mobile navigation bar and fix toggle visibility
1 parent 62a25ce commit 7385bce

2 files changed

Lines changed: 53 additions & 5 deletions

File tree

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@
1818
<body>
1919
<div class="background-emojis" id="emoji-bg"></div>
2020
<div id="app">
21-
<button id="menu-toggle" aria-label="Toggle Menu"></button>
21+
<div class="mobile-nav-bar">
22+
<button id="menu-toggle" aria-label="Toggle Menu"></button>
23+
<div class="mobile-logo">Energy Domain</div>
24+
</div>
2225
<nav id="sidebar">
2326
<button id="close-sidebar" aria-label="Close Menu">×</button>
2427
<div class="logo">Energy Domain</div>

style.css

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,22 @@ p {
286286
transform: scale(1.05);
287287
}
288288

289-
/* Logic to hide hamburger when sidebar is open */
290-
#app.mobile-sidebar-open #menu-toggle,
291-
#app:not(.sidebar-collapsed) #menu-toggle {
289+
/* Logic to hide hamburger when sidebar is open (Desktop Only) */
290+
@media (min-width: 901px) {
291+
#app:not(.sidebar-collapsed) #menu-toggle {
292+
display: none !important;
293+
}
294+
}
295+
296+
/* Logic to hide hamburger when sidebar is open (Mobile Only) */
297+
#app.mobile-sidebar-open #menu-toggle {
292298
display: none !important;
293299
}
294300

301+
.mobile-nav-bar {
302+
display: none;
303+
}
304+
295305
/* X Button (Visible when sidebar is open) */
296306
#close-sidebar {
297307
display: flex !important;
@@ -520,8 +530,43 @@ p {
520530
overflow-x: hidden;
521531
}
522532

533+
.mobile-nav-bar {
534+
display: flex;
535+
align-items: center;
536+
position: fixed;
537+
top: 0;
538+
left: 0;
539+
width: 100%;
540+
height: 60px;
541+
background: rgba(255, 255, 255, 0.9);
542+
backdrop-filter: blur(10px);
543+
border-bottom: 1px solid rgba(0, 176, 255, 0.2);
544+
z-index: 150;
545+
padding: 0 15px;
546+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
547+
}
548+
549+
.mobile-logo {
550+
margin-left: 15px;
551+
font-weight: 800;
552+
color: var(--neon-cyan);
553+
font-size: 1.1rem;
554+
text-transform: uppercase;
555+
letter-spacing: 1px;
556+
}
557+
523558
#menu-toggle {
524-
display: block;
559+
display: flex;
560+
align-items: center;
561+
justify-content: center;
562+
position: static;
563+
/* Use flex instead of fixed */
564+
padding: 8px 12px;
565+
font-size: 1.2rem;
566+
background: none;
567+
color: var(--neon-cyan);
568+
box-shadow: none;
569+
border: 1px solid rgba(0, 176, 255, 0.3);
525570
}
526571

527572
#sidebar {

0 commit comments

Comments
 (0)