Skip to content

Commit 6a75ed6

Browse files
committed
refactor: SideNav 컴포넌트를 TopNav로 이름 변경 및 레이아웃 수정
1 parent c6c15ad commit 6a75ed6

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import {type Icon as IconType, House, Cog} from "@lucide/astro";
3-
import SideNavItem from "./SideNavItem.astro";
3+
import TopNavItem from "./TopNavItem.astro";
44
55
type MenuItem = {
66
name: string;
@@ -22,18 +22,18 @@ const menuItems: MenuItem[] = [
2222
];
2323
---
2424

25-
<div transition:name="header" class="w-70 h-full flex flex-col bg-[#1e1e1e] border-r border-bright/50 p-8 gap-9 z-40">
26-
<div class="w-full flex flex-row items-center">
27-
<div class="rounded-full w-12 h-12 bg-[url(/images/anvy_profile.png)] bg-center bg-cover"/>
25+
<nav transition:name="header" class="w-full flex flex-row justify-between border border-bright/50 rounded-full sticky top-4 px-5 py-3 gap-9 z-40 backdrop-blur-[2px]">
26+
<div class="flex flex-row items-center">
27+
<div class="rounded-full w-10 h-10 bg-[url(/images/anvy_profile.png)] bg-center bg-cover"/>
2828
<div class="ml-4">
2929
<h1 class="text-bright text-lg font-bold">Chamchi</h1>
3030
<p class="text-bright text-sm">Web & Game Dev</p>
3131
</div>
3232
</div>
33-
<div class="flex flex-col gap-3">
33+
<div class="flex flex-row gap-6">
3434
{menuItems.map(item =>
35-
<SideNavItem icon={item.icon} label={item.name} pathname={item.pathname}>
35+
<TopNavItem icon={item.icon} label={item.name} pathname={item.pathname}>
3636
<item.icon/>
37-
</SideNavItem>)}
37+
</TopNavItem>)}
3838
</div>
39-
</div>
39+
</nav>
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ const {pathname, label, icon} = Astro.props;
1111
const active = pathname === (Astro.url.pathname.replace(/\/+$/, '') || "/");
1212
---
1313

14-
<a href={pathname} class=`p-3 flex flex-row items-center gap-3 cursor-pointer rounded-full text-bright select-none transition-all
15-
hover:bg-bright hover:text-gray-950
16-
active:scale-105
17-
${active && 'bg-bright text-gray-950'}`>
14+
<a href={pathname} class=`px-4 flex flex-row items-center gap-3 cursor-pointer rounded-full text-bright select-none transition-all
15+
hover:bg-bright hover:text-gray-950 hover:scale-110
16+
${active && 'bg-bright text-gray-950 scale-110'}`>
1817
<slot/>
1918
<span>{label}</span>
2019
</a>

src/layouts/Layout.astro

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
import "../assets/app.css";
3-
import SideNav from "../components/SideNav.astro";
3+
import TopNav from "../components/TopNav.astro";
44
import {ClientRouter, fade} from "astro:transitions";
55
---
66
<!doctype html>
@@ -14,10 +14,12 @@ import {ClientRouter, fade} from "astro:transitions";
1414
<ClientRouter/>
1515
</head>
1616
<body>
17-
<SideNav/>
18-
<main transition:animate={fade({duration: '0.4s'})}>
19-
<slot/>
20-
</main>
17+
<div class="flex flex-col items-center w-full max-w-3xl mx-4">
18+
<TopNav/>
19+
<main transition:animate={fade({duration: '0.5s'})}>
20+
<slot/>
21+
</main>
22+
</div>
2123
</body>
2224
</html>
2325

@@ -30,11 +32,12 @@ import {ClientRouter, fade} from "astro:transitions";
3032
body {
3133
display: flex;
3234
flex-direction: row;
35+
justify-content: center;
3336
width: 100%;
3437
height: 100%;
3538
background-color: #222222;
3639
opacity: 1;
37-
background-image: linear-gradient(rgba(28, 28, 28, 0.64), rgba(28, 28, 28, 0.64)), url('/images/grid-top-right.svg'), linear-gradient(rgba(28, 28, 28, 0.24), rgba(28, 28, 28, 0.24));
40+
background-image: linear-gradient(rgba(28, 28, 28, 0.5), rgba(28, 28, 28, 0.5)), url('/images/grid-top-right.svg'), linear-gradient(rgba(28, 28, 28, 0.24), rgba(28, 28, 28, 0.24));
3841
background-position: center;
3942
background-size: cover;
4043
}

0 commit comments

Comments
 (0)