pre-agent: Fix mobile menu full-screen overlay

This commit is contained in:
platform-mcp
2026-06-17 20:18:23 +05:30
parent a5c6e32734
commit bc10d5fe4b
+11 -6
View File
@@ -17,6 +17,7 @@ const navLinks = [
{ name: 'Portfolio', href: '/portfolio' }, { name: 'Portfolio', href: '/portfolio' },
{ name: 'Blog', href: '/blog' }, { name: 'Blog', href: '/blog' },
{ name: 'Contact', href: '/contact' }, { name: 'Contact', href: '/contact' },
{ name: 'WRNexus', href: 'https://wrnexus.com/', external: true },
]; ];
const currentPath = Astro.url.pathname; const currentPath = Astro.url.pathname;
@@ -49,14 +50,16 @@ const currentPath = Astro.url.pathname;
<!-- Desktop Navigation --> <!-- Desktop Navigation -->
<ul class="hidden lg:flex items-center gap-1" role="menubar"> <ul class="hidden lg:flex items-center gap-1" role="menubar">
{navLinks.map((link) => { {navLinks.map((link) => {
const isActive = currentPath === link.href || const isActive = !link.external && (currentPath === link.href ||
(link.href !== '/' && currentPath.startsWith(link.href)); (link.href !== '/' && currentPath.startsWith(link.href)));
return ( return (
<li role="none"> <li role="none">
<a <a
href={link.href} href={link.href}
role="menuitem" role="menuitem"
data-astro-prefetch="hover" data-astro-prefetch={link.external ? undefined : 'hover'}
target={link.external ? '_blank' : undefined}
rel={link.external ? 'noopener noreferrer' : undefined}
class:list={[ class:list={[
'relative px-4 py-2 text-sm font-medium transition-colors rounded-lg', 'relative px-4 py-2 text-sm font-medium transition-colors rounded-lg',
isActive isActive
@@ -164,14 +167,16 @@ const currentPath = Astro.url.pathname;
<nav class="flex-1 overflow-y-auto py-4"> <nav class="flex-1 overflow-y-auto py-4">
<ul class="space-y-1 px-3" role="menu"> <ul class="space-y-1 px-3" role="menu">
{navLinks.map((link, index) => { {navLinks.map((link, index) => {
const isActive = currentPath === link.href || const isActive = !link.external && (currentPath === link.href ||
(link.href !== '/' && currentPath.startsWith(link.href)); (link.href !== '/' && currentPath.startsWith(link.href)));
return ( return (
<li role="none" style={`--delay: ${index * 50}ms`}> <li role="none" style={`--delay: ${index * 50}ms`}>
<a <a
href={link.href} href={link.href}
role="menuitem" role="menuitem"
data-astro-prefetch="hover" data-astro-prefetch={link.external ? undefined : 'hover'}
target={link.external ? '_blank' : undefined}
rel={link.external ? 'noopener noreferrer' : undefined}
class:list={[ class:list={[
'mobile-nav-link flex items-center gap-3 px-4 py-3 rounded-lg text-base font-medium transition-all duration-200', 'mobile-nav-link flex items-center gap-3 px-4 py-3 rounded-lg text-base font-medium transition-all duration-200',
isActive isActive