style: transition sidebar and topbar
This commit is contained in:
@@ -25,6 +25,22 @@ const self = getCurrentInstance()
|
|||||||
const open = ref(active ? true : false)
|
const open = ref(active ? true : false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.slide-fade-enter-active {
|
||||||
|
transition: all 0.3s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-fade-leave-active {
|
||||||
|
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.slide-fade-enter-from,
|
||||||
|
.slide-fade-leave-to {
|
||||||
|
transform: translateX(-20px);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="w-full flex flex-col">
|
<div class="w-full flex flex-col">
|
||||||
<button @click.prevent="open = ! open" class="w-full p-4" :class="`${themes().get('sidebar', 'bg-slate-700 text-gray-200')} ${open && 'dark:bg-gray-800'} pl-${padding !== 0 && padding}`">
|
<button @click.prevent="open = ! open" class="w-full p-4" :class="`${themes().get('sidebar', 'bg-slate-700 text-gray-200')} ${open && 'dark:bg-gray-800'} pl-${padding !== 0 && padding}`">
|
||||||
@@ -35,8 +51,10 @@ const open = ref(active ? true : false)
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div v-if="open" class="flex flex-col" ref="container">
|
<Transition name="slide-fade" mode="in-out">
|
||||||
<slot />
|
<div v-if="open" class="flex flex-col" ref="container">
|
||||||
</div>
|
<slot />
|
||||||
|
</div>
|
||||||
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -23,15 +23,18 @@ const logout = async () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.slide-enter-active, .slide-leave-active {
|
.slide-enter-active, .slide-leave-active {
|
||||||
transition: all 500ms ease-in-out;
|
transition: all 500ms ease-in-out;
|
||||||
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slide-enter-from, .slide-leave-to {
|
.slide-enter-from, .slide-leave-to {
|
||||||
right: -100vw;
|
right: -100vw;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 669px) {
|
@media (min-width: 669px) {
|
||||||
.slide-enter-from, .slide-leave-to {
|
.slide-enter-from, .slide-leave-to {
|
||||||
right: -15rem;
|
right: -12rem;
|
||||||
|
opacity: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user