mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Add transition for submenu
This commit is contained in:
1 parent
064add4827
commit
e4db14f084
3 files changed
+17
-16
No files matched your search
@@ -28,7 +28,6 @@
|
||||
import { feedback } from '$lib/stores/feedback';
|
||||
import { DropList } from '$lib/components/index';
|
||||
import { Feedback } from '$lib/components/feedback';
|
||||
import { type ComponentType } from 'svelte';
|
||||
import { getSidebarState, updateSidebarState } from '$lib/helpers/sidebar';
|
||||
import { isTabletViewport } from '$lib/stores/viewport';
|
||||
|
||||
@@ -42,7 +41,6 @@
|
||||
};
|
||||
sideBarIsOpen: boolean;
|
||||
showAccountMenu: boolean;
|
||||
subNavigation?: ComponentType;
|
||||
};
|
||||
|
||||
export let state: $$Props['state'] = 'icons';
|
||||
@@ -51,7 +49,6 @@
|
||||
export let progressCard: $$Props['progressCard'] = undefined;
|
||||
export let sideBarIsOpen: boolean;
|
||||
export let showAccountMenu: boolean;
|
||||
export let subNavigation = undefined;
|
||||
|
||||
function toggleFeedback() {
|
||||
feedback.toggleFeedback();
|
||||
@@ -76,7 +73,7 @@
|
||||
</script>
|
||||
|
||||
<div class:only-mobile={project === undefined}>
|
||||
<Sidebar.Base {...$$props} bind:state resizable={subNavigation === undefined}>
|
||||
<Sidebar.Base {...$$props} bind:state resizable={true}>
|
||||
<div slot="top">
|
||||
<div class="only-mobile-tablet top">
|
||||
<div class="icons">
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import { slide } from '$lib/helpers/transition';
|
||||
import { getContext } from 'svelte';
|
||||
import type { Writable } from 'svelte/store';
|
||||
|
||||
export let state: 'closed' | 'open' | 'icons' = 'open';
|
||||
export let subNavigation;
|
||||
|
||||
$: project = $page.params.project;
|
||||
|
||||
$: subNavigation = $page.data.subNavigation;
|
||||
// We need to have this second variable, because we only want narrow
|
||||
// to change automatically if we change from having a second side nav to
|
||||
@@ -44,14 +41,20 @@
|
||||
.level-2-nav {
|
||||
display: none;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
@media (min-width: 1024px) {
|
||||
display: block;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
left: 200px;
|
||||
transition: left 0.2s ease-in-out;
|
||||
margin-left: -5px;
|
||||
}
|
||||
}
|
||||
|
||||
:global(.level-2-nav nav) {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.icons {
|
||||
left: 54px;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
let subNavigation: undefined | ComponentType = $page.data.subNavigation;
|
||||
let state: undefined | 'open' | 'closed' | 'icons' = 'closed';
|
||||
$: state = sideBarIsOpen ? 'open' : 'closed';
|
||||
$: state = subNavigation && !$isSmallViewport ? 'icons' : sideBarIsOpen ? 'open' : 'closed';
|
||||
$: state = !$isSmallViewport ? 'icons' : sideBarIsOpen ? 'open' : 'closed';
|
||||
|
||||
function handleResize() {
|
||||
sideBarIsOpen = false;
|
||||
@@ -160,13 +160,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
:global(main:has(.level-2-nav)) {
|
||||
.content {
|
||||
width: calc(100% - 200px);
|
||||
margin-left: 200px;
|
||||
}
|
||||
}
|
||||
|
||||
.has-transition {
|
||||
@media (min-width: 1024px) {
|
||||
transition: all 0.3s ease-in-out;
|
||||
@@ -181,6 +174,14 @@
|
||||
min-height: calc(100vh - 30px);
|
||||
}
|
||||
|
||||
:global(main:has(.level-2-nav)) {
|
||||
.main-content {
|
||||
@media (min-width: 1024px) {
|
||||
padding-left: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.overlay {
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
|
||||
Reference in new issue
Block a user