From 0786fbac8b6ea9ea66bfb30761960fdd8c684231 Mon Sep 17 00:00:00 2001 From: anielsen99 Date: Tue, 21 Apr 2026 18:31:04 +0200 Subject: [PATCH] add dropdown for duftstruktur and moodsetting --- .../src/components/ProductDetailPage.css | 75 ++++++++- .../src/components/ProductDetailPage.jsx | 149 +++++++++++------- 2 files changed, 164 insertions(+), 60 deletions(-) diff --git a/parfum-shop/src/components/ProductDetailPage.css b/parfum-shop/src/components/ProductDetailPage.css index adf158e..7205678 100644 --- a/parfum-shop/src/components/ProductDetailPage.css +++ b/parfum-shop/src/components/ProductDetailPage.css @@ -395,6 +395,79 @@ /* --- Mood Box End --- */ +/* --- Accordion / Dropdown Components Start --- */ + +.accordion-group { + display: flex; + flex-direction: column; + gap: 12px; + margin-top: 26px; +} + +.accordion-item { + background: #f5f5f5; + border: 1px solid #d9d9d9; + border-left: 3px solid #d9d9d9; /* Subtiler Rahmen im Normalzustand */ + transition: border-color 0.2s ease, background 0.2s ease; +} + +.accordion-item.is-open { + border-left-color: #ff6a00; /* Farbabgleich: Orange, wenn offen */ + background: #fcfcfc; +} + +.accordion-toggle { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + padding: 18px 20px; + background: transparent; + border: none; + cursor: pointer; + font-size: 12px; + letter-spacing: 0.24em; + font-weight: 500; + color: #1f1f1f; + transition: opacity 0.2s ease; +} + +.accordion-toggle:hover { + opacity: 0.7; +} + +.accordion-icon { + font-size: 20px; + line-height: 1; + color: #ff6a00; + font-weight: 300; +} + +.accordion-content { + padding: 0 20px 22px 20px; +} + +/* Bereinigung der alten Strukturen für die Dropdowns */ +.detail-structure-layout { + margin-top: 6px; /* Angepasst für das Innere des Dropdowns */ +} + +.detail-structure { + background: transparent; /* Hintergrund wird jetzt vom Akkordeon gesteuert */ + border: none; + padding: 0; +} + +.mood-box-content p { + font-size: 16px; + line-height: 1.65; + margin: 0; + color: #1f1f1f; + padding-top: 6px; +} + +/* --- Accordion / Dropdown Components End --- */ + /* --- Right Column Start --- */ .detail-info { @@ -915,7 +988,7 @@ } .discovery-note-text p { - font-size: 11px; + font-size: 12px; line-height: 1.45; color: #d0d0d0; margin: 0; diff --git a/parfum-shop/src/components/ProductDetailPage.jsx b/parfum-shop/src/components/ProductDetailPage.jsx index 6e89918..2af906c 100644 --- a/parfum-shop/src/components/ProductDetailPage.jsx +++ b/parfum-shop/src/components/ProductDetailPage.jsx @@ -26,6 +26,8 @@ function ProductDetailContent({ perfumeSlug }) { const [selectedSize, setSelectedSize] = useState("sample"); const [showReviewDetails, setShowReviewDetails] = useState(false); const [commentPage, setCommentPage] = useState(0); + const [isStructureOpen, setIsStructureOpen] = useState(false); + const [isMoodOpen, setIsMoodOpen] = useState(false); const selectedProductId = `${perfume.slug}-${selectedSize === "sample" ? "sample" : "full"}`; const selectedProductLabel = selectedSize === "sample" ? "Sample" : "Full Size"; const selectedPriceCents = priceToCents(perfume.prices[selectedSize]); @@ -146,73 +148,102 @@ function ProductDetailContent({ perfumeSlug }) { -
-
-

DUFTSTRUKTUR

+ {/* --- Accordion Group Start --- */} +
+ + {/* Dropdown: Duftstruktur */} +
+ + + {isStructureOpen && ( +
+
+
+
+ PHASE 1: TOP NOTES (0–1 H) +
+ {perfume.phases.top.map((note) => ( + {note} + ))} +
+
-
- PHASE 1: TOP NOTES (0–1 H) -
- {perfume.phases.top.map((note) => ( - - {note} - - ))} -
-
+
+ PHASE 2: HEART NOTES (1–4 H) +
+ {perfume.phases.heart.map((note) => ( + {note} + ))} +
+
-
- PHASE 2: HEART NOTES (1–4 H) -
- {perfume.phases.heart.map((note) => ( - - {note} - - ))} -
-
+
+ PHASE 3: BASE NOTES (4 H+) +
+ {perfume.phases.base.map((note) => ( + {note} + ))} +
+
+
-
- PHASE 3: BASE NOTES (4 H+) -
- {perfume.phases.base.map((note) => ( - - {note} - - ))} + +
-
+ )}
- -
- -
- MOODSETTING -

{perfume.mood}

+ )} +
+
+ {/* --- Accordion Group End --- */}