feat: page layout

This commit is contained in:
tim
2025-07-02 22:02:45 +08:00
parent bfc0f95c8f
commit ce2ff8c94a
3 changed files with 16 additions and 10 deletions

View File

@@ -4,7 +4,7 @@
<div class="main-container"> <div class="main-container">
<MenuComponent :visible="menuVisible" /> <MenuComponent :visible="menuVisible" />
<div class="content" :class="{ 'with-menu': menuVisible }"> <div class="content">
<router-view /> <router-view />
</div> </div>
</div> </div>
@@ -26,16 +26,13 @@ export default {
<style> <style>
.content { .content {
transition: margin-left 0.3s ease; flex: 1;
} }
.main-container { .main-container {
display: flex; display: flex;
justify-content: center;
flex-direction: row; flex-direction: row;
max-width: var(--page-max-width); max-width: var(--page-max-width);
margin-left: auto; margin: 0 auto;
margin-right: auto;
background-color: var(--normal-background-color); background-color: var(--normal-background-color);
} }

View File

@@ -24,13 +24,22 @@ export default {
.menu { .menu {
width: 200px; width: 200px;
background-color: var(--menu-background-color); background-color: var(--menu-background-color);
overflow-y: auto;
height: calc(100vh - var(--header-height)); height: calc(100vh - var(--header-height));
} }
.slide-enter-active, .slide-leave-active { .slide-enter-active, .slide-leave-active {
transition: transform 0.3s ease; transition:
transform 0.3s ease,
opacity 0.3s ease,
width 0.3s ease;
} }
.slide-enter-from, .slide-leave-to { .slide-enter-from, .slide-leave-to {
transform: translateX(-100%); transform: translateX(-100%);
opacity: 0;
width: 0;
}
.slide-enter-to, .slide-leave-from {
transform: translateX(0);
opacity: 1;
width: 200px;
} }
</style> </style>

View File

@@ -1,7 +1,6 @@
<template> <template>
<div class="home-page"> <div class="home-page">
<h1>Home Page</h1> hello?
<p>Welcome to OpenIsle</p>
</div> </div>
</template> </template>
@@ -15,5 +14,6 @@ export default {
.home-page { .home-page {
background-color: white; background-color: white;
color: black; color: black;
height: 100%;
} }
</style> </style>