[] MainLayout 수정 중

This commit is contained in:
김선규 2025-04-22 17:38:12 +09:00
parent d31369f49c
commit deba36e3d5
6 changed files with 86 additions and 59 deletions

View File

@ -1,8 +1,10 @@
<Router AppAssembly="@typeof(App).Assembly"> <Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData"> <Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /> <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
<FocusOnNavigate RouteData="@routeData" Selector="h1" /> <FocusOnNavigate RouteData="@routeData" Selector="h1"/>
</Found> </Found>
<NotFound> <NotFound>
<PageTitle>Not found</PageTitle> <PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)"> <LayoutView Layout="@typeof(MainLayout)">

View File

@ -1,16 +1,24 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
<div class="page"> <div class="page">
<div class="sidebar"> <div class="top-row navbar navbar-dark bg-dark px-3">
<NavMenu /> <div class="top-title">
@* <TopMenu /> *@
<h1 class = "prj-title">PROJECT</h1>
</div>
<div class="top-menu">
<TopMenu />
</div>
</div> </div>
<main> <main>
<div class="top-row px-4"> <div class="side-menu">
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a> <NavMenu />
</div> </div>
<article class="content px-4"> <article class="content">
@Body @Body
</article> </article>
</main> </main>
</div> </div>

View File

@ -1,77 +1,93 @@
.page { .page {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} height: 100vh;
overflow: hidden;
main {
flex: 1;
}
.sidebar {
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
} }
.top-row { .top-row {
background-color: #f7f7f7; position: fixed;
border-bottom: 1px solid #d6d5d5; top: 0;
justify-content: flex-end; left: 0;
right: 0;
height: 3.5rem; height: 3.5rem;
display: flex; display: flex;
align-items: center; align-items: center;
background-color: #f7f7f7;
border-bottom: 1px solid #ddd;
z-index: 100;
padding: 0 1rem;
} }
.top-row ::deep a, .top-row ::deep .btn-link { .top-title {
white-space: nowrap; width: 250px;
margin-left: 1.5rem; font-weight: bold;
text-decoration: none; }
}
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover { .top-menu {
text-decoration: underline; flex: 1;
} display: flex;
justify-content: flex-end;
gap: 1rem;
}
.top-row ::deep a:first-child { /* 본문 구조 */
main {
display: flex;
flex: 1;
margin-top: 3.5rem;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; /*height: calc(100vh - 3.5rem);*/
} }
@media (max-width: 640.98px) { .side-menu {
width: 250px;
background: linear-gradient(180deg, rgb(5, 39, 103), #3a0647);
color: white;
padding: 1rem;
overflow-y: auto;
flex-shrink: 0;
}
.content {
flex: 1;
padding: 1.5rem;
overflow-y: auto;
background-color: #fff;
}
/* ✅ 모바일 대응 */
@media (max-width: 768px) {
.top-row { .top-row {
flex-direction: row;
justify-content: space-between; justify-content: space-between;
} }
.top-row ::deep a, .top-row ::deep .btn-link { .top-title {
margin-left: 0; width: auto;
font-size: 1rem;
} }
}
@media (min-width: 641px) { .top-menu {
.page { justify-content: flex-end;
}
main {
flex-direction: column;
height: calc(100vh - 3.5rem);
}
.side-menu {
display: flex;
flex-direction: row; flex-direction: row;
overflow-x: auto;
width: 100%;
white-space: nowrap;
padding: 0.5rem 1rem;
} }
.sidebar { .content {
width: 250px;
height: 100vh;
position: sticky;
top: 0;
}
.top-row {
position: sticky;
top: 0;
z-index: 1;
}
.top-row.auth ::deep a:first-child {
flex: 1; flex: 1;
text-align: right; padding: 1rem;
width: 0;
}
.top-row, article {
padding-left: 2rem !important;
padding-right: 1.5rem !important;
} }
} }

View File

@ -0,0 +1 @@
<h3>TopMenu</h3>

View File

View File

@ -7,7 +7,7 @@
<!-- 반응형 웹 설정 --> <!-- 반응형 웹 설정 -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- 브라우저의 탭에 표시되는 제목 --> <!-- 브라우저의 탭에 표시되는 제목 -->
<title>Front</title> <title>AcaMate</title>
<!-- 라우팅 시스템을 위한 기본 주소. 절대 경로로 링크를 인식하게 함 --> <!-- 라우팅 시스템을 위한 기본 주소. 절대 경로로 링크를 인식하게 함 -->
<base href="/" /> <base href="/" />
<!-- CSS 파일 연결 부분 --> <!-- CSS 파일 연결 부분 -->