From 9a4f184d9fbff54ac21317269047d2ffb8a1ddce Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Sat, 27 Apr 2024 13:33:48 +0300 Subject: [PATCH] 3d model --- front/components.d.ts | 7 +++++++ front/src/App.vue | 28 +++++++++++++++++++++------- front/src/assets/main.scss | 13 +++++++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/front/components.d.ts b/front/components.d.ts index 21d5085..621d833 100644 --- a/front/components.d.ts +++ b/front/components.d.ts @@ -7,6 +7,13 @@ export {} declare module 'vue' { export interface GlobalComponents { + IMdi3dRotation: typeof import('~icons/mdi/3d-rotation')['default'] + IMdiCard: typeof import('~icons/mdi/card')['default'] + IMdiClarify: typeof import('~icons/mdi/clarify')['default'] + IMdiFile: typeof import('~icons/mdi/file')['default'] + IMdiIcon: typeof import('~icons/mdi/icon')['default'] + IMdiPrinter: typeof import('~icons/mdi/printer')['default'] + IMdiVideo3d: typeof import('~icons/mdi/video3d')['default'] RandomIcon: typeof import('./src/components/RandomIcon.vue')['default'] } } diff --git a/front/src/App.vue b/front/src/App.vue index 038d128..256c751 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -11,21 +11,31 @@ const IMAGE_URL = import.meta.env.VITE_IMAGE_URL ?? '' type StateType = { active_product?: ProductInfo + show_canvas: boolean } const products = useProductStore() const state: StateType = reactive({ - active_product: undefined + active_product: undefined, + show_canvas: false }) const setActive = (id: number) => { - state.active_product = products.list.find(el => el.id == id) + state.active_product = products.list.find(el => el.id == id), + state.show_canvas = false +} + +const toggleShowCanvas = () => { + state.show_canvas = !state.show_canvas } const target = ref(null) useSwipe(target, { onSwipeEnd(_: TouchEvent, direction: UseSwipeDirection) { + if (state.show_canvas) { + return + } const index = products.list.findIndex(el => el.id == state.active_product?.id) if (direction === 'right') { if (index == products.list.length - 1) { @@ -44,7 +54,6 @@ useSwipe(target, { }) onMounted(async () => { - useSwipe products.getData() }) @@ -63,14 +72,19 @@ onMounted(async () => {
Проекты Кустарщины
- -
+
-
+
{{ state.active_product.description }}
+ + + + +
diff --git a/front/src/assets/main.scss b/front/src/assets/main.scss index bd0bcec..b2839b5 100644 --- a/front/src/assets/main.scss +++ b/front/src/assets/main.scss @@ -85,6 +85,7 @@ body { .product { gap: 1rem; + position: relative; &-image { flex-basis: 50%; @@ -96,6 +97,18 @@ body { line-height: 1.4; } + &-model { + max-height: 80%; + &-icon { + position: absolute; + font-size: 4rem; + right: 0; + top: 0; + color: $accentColor; + z-index: 2; + } + } + } .logo {