mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-08 02:57:32 +08:00
feat: add initial Nuxt frontend with SSR
This commit is contained in:
93
frontend_nuxt/app.vue
Normal file
93
frontend_nuxt/app.vue
Normal file
@@ -0,0 +1,93 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<div class="header-container">
|
||||
<HeaderComponent @toggle-menu="menuVisible = !menuVisible" :show-menu-btn="!hideMenu" />
|
||||
</div>
|
||||
|
||||
<div class="main-container">
|
||||
<div class="menu-container">
|
||||
<MenuComponent :visible="!hideMenu && menuVisible" @item-click="menuVisible = false" />
|
||||
</div>
|
||||
<div class="content" :class="{ 'menu-open': menuVisible && !hideMenu }">
|
||||
<NuxtPage />
|
||||
</div>
|
||||
</div>
|
||||
<GlobalPopups />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import HeaderComponent from '~/components/HeaderComponent.vue'
|
||||
import MenuComponent from '~/components/MenuComponent.vue'
|
||||
import GlobalPopups from '~/components/GlobalPopups.vue'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: { HeaderComponent, MenuComponent, GlobalPopups },
|
||||
data() {
|
||||
return {
|
||||
menuVisible: process.client ? window.innerWidth > 768 : false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hideMenu() {
|
||||
return [
|
||||
'/login',
|
||||
'/signup',
|
||||
'/404',
|
||||
'/signup-reason',
|
||||
'/github-callback',
|
||||
'/twitter-callback',
|
||||
'/discord-callback',
|
||||
'/forgot-password',
|
||||
'/google-callback'
|
||||
].includes(this.$route.path)
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
// placeholder for future global initializations
|
||||
},
|
||||
methods: {}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.header-container {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.menu-container {}
|
||||
|
||||
.content {
|
||||
/* height: calc(100vh - var(--header-height)); */
|
||||
padding-top: var(--header-height);
|
||||
flex: 1;
|
||||
max-width: 100%;
|
||||
transition: max-width 0.3s ease;
|
||||
background-color: var(--background-color);
|
||||
min-height: calc(100vh - var(--header-height));
|
||||
}
|
||||
|
||||
.content.menu-open {
|
||||
max-width: calc(100% - var(--menu-width));
|
||||
}
|
||||
|
||||
.main-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
max-width: var(--page-max-width);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
|
||||
.content,
|
||||
.content.menu-open {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user