From c18ec3084edc9a4a9c70a50a14ca5c41432cbd11 Mon Sep 17 00:00:00 2001 From: Johanna Kuehner Date: Mon, 18 Dec 2023 16:54:25 +0100 Subject: [PATCH] solved transition problem of actionbar --- layouts/Actionbar.vue | 253 +++++++++++++++++++++++++++++++++--------- 1 file changed, 198 insertions(+), 55 deletions(-) diff --git a/layouts/Actionbar.vue b/layouts/Actionbar.vue index 5ac4483..1457e83 100644 --- a/layouts/Actionbar.vue +++ b/layouts/Actionbar.vue @@ -1,73 +1,104 @@ + @@ -80,73 +111,110 @@ export default { } - .actionbar { + aside.actionbar { display: flex; flex-direction: column; position: sticky; top: 5rem; - align-items: flex-start; - justify-content: center; - width: fit-content; height: fit-content; + width: fit-content; + inline-size: fit-content; border-radius: 0.625rem; + flex: 0 0 0; + align-items: stretch; + justify-content: center; padding: 1.875rem 0.625rem; gap: 1.25rem; + transition: all 10s ease-in-out 0s; + overflow: clip; + } + .actionbar-darkmode { box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25); - background-color: #2c2c2c; + background-color: #2C2C2C; + } + .actionbar-lightmode { + box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25); + background-color: #FFFFFF; + } + aside.is-expanded { + animation: expand 0.5s linear both; + } + aside.is-not-expanded { + animation: contract 0.5s linear both; + width: stretch; + inline-size: stretch; } .actions { display: flex; flex-direction: column; - align-items: stretch; + align-items: flex-start; justify-content: center; - align-self: stretch; padding: 1.25rem 0; gap: 1.25rem; + overflow: clip; } button { display: flex; flex-direction: row; - align-items: center; - justify-content: flex-start; + align-self: stretch; height: 1.875rem; border-radius: 0.625rem; + align-items: center; + justify-content: flex-start; border: none; - background-color: #2c2c2c; - transition-duration: 0.5s; + transition: 0.2s ease-in-out; + overflow: clip; + gap: 0.125rem } - button:hover { + .button-darkmode { + background-color: #2C2C2C; + } + .button-lightmode { + background-color: #FFFFFF; + } + .button-darkmode:hover, .indicator-darkmode:hover { background-color: #444444; } + .button-lightmode:hover, .indicator-lightmode:hover { + background-color: #ACACAC; + } + .is-not-expanded > button { + align-self: center; + gap: 0.5rem; + } .icon { display: flex; flex-direction: row; + /*width: 0.875rem;*/ + height: 1.875rem; align-items: center; justify-content: center; - width: 1.875rem; - height: 1.875rem; + padding: 0 0.5rem; + transition: padding 0.5s linear } #indicator-icon { width: 1.875rem; height: 1.875rem; border-radius: 0.3125rem; - background-color: #2c2c2c; - transition-duration: 0.5s; + transition: 0.2s ease-in-out; } - #indicator-icon:hover { - background-color: #444444; + .is-not-expanded .icon { + align-self: center; + padding: 0 0.375rem; + } + .is-not-expanded #indicator-icon { + transform: rotate(180deg); } - .icon > img { + img { width: 0.875rem; height: 0.875rem; - filter: invert(100%); object-fit: contain; object-position: center; overflow: hidden; @@ -154,15 +222,90 @@ export default { #indicator-icon > img { height: 1.25rem; } + .img-darkmode { + filter: invert(100%); + } .label { - color: #fff; + display: inline-flex; + min-width: 0; + padding: 0rem 0.3125rem 0rem 0rem; letter-spacing: 5%; align-self: center; white-space: nowrap; font: 400 0.875rem/1.25rem Overpass, sans-serif; } - + .label-darkmode { + color: #FFFFFF; + } + .label-lightmode { + color: #000000; + } + + + .fade-enter-from, .fade-leave-to { + opacity: 0; + } + .fade-enter-to, .fade-leave-from { + opacity: 1; + max-width: 0; + } + .fade-enter-active { + transition: all 0.75s; + overflow: clip; + animation: fade-in 0.5s linear forwards; + } + .fade-leave-active { + transition: all 0.75s; + animation: fade-out 0.5s linear forwards; + } + .fade-move { + transition: transform 5s + } + + @keyframes expand { + from { + max-inline-size: 3.25rem; + max-width: 3.25rem; + } + to { + max-inline-size: 9.0625rem; + max-width: 9.0625rem; + } + } + @keyframes contract { + from { + max-inline-size: 9.0625rem; + max-width: 9.0625rem; + } + to { + max-inline-size: 3.25rem; + max-width: 3.25rem; + } + } + + @keyframes fade-in { + from { + max-width: 0; + max-inline-size: 0; + } + to { + max-width: 7.5rem; + width: fit-content; + } + } + @keyframes fade-out { + from { + max-width: 7.5rem; + width: fit-content; + } + to { + max-width: 0; + max-inline-size: 0; + } + } + + \ No newline at end of file