parent
68ac80ac12
commit
5403448f63
1 changed files with 26 additions and 26 deletions
|
|
@ -1,16 +1,17 @@
|
||||||
---
|
---
|
||||||
const navigationItems = [
|
const navigationItems = [
|
||||||
{ label: "Home", href: "#home" },
|
{ label: "Home", href: "#home" },
|
||||||
{ label: "About", href: "#about" },
|
{ label: "About", href: "#about" },
|
||||||
{ label: "Projects", href: "#projects" },
|
{ label: "Projects", href: "#projects" },
|
||||||
{ label: "Experience", href: "#experience" },
|
{ label: "Experience", href: "#experience" },
|
||||||
|
{ label: "Carrer", href: "#carrer" },
|
||||||
{ label: "Contact", href: "#contact" },
|
{ label: "Contact", href: "#contact" },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
const desktopLinkClass =
|
const desktopLinkClass =
|
||||||
"text-foreground no-underline transition-opacity duration-150 hover:opacity-55 focus-visible:opacity-55";
|
"text-foreground no-underline transition-opacity duration-150 hover:opacity-55 focus-visible:opacity-55";
|
||||||
const mobileLinkClass =
|
const mobileLinkClass =
|
||||||
"block rounded-xl px-3 py-2 text-sm font-semibold text-foreground no-underline transition-colors hover:bg-foreground/5";
|
"block rounded-xl px-3 py-2 text-sm font-semibold text-foreground no-underline transition-colors hover:bg-foreground/5";
|
||||||
---
|
---
|
||||||
|
|
||||||
<header
|
<header
|
||||||
|
|
@ -20,8 +21,10 @@ const mobileLinkClass =
|
||||||
<a
|
<a
|
||||||
class="shrink-0 text-2xl font-bold leading-[normal] text-foreground no-underline max-md:text-xl"
|
class="shrink-0 text-2xl font-bold leading-[normal] text-foreground no-underline max-md:text-xl"
|
||||||
href="#home"
|
href="#home"
|
||||||
data-node-id="43:28">@imnya.ng</a
|
data-node-id="43:28"
|
||||||
>
|
>
|
||||||
|
@imnya.ng
|
||||||
|
</a>
|
||||||
|
|
||||||
<div id="navigation" class="relative flex shrink-0 items-center">
|
<div id="navigation" class="relative flex shrink-0 items-center">
|
||||||
<nav
|
<nav
|
||||||
|
|
@ -29,16 +32,11 @@ const mobileLinkClass =
|
||||||
aria-label="주요 메뉴"
|
aria-label="주요 메뉴"
|
||||||
data-node-id="43:40"
|
data-node-id="43:40"
|
||||||
>
|
>
|
||||||
{
|
{navigationItems.map((item) => (
|
||||||
navigationItems.map((item) => (
|
<a class={desktopLinkClass} href={item.href}>
|
||||||
<a
|
{item.label}
|
||||||
class={desktopLinkClass}
|
</a>
|
||||||
href={item.href}
|
))}
|
||||||
>
|
|
||||||
{item.label}
|
|
||||||
</a>
|
|
||||||
))
|
|
||||||
}
|
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
@ -56,7 +54,8 @@ const mobileLinkClass =
|
||||||
></span>
|
></span>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="absolute h-px w-5 bg-foreground"></span>
|
class="absolute h-px w-5 bg-foreground"
|
||||||
|
></span>
|
||||||
<span
|
<span
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
class="absolute h-px w-5 translate-y-1.5 bg-foreground"
|
class="absolute h-px w-5 translate-y-1.5 bg-foreground"
|
||||||
|
|
@ -68,13 +67,11 @@ const mobileLinkClass =
|
||||||
class="absolute right-0 top-[calc(100%+12px)] z-50 hidden min-w-40 flex-col gap-1 rounded-2xl border border-border bg-background p-2 shadow-[0_12px_30px_rgba(0,0,0,0.18)] md:hidden"
|
class="absolute right-0 top-[calc(100%+12px)] z-50 hidden min-w-40 flex-col gap-1 rounded-2xl border border-border bg-background p-2 shadow-[0_12px_30px_rgba(0,0,0,0.18)] md:hidden"
|
||||||
aria-label="모바일 메뉴"
|
aria-label="모바일 메뉴"
|
||||||
>
|
>
|
||||||
{
|
{navigationItems.map((item) => (
|
||||||
navigationItems.map((item) => (
|
<a class={mobileLinkClass} href={item.href}>
|
||||||
<a class={mobileLinkClass} href={item.href}>
|
{item.label}
|
||||||
{item.label}
|
</a>
|
||||||
</a>
|
))}
|
||||||
))
|
|
||||||
}
|
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
@ -109,7 +106,10 @@ const mobileLinkClass =
|
||||||
});
|
});
|
||||||
|
|
||||||
document.addEventListener("click", (event) => {
|
document.addEventListener("click", (event) => {
|
||||||
if (event.target instanceof Node && !navigation.contains(event.target)) {
|
if (
|
||||||
|
event.target instanceof Node &&
|
||||||
|
!navigation.contains(event.target)
|
||||||
|
) {
|
||||||
setMenuOpen(false);
|
setMenuOpen(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue