From 733c1e54193215dbd3ba99fc7f3207faffe3d7ff Mon Sep 17 00:00:00 2001 From: kudinDmitriyUp Date: Tue, 21 Apr 2026 15:35:15 +0000 Subject: [PATCH] Bob AI: Implement a 3D flip effect on hover for each menu item card --- .../sections/product/ProductVariantCards.tsx | 61 +++++++++++++------ src/index.css | 11 +++- 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/src/components/sections/product/ProductVariantCards.tsx b/src/components/sections/product/ProductVariantCards.tsx index 0217ce9..cca22fe 100644 --- a/src/components/sections/product/ProductVariantCards.tsx +++ b/src/components/sections/product/ProductVariantCards.tsx @@ -13,11 +13,13 @@ type ProductVariantCardsProps = { primaryButton?: { text: string; href: string }; secondaryButton?: { text: string; href: string }; products?: { + id?: string; name: string; variant: string; price: string; imageSrc: string; onClick?: () => void; + description?: string; }[]; }; @@ -33,11 +35,13 @@ const ProductVariantCards = ({ const isFromApi = fetchedProducts.length > 0; const products = isFromApi ? fetchedProducts.map((p) => ({ + id: p.id, name: p.name, variant: p.variant || "", price: p.price, imageSrc: p.imageSrc, onClick: p.onProductClick, + description: p.description, })) : productsProp; @@ -91,32 +95,49 @@ const ProductVariantCards = ({ > {products.map((product) => ( - + ))} diff --git a/src/index.css b/src/index.css index 854cc7c..e028740 100644 --- a/src/index.css +++ b/src/index.css @@ -3,6 +3,15 @@ @import "./styles/masks.css"; @import "./styles/animations.css"; +@layer utilities { + .transform-style-preserve-3d { + transform-style: preserve-3d; + } + .backface-hidden { + backface-visibility: hidden; + } +} + :root { /* @colorThemes/lightTheme/grayBlueAccent */ --background: #f6f0e9; @@ -174,4 +183,4 @@ h6 { background: linear-gradient(to bottom right, color-mix(in srgb, var(--color-secondary-cta) 80%, transparent), var(--color-secondary-cta)); box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); border: 1px solid var(--color-secondary-cta); -} +} \ No newline at end of file -- 2.49.1