From 66dd08cf65a32676118edb96d2e3ad99d8aa28fe Mon Sep 17 00:00:00 2001 From: alsaze Date: Wed, 8 Oct 2025 14:36:09 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=BE=D0=B7=D0=B4=D0=B0=D1=8E=20=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D0=B5=D0=B3=D1=83=20=D1=82=D0=BE=D0=B2=D0=B0=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/scss/main.scss | 25 ++++++++++++++++ components/ProductDescription.vue | 11 ++++--- components/ProductImages.vue | 28 ++++++++++++++++-- layouts/default.vue | 6 ++-- package.json | 1 + pages/cart.vue | 15 ++++++---- pages/index.vue | 29 ++++++++++++++----- pages/product/[id].vue | 48 ++++++++++++++++++++++++++++--- yarn.lock | 5 ++++ 9 files changed, 139 insertions(+), 29 deletions(-) diff --git a/assets/scss/main.scss b/assets/scss/main.scss index db32c6b..00771a4 100644 --- a/assets/scss/main.scss +++ b/assets/scss/main.scss @@ -24,6 +24,7 @@ h3 { @include h3('h3'); } +//скроллбар ::-webkit-scrollbar { width: 8px; } @@ -52,4 +53,28 @@ h3 { body { -ms-overflow-style: -ms-autohiding-scrollbar; +} + +//swiper +.swiper { + width: 100%; + height: 100%; +} + +.swiper-slide { + text-align: center; + font-size: 18px; + background: #444; + + /* Center slide text vertically */ + display: flex; + justify-content: center; + align-items: center; +} + +.swiper-slide img { + display: block; + width: 100%; + height: 100%; + object-fit: cover; } \ No newline at end of file diff --git a/components/ProductDescription.vue b/components/ProductDescription.vue index 3ef1df4..a5c1218 100644 --- a/components/ProductDescription.vue +++ b/components/ProductDescription.vue @@ -95,6 +95,11 @@ function addToCartBtn() { .product-description { width: 100%; max-width: 335px; + padding-top: 30px; + padding-inline: 30px; + display: flex; + flex-direction: column; + gap: 10px; @media (min-width: 768px) { position: sticky; @@ -104,12 +109,6 @@ function addToCartBtn() { max-height: calc(100vh - 80px); } - padding-top: 30px; - padding-inline: 30px; - display: flex; - flex-direction: column; - gap: 10px; - &__sizes { display: grid; grid-template-columns: repeat(4, 1fr); diff --git a/components/ProductImages.vue b/components/ProductImages.vue index b80a833..d01e53c 100644 --- a/components/ProductImages.vue +++ b/components/ProductImages.vue @@ -1,5 +1,5 @@ @@ -19,7 +41,7 @@ const { currentVariantImages } = useCurrentProduct() .product-images { position: relative; width: 100%; - display: flex; - flex-direction: column; + display: grid; + grid-template-columns: repeat(2, 1fr); } diff --git a/layouts/default.vue b/layouts/default.vue index 1159861..8c08e2b 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -32,9 +32,9 @@ - + + + diff --git a/package.json b/package.json index 5902cbb..16450f4 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dayjs": "^1.11.13", "decimal.js": "^10.5.0", "nuxt": "^3.17.6", + "swiper": "^12.0.2", "typescript": "^5.6.3", "vue": "^3.5.17", "vue-router": "^4.5.1" diff --git a/pages/cart.vue b/pages/cart.vue index abbc09f..4c22df5 100644 --- a/pages/cart.vue +++ b/pages/cart.vue @@ -9,12 +9,15 @@ -
-
{{ `Товары: ${cart?.line_items?.length}` }}
+
+
+
{{ `Товары: ${cart?.line_items?.length}` }}
+
{{ `Сумма: ${cart?.line_items?.length}` }}
- - Перейти к оформлению - + + Перейти к оформлению + +
@@ -22,6 +25,7 @@ diff --git a/pages/product/[id].vue b/pages/product/[id].vue index d968845..30ffaba 100644 --- a/pages/product/[id].vue +++ b/pages/product/[id].vue @@ -1,14 +1,54 @@ -