Skip to content

Commit d7f0d4a

Browse files
congwang-mkclaude
andcommitted
Fix mobile menu: add nav panel and wire up toggle button
The mobile toggle button (.site-mobile-toggle) had no corresponding nav panel and the JS was targeting the old .mobile-menu-toggle selector. Add a full-screen mobile nav overlay with all navigation links and update the JS to use the correct selectors. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e26f32c commit d7f0d4a

1 file changed

Lines changed: 93 additions & 2 deletions

File tree

_layouts/default.html

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,71 @@
252252
display: block;
253253
border-radius: 1px;
254254
}
255+
/* Mobile nav panel */
256+
.site-mobile-nav {
257+
display: none;
258+
position: fixed;
259+
top: 64px;
260+
left: 0;
261+
right: 0;
262+
bottom: 0;
263+
background: rgba(15, 23, 42, 0.98);
264+
backdrop-filter: blur(16px);
265+
-webkit-backdrop-filter: blur(16px);
266+
z-index: 999998;
267+
overflow-y: auto;
268+
}
269+
.site-mobile-nav.active {
270+
display: block;
271+
}
272+
.site-mobile-nav-inner {
273+
padding: 16px 20px 32px;
274+
display: flex;
275+
flex-direction: column;
276+
gap: 2px;
277+
}
278+
.site-mobile-link {
279+
display: block;
280+
padding: 12px 16px;
281+
font-size: 15px;
282+
font-weight: 500;
283+
color: rgba(255,255,255,0.6);
284+
text-decoration: none;
285+
border-radius: 4px;
286+
transition: color 0.15s, background 0.15s;
287+
}
288+
.site-mobile-link:hover,
289+
.site-mobile-link.active {
290+
color: white;
291+
background: rgba(255,255,255,0.06);
292+
}
293+
.site-mobile-cta {
294+
display: block;
295+
padding: 12px 20px;
296+
font-size: 15px;
297+
font-weight: 600;
298+
color: #0f172a;
299+
background: #e2a23b;
300+
text-decoration: none;
301+
border-radius: 4px;
302+
text-align: center;
303+
margin-top: 12px;
304+
}
305+
.site-mobile-cta:hover {
306+
background: #f5b829;
307+
}
308+
.site-mobile-toggle.active span:nth-child(1) {
309+
transform: rotate(45deg) translate(5px, 5px);
310+
}
311+
.site-mobile-toggle.active span:nth-child(2) {
312+
opacity: 0;
313+
}
314+
.site-mobile-toggle.active span:nth-child(3) {
315+
transform: rotate(-45deg) translate(5px, -5px);
316+
}
317+
.site-mobile-toggle span {
318+
transition: transform 0.2s, opacity 0.2s;
319+
}
255320
@media (max-width: 900px) {
256321
.site-nav { display: none; }
257322
.site-mobile-toggle { display: flex; }
@@ -329,6 +394,23 @@
329394
<span></span>
330395
</button>
331396
</div>
397+
398+
<div class="site-mobile-nav">
399+
<div class="site-mobile-nav-inner">
400+
<a href="/" class="site-mobile-link {% if page.url == '/' %}active{% endif %}">Home</a>
401+
<a href="/products/platform.html" class="site-mobile-link {% if page.url == '/products/platform.html' %}active{% endif %}">Multikernel Platform</a>
402+
<a href="/products/enclaves.html" class="site-mobile-link {% if page.url == '/products/enclaves.html' %}active{% endif %}">Multikernel Enclaves</a>
403+
<a href="/products/resilience.html" class="site-mobile-link {% if page.url == '/products/resilience.html' %}active{% endif %}">Multikernel Resilience</a>
404+
<a href="/technology.html" class="site-mobile-link {% if page.url == '/technology.html' %}active{% endif %}">Technology</a>
405+
<a href="/roadmap.html" class="site-mobile-link {% if page.url == '/roadmap.html' %}active{% endif %}">Roadmap</a>
406+
<a href="/faq.html" class="site-mobile-link {% if page.url == '/faq.html' %}active{% endif %}">FAQ</a>
407+
<a href="/getting-started.html" class="site-mobile-link {% if page.url == '/getting-started.html' %}active{% endif %}">Getting Started</a>
408+
<a href="/blog/" class="site-mobile-link {% if page.url contains '/blog' or page.layout == 'post' %}active{% endif %}">Blog</a>
409+
<a href="/about.html" class="site-mobile-link {% if page.url == '/about.html' %}active{% endif %}">About</a>
410+
<a href="https://github.com/multikernel" target="_blank" class="site-mobile-link">GitHub</a>
411+
<a href="https://calendar.app.google/nc1upkqQoUeoukdD9" target="_blank" rel="noopener noreferrer" class="site-mobile-cta">Schedule a Demo</a>
412+
</div>
413+
</div>
332414
</header>
333415

334416
{{ content }}
@@ -435,8 +517,8 @@ <h4>Resources</h4>
435517
}
436518

437519
// Mobile menu functionality
438-
const mobileToggle = document.querySelector('.mobile-menu-toggle');
439-
const mobileNav = document.querySelector('.mobile-nav');
520+
const mobileToggle = document.querySelector('.site-mobile-toggle');
521+
const mobileNav = document.querySelector('.site-mobile-nav');
440522
const body = document.body;
441523

442524
if (mobileToggle && mobileNav) {
@@ -446,6 +528,15 @@ <h4>Resources</h4>
446528
body.classList.toggle('mobile-nav-open');
447529
});
448530

531+
// Close mobile nav when tapping a link
532+
mobileNav.querySelectorAll('a').forEach(function(link) {
533+
link.addEventListener('click', function() {
534+
mobileNav.classList.remove('active');
535+
mobileToggle.classList.remove('active');
536+
body.classList.remove('mobile-nav-open');
537+
});
538+
});
539+
449540
// Close mobile nav when clicking outside
450541
document.addEventListener('click', function(e) {
451542
if (!mobileNav.contains(e.target) && !mobileToggle.contains(e.target)) {

0 commit comments

Comments
 (0)