"use client"; import * as React from "react"; import { FormState } from "../types"; import { DESIGN_VIBES } from "../constants"; import { motion, AnimatePresence } from "framer-motion"; import { Plus, X, Palette, Pipette, RefreshCw } from "lucide-react"; import { Reveal } from "../../Reveal"; import { Input } from "../components/Input"; import { RepeatableList } from "../components/RepeatableList"; interface DesignStepProps { state: FormState; updateState: (_updates: Partial) => void; } export function DesignStep({ state, updateState }: DesignStepProps) { const addColor = () => { if (state.colorScheme.length < 5) { updateState({ colorScheme: [...state.colorScheme, "#000000"] }); } }; const removeColor = (index: number) => { if (state.colorScheme.length > 1) { const newScheme = [...state.colorScheme]; newScheme.splice(index, 1); updateState({ colorScheme: newScheme }); } }; const updateColor = (index: number, value: string) => { const newScheme = [...state.colorScheme]; newScheme[index] = value; updateState({ colorScheme: newScheme }); }; const toggleDontKnow = (id: string) => { const current = state.dontKnows || []; if (current.includes(id)) { updateState({ dontKnows: current.filter((i) => i !== id) }); } else { updateState({ dontKnows: [...current, id] }); } }; const generateHarmonicPalette = () => { const hue = Math.floor(Math.random() * 360); const saturation = 40 + Math.floor(Math.random() * 40); const lightness = 40 + Math.floor(Math.random() * 40); const hslToHex = (h: number, s: number, l: number) => { l /= 100; const a = (s * Math.min(l, 1 - l)) / 100; const f = (n: number) => { const k = (n + h / 30) % 12; const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1); return Math.round(255 * color) .toString(16) .padStart(2, "0"); }; return `#${f(0)}${f(8)}${f(4)}`; }; const count = state.colorScheme.length; const palette = []; for (let i = 0; i < count; i++) { const h = (hue + i * (360 / count)) % 360; const l = i === 0 ? 95 : i === count - 1 ? 20 : lightness; palette.push(hslToHex(h, saturation, l)); } updateState({ colorScheme: palette }); }; return (
{/* Design Vibe */}

Design-Richtung

Welche Ästhetik passt zu Ihrer Marke?

toggleDontKnow("design_vibe")} className={`px-6 py-3 rounded-full text-sm font-bold transition-all whitespace-nowrap shrink-0 ${ state.dontKnows?.includes("design_vibe") ? "bg-slate-900 text-white" : "bg-slate-100 text-slate-500 hover:bg-slate-200" }`} > Ich weiß es nicht
{DESIGN_VIBES.map((vibe, index) => ( updateState({ designVibe: vibe.id })} className={`p-8 rounded-[2.5rem] border-2 text-left transition-all duration-500 focus:outline-none overflow-hidden relative group ${ state.designVibe === vibe.id ? "border-slate-900 bg-slate-900 text-white" : "border-slate-100 bg-white hover:border-slate-300" }`} >
{vibe.illustration}

{vibe.label}

{vibe.desc}

{state.designVibe === vibe.id && ( )}
))}
{/* Color Scheme */}

Farbschema

Definieren Sie Ihre Markenfarben oder lassen Sie sich inspirieren.

Zufall toggleDontKnow("color_scheme")} className={`px-6 py-3 rounded-full text-sm font-bold transition-all whitespace-nowrap shrink-0 ${ state.dontKnows?.includes("color_scheme") ? "bg-slate-900 text-white" : "bg-slate-100 text-slate-500 hover:bg-slate-200" }`} > Ich weiß es nicht
{/* Custom Picker */}
Individuelle Farben
{state.colorScheme.map((color, i) => (
updateColor(i, e.target.value)} className="absolute inset-[-100%] w-[300%] h-[300%] cursor-pointer outline-none border-none appearance-none bg-transparent" />
{color}
{state.colorScheme.length > 1 && ( removeColor(i)} className="absolute -top-3 -right-3 w-8 h-8 bg-white text-red-500 rounded-full flex items-center justify-center border border-slate-100 opacity-0 group-hover:opacity-100 transition-all duration-300 z-10" > )} ))} {state.colorScheme.length < 5 && ( Add )}

Klicken Sie auf eine Farbe, um sie anzupassen. Sie können bis zu 5 Farben definieren.

{/* References */}

Referenz-Websites

Gibt es Websites, die Ihnen besonders gut gefallen?

updateState({ references: [...(state.references || []), v] }) } onRemove={(i) => updateState({ references: (state.references || []).filter( (_, idx) => idx !== i, ), }) } placeholder="https://beispiel.de" />
{/* Wishes */} updateState({ designWishes: e.target.value })} />
); }