Polarcraft/webv2/layouts/default.vue

37 lines
1.0 KiB
Vue
Raw Normal View History

2023-06-04 22:47:48 +02:00
<template>
2023-06-25 17:48:22 +02:00
<div class="flex w-full">
2023-06-12 15:56:09 +02:00
<Transition>
<BodySidebar v-if="showSidebar && user.minecraft" />
2023-06-12 15:56:09 +02:00
</Transition>
2023-06-25 17:48:22 +02:00
<div class="h-screen w-full overflow-y-auto px-5 transition-all duration-300 ease-in-out" :class="{ 'xl:ms-56': showSidebar && user.minecraft }">
<div v-if="user.minecraft" class="mx-auto flex h-full w-full max-w-[92rem] flex-col">
2023-06-12 15:56:09 +02:00
<div class="my-5 text-xl font-bold">
<Icon size="1.6em" :name="!showSidebar ? 'heroicons:bars-3-center-left' : 'heroicons:chevron-left'" class="text-primary-500 mr-3 hover:cursor-pointer" @click="showSidebar = !showSidebar" />
2023-06-24 13:47:40 +02:00
{{ route.meta.title }}
2023-06-12 15:56:09 +02:00
</div>
2023-06-25 17:48:22 +02:00
<NuxtPage class="h-full" />
2023-06-12 15:56:09 +02:00
</div>
<BodyConnectminecraft v-else />
2023-06-12 15:56:09 +02:00
</div>
2023-06-04 22:47:48 +02:00
</div>
</template>
2023-06-12 15:56:09 +02:00
<script lang="ts" setup>
2023-06-12 15:56:09 +02:00
const route = useRoute()
2023-06-12 16:48:38 +02:00
const showSidebar = ref(true)
const user = useState<IUser>('user')
2023-06-12 15:56:09 +02:00
</script>
<style>
.v-enter-active,
.v-leave-active {
transition: transform 0.3s ease;
}
.v-leave-to,
.v-enter-from {
transform: translateX(-100%);
}
</style>