diff --git a/components/configurator/door-visualizer.tsx b/components/configurator/door-visualizer.tsx index 9ee83bf..cd7b141 100644 --- a/components/configurator/door-visualizer.tsx +++ b/components/configurator/door-visualizer.tsx @@ -5,32 +5,31 @@ import { useConfiguratorStore } from "@/lib/store"; export function DoorVisualizer() { const { doorType, gridType, finish, handle } = useConfiguratorStore(); - // Color mapping based on finish + // Frame color mapping based on finish const frameColor = { - zwart: "#1A1A1A", + zwart: "#1f1f1f", brons: "#8B6F47", - grijs: "#4A5568", + grijs: "#525252", }[finish]; - const viewBoxWidth = 400; - const viewBoxHeight = 600; - const frameThickness = 20; - const padding = 40; + // Door width varies by type + const doorWidth = doorType === "paneel" ? "w-[300px]" : "w-[240px]"; - // Door dimensions within viewBox - const doorWidth = viewBoxWidth - padding * 2; - const doorHeight = viewBoxHeight - padding * 2; - const doorX = padding; - const doorY = padding; + // Grid configuration + const gridConfig = { + "3-vlak": "grid-rows-3", + "4-vlak": "grid-rows-4", + geen: "", + }[gridType]; return ( -
+
{/* Background room image with overlay */}
-
+
{/* Live Preview Badge */}
@@ -40,132 +39,68 @@ export function DoorVisualizer() {
- {/* SVG Door */} - - {/* Outer Frame */} - + {/* The Door Frame (CSS-based) */} +
+
+ {/* The Glass Panels with Grid */} + {gridType !== "geen" ? ( +
+ {gridType === "3-vlak" && + [1, 2, 3].map((i) => ( +
+ ))} + {gridType === "4-vlak" && + [1, 2, 3, 4].map((i) => ( +
+ ))} +
+ ) : ( + // No grid - single glass panel +
+ )} - {/* Inner panel (lighter) */} - + {/* Handle Overlays */} + {doorType === "taats" && handle === "u-greep" && ( +
+ )} - {/* Grid Lines based on gridType */} - {gridType === "3-vlak" && ( - <> - - - - )} + {doorType === "scharnier" && handle === "klink" && ( +
+
+
+
+ )} - {gridType === "4-vlak" && ( - <> - - - - - )} - - {/* Handle based on doorType */} - {doorType === "taats" && handle === "u-greep" && ( - - )} - - {doorType === "scharnier" && handle === "klink" && ( - <> - {/* Handle base */} - - {/* Handle knob */} - - - )} - - {doorType === "paneel" && ( - <> - {/* Central vertical line for paneel */} - - - )} - + )} +
+
{/* Configuration Info Card */}