From 070a4f65a977c8a10ca5befd1af3203f30b8b769 Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Mon, 27 Apr 2026 11:47:04 +0000 Subject: [PATCH] Bob AI: Implement a 3D flip animation for each product card in the p --- .../sections/product/ProductQuantityCards.tsx | 117 ++++++++++++------ src/index.css | 15 +++ 2 files changed, 97 insertions(+), 35 deletions(-) diff --git a/src/components/sections/product/ProductQuantityCards.tsx b/src/components/sections/product/ProductQuantityCards.tsx index 6dd48e7..647594c 100644 --- a/src/components/sections/product/ProductQuantityCards.tsx +++ b/src/components/sections/product/ProductQuantityCards.tsx @@ -17,6 +17,7 @@ type ProductQuantityCardsProps = { name: string; price: string; imageSrc: string; + description?: string; onAddToCart?: (quantity: number) => void; }[]; }; @@ -37,6 +38,7 @@ const ProductQuantityCards = ({ name: p.name, price: p.price, imageSrc: p.imageSrc, + description: p.description, onAddToCart: undefined as ((quantity: number) => void) | undefined, })) : productsProp; @@ -90,7 +92,7 @@ const ProductQuantityCards = ({ {(primaryButton || secondaryButton) && (
{primaryButton &&
)} @@ -100,42 +102,87 @@ const ProductQuantityCards = ({ {products.map((product) => (
-
- -
- -
-

{product.name}

- -
-
- - - {getQuantity(product.name)} - - +
+ {/* Front Face */} +
+
+
- +
+

{product.name}

+ +
+
+ + + {getQuantity(product.name)} + + +
+ + +
+
+
+ + {/* Back Face */} +
+

{product.name}

+ +
+

+ {product.description || "Detailed product information will be displayed here. This includes specifications, materials, and care instructions to help you make an informed decision."} +

+
+ +
+
+ + + {getQuantity(product.name)} + + +
+ + +
@@ -147,4 +194,4 @@ const ProductQuantityCards = ({ ); }; -export default ProductQuantityCards; +export default ProductQuantityCards; \ No newline at end of file diff --git a/src/index.css b/src/index.css index 41b62ce..1723b8f 100644 --- a/src/index.css +++ b/src/index.css @@ -198,3 +198,18 @@ h6 { bg, a same-color border is invisible and the button disappears. */ border: 1px solid color-mix(in srgb, var(--color-foreground) 18%, transparent); } + +@layer utilities { + .perspective-1000 { + perspective: 1000px; + } + .transform-style-preserve-3d { + transform-style: preserve-3d; + } + .backface-hidden { + backface-visibility: hidden; + } + .rotate-y-180 { + transform: rotateY(180deg); + } +} \ No newline at end of file -- 2.49.1