fix transition and adding more responsive layout in mobile

This commit is contained in:
Geriano
2022-07-23 15:37:30 +07:00
parent 2e103128d4
commit 58cee6aba5
2 changed files with 16 additions and 8 deletions

View File

@@ -30,13 +30,15 @@ onMounted(() => window.addEventListener('resize', () => open.value = window.inne
<div class="flex bg-gray-200 dark:bg-gray-900 w-full h-screen max-h-screen font-sans">
<Head :title="title" />
<div class="flex-none flex flex-col transition-all ease-in-out duration-300" :class="`${themes().get('sidebar', 'bg-gray-700 text-gray-200 hover:bg-gray-800 hover:text-gray-100 transition-all ease-in-out duration-150').replace(/hover:(bg|text)-(.*?)-(\d+)/)} ${open ? 'w-60' : 'w-0'}`">
<div class="flex-none flex items-center justify-between w-full h-14 px-2" :class="themes().get('topbar', 'bg-cyan-500 text-gray-700 hover:bg-cyan-600 hover:text-gray-800 transition-all ease-in-out duration-150').replace(/hover:(bg|text)-(.*?)-(\d+)/, '')">
<div ref="sidebar" class="fixed sm:static flex-none flex flex-col h-full transition-all ease-in-out duration-300 z-10" :class="`${themes().get('sidebar', 'bg-gray-700 text-gray-200 hover:bg-gray-800 hover:text-gray-100 transition-all ease-in-out duration-100').replace(/hover:(bg|text)-(.*?)-(\d+)/)} ${open ? 'w-full sm:w-60' : 'w-0'}`">
<div v-if="open" class="flex-none flex items-center justify-between w-full h-14 px-2" :class="themes().get('topbar', 'bg-cyan-500 text-gray-700 hover:bg-cyan-600 hover:text-gray-800 transition-all ease-in-out duration-150').replace(/hover:(bg|text)-(.*?)-(\d+)/, '')">
<Toggler @toggle="open = ! open" class="sm:hidden" />
<h1 class="text-2xl text-center font-bold w-full">Template</h1>
<Toggler class="sm:hidden" />
<div class="flex-none sm:hidden">
<TopbarDropdown />
</div>
</div>
<Sidebar v-if="open" />