Skip to content

Commit 3135190

Browse files
[RTY-260041]: Added hamburger menu to mobile version nav bar
1 parent 5e07cf2 commit 3135190

2 files changed

Lines changed: 42 additions & 5 deletions

File tree

app/static/css/tiny.css

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ body.light-theme {
6161
justify-content: space-between;
6262
padding: 0 10px;
6363
box-sizing: border-box;
64-
overflow: hidden;
6564
background: var(--glass);
6665
border-bottom: 1px solid var(--glass-border);
6766
z-index: 1000;
@@ -101,7 +100,6 @@ body.light-theme .app-header {
101100
.header-nav {
102101
display: flex;
103102
gap: 26px;
104-
margin: 0 auto;
105103
flex-wrap: wrap;
106104
white-space: nowrap;
107105
flex-shrink: 1;
@@ -177,6 +175,18 @@ body.dark-theme .app-header {
177175
color: var(--accent);
178176
}
179177

178+
/* hamburger hidden on desktop */
179+
180+
.hamburger {
181+
display: none;
182+
font-size: 22px;
183+
background: transparent;
184+
border: none;
185+
color: var(--text-primary);
186+
cursor: pointer;
187+
}
188+
189+
180190
@media (max-width: 600px) {
181191
.app-logo {
182192
transform: scale(0.9);
@@ -189,12 +199,30 @@ body.dark-theme .app-header {
189199

190200
}
191201

202+
192203
@media (max-width: 700px) {
193204

205+
.hamburger {
206+
display: block;
207+
}
208+
194209
.header-nav {
195-
flex-wrap: wrap;
196-
justify-content: center;
197-
gap: 14px;
210+
display: none;
211+
position: fixed;
212+
top: 55px;
213+
left: 0;
214+
right: 0;
215+
width: 100%;
216+
flex-direction: column;
217+
background: var(--bg);
218+
padding: 20px;
219+
display: none;
220+
gap: 16px;
221+
border-bottom: 1px solid var(--glass-border);
222+
}
223+
224+
.header-nav.open {
225+
display: flex;
198226
}
199227

200228
}

app/templates/header.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
</nav>
1313
<div class="header-right">
1414
<button class="theme-toggle" onclick="toggleTheme()">🌓</button>
15+
<button class="hamburger"></button>
1516
</div>
1617
</header>
1718
<script>
@@ -25,4 +26,12 @@
2526
link.classList.remove("active");
2627
}
2728
});
29+
30+
const hamburger = document.querySelector(".hamburger");
31+
const nav = document.querySelector(".header-nav");
32+
33+
hamburger.addEventListener("click", () => {
34+
nav.classList.toggle("open");
35+
});
36+
2837
</script>

0 commit comments

Comments
 (0)