Polarcraft/webv2/layouts/default.vue

34 lines
916 B
Vue
Raw Normal View History

2023-06-04 22:47:48 +02:00
<template>
2023-06-12 15:56:09 +02:00
<div class="flex min-h-screen w-full overflow-y-auto">
<Transition>
<BodySidebar v-if="showSidebar" />
</Transition>
<div class="w-full px-5 transition-all duration-300 ease-in-out" :class="{ 'ms-56': showSidebar }">
<div class="mx-auto w-full max-w-[92rem]">
<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" />
{{ route.meta.title.split(' | ')[0] }}
</div>
<NuxtPage class="" />
</div>
</div>
2023-06-04 22:47:48 +02:00
</div>
</template>
2023-06-12 15:56:09 +02:00
<script setup>
const route = useRoute()
2023-06-12 16:48:38 +02:00
const showSidebar = ref(true)
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>