From e0154ef94d265dee63b6827268fbf3dd83781391 Mon Sep 17 00:00:00 2001 From: dnlklmn Date: Fri, 19 Jan 2024 21:19:15 +0100 Subject: [PATCH] Animate sidebar --- src/views/projects/Sidebar.svelte | 348 +++++++++++++++--------------- tests/e2e/project.spec.ts | 2 +- tests/e2e/theme.spec.ts | 6 +- 3 files changed, 173 insertions(+), 183 deletions(-) diff --git a/src/views/projects/Sidebar.svelte b/src/views/projects/Sidebar.svelte index 7f8b69c1a..f693d3fcf 100644 --- a/src/views/projects/Sidebar.svelte +++ b/src/views/projects/Sidebar.svelte @@ -88,15 +88,19 @@ display: flex; flex-direction: column; justify-content: space-between; + transition: 150ms ease-in-out; + width: 4.5rem; } - .expanded { + .sidebar.expanded { width: 22.5rem; } .project-navigation { display: flex; flex-direction: column; gap: 0.25rem; + flex: 1; } + .counter { border-radius: var(--border-radius-tiny); background-color: var(--color-fill-ghost); @@ -116,100 +120,149 @@ gap: 0.5rem; justify-content: space-between; width: 100%; + opacity: 0; + transition: 150ms ease-in-out; + } + .title-counter.expanded { + opacity: 1; } .sidebar-footer { display: flex; justify-content: space-between; width: 100%; } + .help { + z-index: 10; + opacity: 0; + } + .help.expanded { + opacity: 1; + transition: 150ms; + transition-delay: 150ms; + } .help-box { + width: 20.5rem; padding: 1rem; + margin-bottom: 0.5rem; background-color: var(--color-background-float); border: 1px solid var(--color-border-hint); font-size: var(--font-size-small); border-radius: var(--border-radius-small); } + .vertical-buttons { + opacity: 1; + height: fit-content; + display: flex; + flex-direction: column-reverse; + transition: 150ms ease-in-out; + transition-delay: 60ms; + margin-bottom: 0.5rem; + } + .vertical-buttons.expanded { + opacity: 0; + height: 0; + } + .horizontal-buttons { + display: flex; + gap: 0.5rem; + opacity: 0; + transition: 30ms ease-in-out; + } + .horizontal-buttons.expanded { + opacity: 1; + transition: 150ms ease-in-out; + } + .icon { + transform: rotate(180deg); + transition: 150ms ease-in-out; + } + .icon.expanded { + transform: rotate(0deg); + } + .bottom { + display: flex; + flex-direction: column; + justify-items: flex-end; + }