feat: update design for product and product cards

This commit is contained in:
2025-12-14 18:35:07 +03:00
parent b4ff6c9ce1
commit 8a777cd4d2
12 changed files with 30 additions and 27 deletions

View File

@@ -70,12 +70,12 @@ export const blocks = [
category_id: null, category_id: null,
all_text: null, all_text: null,
carousel: { carousel: {
slides_per_view: null, slides_per_view: 2.5,
space_between: null, space_between: 10,
autoplay: false, autoplay: false,
freemode: { freemode: {
enabled: false, enabled: false,
} },
}, },
}, },
}, },

View File

@@ -19,7 +19,6 @@
<PrivacyPolicy v-if="! settings.is_privacy_consented"/> <PrivacyPolicy v-if="! settings.is_privacy_consented"/>
<CartButton v-if="settings.store_enabled"/>
<Dock v-if="isAppDockShown"/> <Dock v-if="isAppDockShown"/>
<div <div

View File

@@ -1,13 +1,13 @@
<template> <template>
<section class="px-4"> <section class="px-4">
<header class="flex justify-between items-center mb-4"> <header class="flex justify-between items-end mb-4">
<div> <div>
<div v-if="title" class="font-bold uppercase">{{ title }}</div> <div v-if="title" class="font-bold uppercase">{{ title }}</div>
<div v-if="description" class="text-sm">{{ description }}</div> <div v-if="description" class="text-sm text-base-content/50">{{ description }}</div>
</div> </div>
<div v-if="moreLink"> <div v-if="moreLink">
<RouterLink :to="moreLink" class="btn btn-ghost btn-xs" @click="haptic.selectionChanged"> <RouterLink :to="moreLink" class="btn btn-soft btn-xs" @click="haptic.selectionChanged">
{{ moreText || 'Смотреть всё' }} {{ moreText || 'Смотреть всё' }}
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4"> <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-4">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" /> <path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />

View File

@@ -17,13 +17,12 @@
<SwiperSlide <SwiperSlide
v-for="product in block.data.products.data" v-for="product in block.data.products.data"
:key="product.id" :key="product.id"
class="radius-box bg-base-100 shadow-sm p-2"
> >
<div class="will-change-transform active:scale-97 transition-transform"> <div>
<RouterLink <RouterLink
:to="{name: 'product.show', params: {id: product.id}}" :to="{name: 'product.show', params: {id: product.id}}"
@click="slideClick(product)" @click="slideClick(product)"
> >
<div class="text-center"> <div class="text-center">
<img :src="product.images[0].url" :alt="product.name" loading="lazy" class="product-image"/> <img :src="product.images[0].url" :alt="product.name" loading="lazy" class="product-image"/>

View File

@@ -56,9 +56,3 @@ const onLoad = (url) => {
if (url) loaded.value[url] = true; if (url) loaded.value[url] = true;
}; };
</script> </script>
<style scoped>
.radius-box {
border-radius: var(--radius-box);
}
</style>

View File

@@ -1,9 +1,9 @@
<template> <template>
<div v-if="special"> <div v-if="special">
<span class="old-price text-neutral-content/70 line-through mr-1">{{ price }}</span> <span class="old-price text-base-content/50 line-through mr-1">{{ price }}</span>
<span class="curr-price font-medium">{{ special }}</span> <span class="curr-price font-bold">{{ special }}</span>
</div> </div>
<div v-else class="font-medium">{{ price }}</div> <div v-else class="font-bold">{{ price }}</div>
</template> </template>
<script setup> <script setup>

View File

@@ -4,17 +4,14 @@
<h2 v-if="categoryName" class="text-lg font-bold mb-5">{{ categoryName }}</h2> <h2 v-if="categoryName" class="text-lg font-bold mb-5">{{ categoryName }}</h2>
<template v-if="products.length > 0"> <template v-if="products.length > 0">
<div <div class="products-grid grid grid-cols-2 gap-x-3 gap-y-3">
class="products-grid grid grid-cols-2 gap-x-2 gap-y-2"
>
<RouterLink <RouterLink
v-for="(product, index) in products" v-for="(product, index) in products"
:key="product.id" :key="product.id"
class="product-grid-card group will-change-transform active:scale-97 transition-transform" class="radius-box bg-base-100 shadow-sm p-2"
:to="`/product/${product.id}`" :to="`/product/${product.id}`"
@click="productClick(product, index)" @click="productClick(product, index)"
> >
<ProductImageSwiper :images="product.images"/> <ProductImageSwiper :images="product.images"/>
<PriceTitle :product="product"/> <PriceTitle :product="product"/>
</RouterLink> </RouterLink>
@@ -152,3 +149,9 @@ function showFilters() {
router.push({name: 'filters'}); router.push({name: 'filters'});
} }
</script> </script>
<style scoped>
.product-grid-card {
}
</style>

View File

@@ -65,3 +65,11 @@ html, body, #app {
/*+ 1rem*/ /*+ 1rem*/
); );
} }
html {
background-color: var(--color-base-200);
}
.radius-box {
border-radius: var(--radius-xl);
}

View File

@@ -16,7 +16,7 @@
<SingleProductImageSwiper v-else :images="images"/> <SingleProductImageSwiper v-else :images="images"/>
<div class="mx-auto max-w-2xl px-4 pt-6 pb-32 sm:px-6"> <div class="px-4 pt-6 pb-6">
<!-- Header section --> <!-- Header section -->
<div class="mb-6"> <div class="mb-6">
<div v-if="product.manufacturer" class="mb-2"> <div v-if="product.manufacturer" class="mb-2">
@@ -41,7 +41,7 @@
</div> </div>
<!-- Price section --> <!-- Price section -->
<div class="card bg-base-200/50 rounded-2xl p-5 mb-6 shadow-sm"> <div class="card bg-base-100 rounded-xl p-5 mb-6 shadow-sm">
<div class="flex items-baseline gap-3 flex-wrap"> <div class="flex items-baseline gap-3 flex-wrap">
<div v-if="product.special" class="flex items-baseline gap-3 flex-wrap"> <div v-if="product.special" class="flex items-baseline gap-3 flex-wrap">
<span class="text-3xl sm:text-4xl font-bold text-primary">{{ product.special }}</span> <span class="text-3xl sm:text-4xl font-bold text-primary">{{ product.special }}</span>
@@ -76,7 +76,7 @@
<!-- Description and details --> <!-- Description and details -->
<div class="space-y-6"> <div class="space-y-6">
<!-- Description --> <!-- Description -->
<div v-if="product.description" class="card bg-base-100 rounded-2xl p-5 shadow-sm"> <div v-if="product.description" class="card bg-base-100 rounded-xl p-5 shadow-sm">
<h3 class="text-lg font-bold mb-4 flex items-center gap-2"> <h3 class="text-lg font-bold mb-4 flex items-center gap-2">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="w-5 h-5"> stroke="currentColor" class="w-5 h-5">