pre-agent: Fix mobile menu full-screen overlay
This commit is contained in:
@@ -17,6 +17,7 @@ const navLinks = [
|
||||
{ name: 'Portfolio', href: '/portfolio' },
|
||||
{ name: 'Blog', href: '/blog' },
|
||||
{ name: 'Contact', href: '/contact' },
|
||||
{ name: 'WRNexus', href: 'https://wrnexus.com/', external: true },
|
||||
];
|
||||
|
||||
const currentPath = Astro.url.pathname;
|
||||
@@ -49,14 +50,16 @@ const currentPath = Astro.url.pathname;
|
||||
<!-- Desktop Navigation -->
|
||||
<ul class="hidden lg:flex items-center gap-1" role="menubar">
|
||||
{navLinks.map((link) => {
|
||||
const isActive = currentPath === link.href ||
|
||||
(link.href !== '/' && currentPath.startsWith(link.href));
|
||||
const isActive = !link.external && (currentPath === link.href ||
|
||||
(link.href !== '/' && currentPath.startsWith(link.href)));
|
||||
return (
|
||||
<li role="none">
|
||||
<a
|
||||
href={link.href}
|
||||
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={[
|
||||
'relative px-4 py-2 text-sm font-medium transition-colors rounded-lg',
|
||||
isActive
|
||||
@@ -164,14 +167,16 @@ const currentPath = Astro.url.pathname;
|
||||
<nav class="flex-1 overflow-y-auto py-4">
|
||||
<ul class="space-y-1 px-3" role="menu">
|
||||
{navLinks.map((link, index) => {
|
||||
const isActive = currentPath === link.href ||
|
||||
(link.href !== '/' && currentPath.startsWith(link.href));
|
||||
const isActive = !link.external && (currentPath === link.href ||
|
||||
(link.href !== '/' && currentPath.startsWith(link.href)));
|
||||
return (
|
||||
<li role="none" style={`--delay: ${index * 50}ms`}>
|
||||
<a
|
||||
href={link.href}
|
||||
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={[
|
||||
'mobile-nav-link flex items-center gap-3 px-4 py-3 rounded-lg text-base font-medium transition-all duration-200',
|
||||
isActive
|
||||
|
||||
Reference in New Issue
Block a user