From 2298596f1206f98f6e149ec31720e310c479a343 Mon Sep 17 00:00:00 2001 From: aarizona Date: Wed, 28 Aug 2024 21:54:11 +0300 Subject: [PATCH] part sidebar --- front/components.d.ts | 2 + front/src/assets/sidebar.scss | 60 ++++++++++++-------------- front/src/components/Promo/sidebar.vue | 30 +++++++++++-- 3 files changed, 56 insertions(+), 36 deletions(-) diff --git a/front/components.d.ts b/front/components.d.ts index a924cd3..c9adca6 100644 --- a/front/components.d.ts +++ b/front/components.d.ts @@ -26,8 +26,10 @@ declare module 'vue' { IMdiHexagonOutline: typeof import('~icons/mdi/hexagon-outline')['default'] IMdiHome: typeof import('~icons/mdi/home')['default'] IMdiHomeOutline: typeof import('~icons/mdi/home-outline')['default'] + IMdiMinusCircle: typeof import('~icons/mdi/minus-circle')['default'] IMdiMonitorScreenshot: typeof import('~icons/mdi/monitor-screenshot')['default'] IMdiPagePreviousOutline: typeof import('~icons/mdi/page-previous-outline')['default'] + IMdiPlusCircle: typeof import('~icons/mdi/plus-circle')['default'] IMdiShop: typeof import('~icons/mdi/shop')['default'] IMdiVideo3d: typeof import('~icons/mdi/video3d')['default'] Item: typeof import('./src/components/Floorplan/item.vue')['default'] diff --git a/front/src/assets/sidebar.scss b/front/src/assets/sidebar.scss index d29e373..b61baac 100644 --- a/front/src/assets/sidebar.scss +++ b/front/src/assets/sidebar.scss @@ -43,7 +43,6 @@ $boxShadow: 0px 0px 8px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 1.5rem; - box-shadow: $boxShadow; color: #484848; &.open { @@ -62,34 +61,48 @@ $boxShadow: 0px 0px 8px rgba(0, 0, 0, .25); background-color: $bg; border-top-left-radius: 0.5rem; border-bottom-left-radius: 0.5rem; - - // padding: 1.5rem; + box-shadow: $boxShadow; color: $textColor; } - &-list {} + &-accordion { + padding: 1.125rem 1rem; + border-bottom: 2px solid var(--primary-color); + max-height: 4rem; + transition: max-height 300ms linear; - &-list-item { - font-size: 1.5rem; - color: $textColor2; + &:last-child { + border-bottom: none; + } - display: flex; + h3 { + font-weight: 700; + font-size: 1.25rem; + } - input { - margin-right: 2rem; + &-title { + display: flex; + align-items: center; + justify-content: flex-start; + gap: 1rem; + color: var(--primary-color); + cursor: pointer; - &.checked+label { - color: $primary; + svg { + flex-shrink: 0; } } + + &.open { + max-height: 50vh; + } } h2 { font-size: 1.5rem; text-align: center; - margin-bottom: 1rem; - padding: 0.5rem 0; + padding: 0.5rem 1rem; min-height: 3rem; display: flex; flex-wrap: wrap; @@ -102,23 +115,4 @@ $boxShadow: 0px 0px 8px rgba(0, 0, 0, .25); border-bottom: 2px solid var(--primary-color); } - - p { - font-size: 1rem; - margin-bottom: 1rem; - } - - a { - background-color: darken($textColor2, 30%); - opacity: 0.97; - border-radius: 1rem; - height: 3.75rem; - color: $primary; - - display: flex; - align-items: center; - justify-content: center; - text-decoration: none; - font-size: 2rem; - } } \ No newline at end of file diff --git a/front/src/components/Promo/sidebar.vue b/front/src/components/Promo/sidebar.vue index f45d091..a141b65 100644 --- a/front/src/components/Promo/sidebar.vue +++ b/front/src/components/Promo/sidebar.vue @@ -18,11 +18,21 @@ const openedChange = () => { watch(() => sidebar, () => { if (sidebar.is_open == false) { - opened_desc.value = null + opened_desc.value = null; + open_accordions.value = [] } else { opened_desc.value = sidebar.id_clickable } }, { deep: true }) + +const open_accordions = ref([] as string[]) +const toggleAccordion = (name: string) => { + if (open_accordions.value.includes(name)) { + open_accordions.value.splice(open_accordions.value.indexOf(name), 1) + } else { + open_accordions.value.push(name) + } +}