From 8c6febea0961683c980bab962b9d2f4f5c9909c0 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 Feb 2026 16:20:59 +0000 Subject: [PATCH] Rewrite visualizer with photorealistic CSS rendering Replaced SVG lines with CSS borders and glass effects: - Frame: Thick CSS borders (12px) with shadow-2xl and ring-1 ring-white/10 - Glass: backdrop-blur + backdrop-brightness + sky-100/10 tint - Grid: CSS Grid with gaps (gaps show frameColor as steel profiles) - Handles: Absolute positioned divs with realistic shadows - Background: Room image with white/60 overlay for contrast Frame colors: #1f1f1f (charcoal black), #8B6F47 (bronze), #525252 (grey) Result: Looks like a photo of a door, not a drawing Co-Authored-By: Claude Sonnet 4.5 --- components/configurator/door-visualizer.tsx | 209 +++++++------------- 1 file changed, 72 insertions(+), 137 deletions(-) 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 */}