mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-21 22:41:05 +08:00
feat: main layout
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<HeaderComponent @toggle-menu="menuVisible = !menuVisible" />
|
||||
<MenuComponent :visible="menuVisible" />
|
||||
<div class="content" :class="{ 'with-menu': menuVisible }">
|
||||
<router-view />
|
||||
|
||||
<div class="main-container">
|
||||
<MenuComponent :visible="menuVisible" />
|
||||
<div class="content" :class="{ 'with-menu': menuVisible }">
|
||||
<router-view />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -22,22 +25,18 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
}
|
||||
.content {
|
||||
margin-left: 0;
|
||||
transition: margin-left 0.3s ease;
|
||||
padding-top: 60px;
|
||||
}
|
||||
.content.with-menu {
|
||||
margin-left: 200px;
|
||||
|
||||
.main-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: row;
|
||||
max-width: var(--page-max-width);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color: var(--normal-background-color);
|
||||
}
|
||||
>>>>>>> 09bbafa1912b3a87115018c72230fd57e8d08aff
|
||||
|
||||
</style>
|
||||
|
||||
13
open-isle-cli/src/assets/global.css
Normal file
13
open-isle-cli/src/assets/global.css
Normal file
@@ -0,0 +1,13 @@
|
||||
:root {
|
||||
--header-height: 60px;
|
||||
--header-background-color: gray;
|
||||
--menu-background-color: darkgray;
|
||||
--normal-background-color: lightgray;
|
||||
--menu-width: 200px;
|
||||
--page-max-width: 1200px;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
@@ -16,9 +16,9 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 20px;
|
||||
background-color: #42b983;
|
||||
color: white;
|
||||
height: var(--header-height);
|
||||
background-color: var(--header-background-color);
|
||||
color: var(--header-text-color);
|
||||
}
|
||||
.menu-btn {
|
||||
font-size: 24px;
|
||||
|
||||
@@ -23,13 +23,9 @@ export default {
|
||||
<style scoped>
|
||||
.menu {
|
||||
width: 200px;
|
||||
background-color: #f5f5f5;
|
||||
padding: 10px;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-color: var(--menu-background-color);
|
||||
overflow-y: auto;
|
||||
height: calc(100vh - var(--header-height));
|
||||
}
|
||||
.slide-enter-active, .slide-leave-active {
|
||||
transition: transform 0.3s ease;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import './assets/global.css'
|
||||
|
||||
createApp(App).use(router).mount('#app')
|
||||
|
||||
@@ -13,6 +13,7 @@ export default {
|
||||
|
||||
<style scoped>
|
||||
.home-page {
|
||||
padding: 20px;
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user