/* global React, ReactDOM */ const { useState } = React; const SHAPES = [ { id:'stele', name:'Stele', meta:'Hochkant · klassisch' }, { id:'kissen', name:'Kissen', meta:'Liegend · ruhig' }, { id:'findling', name:'Findling', meta:'Natur · gebrochen' }, { id:'herz', name:'Herz', meta:'Symbolisch · weich' }, { id:'buch', name:'Buch', meta:'Aufgeschlagen · still' }, ]; const STONES = [ { id:'bahama', name:'Bahama Blue', meta:'Granit · poliert', color:'#3b4150', tone:'#222731'}, { id:'aurora', name:'Aurora', meta:'Granit · multicolor', color:'#8c5a3f', tone:'#5b3a28'}, { id:'carrara', name:'Carrara', meta:'Marmor · weiß', color:'#e8e4d8', tone:'#cfc8b7'}, { id:'schwarz', name:'Schwarz Schweden', meta:'Granit · matt', color:'#1d1d1d', tone:'#0e0e0e'}, { id:'serp', name:'Serpentinit', meta:'Edelgestein · grün', color:'#2c3a30', tone:'#16201a'}, ]; function StonePreview({shape, stone, name, dates}){ const c = stone.color, t = stone.tone; const props = {fill:`url(#stone-grad)`, stroke:'rgba(0,0,0,.18)', strokeWidth:'1'}; let body; if(shape.id==='stele') body = ; else if(shape.id==='kissen') body = ; else if(shape.id==='findling') body = ; else if(shape.id==='herz') body = ; else if(shape.id==='buch') body = (<> ); const inscriptionY = shape.id==='kissen' ? 195 : shape.id==='findling' ? 160 : shape.id==='herz' ? 180 : 150; return ( {body} {name||'\u00A0'} {dates||'\u00A0'} ); } function Configurator(){ const [shapeId,setShape] = useState('stele'); const [stoneId,setStone] = useState('bahama'); const [name,setName] = useState(''); const [dates,setDates] = useState(''); const shape = SHAPES.find(s=>s.id===shapeId); const stone = STONES.find(s=>s.id===stoneId); return (<>
Vorschau · unverbindlich
№ Entwurf {Math.abs((shapeId+stoneId).split('').reduce((a,c)=>a+c.charCodeAt(0),0)*7)%900+100}
{shape.name} · {stone.name}
~ 6 Wochen Fertigung
Schritt 01 — Form

Welche Form passt?

{SHAPES.map(s=>( ))}
Schritt 02 — Stein

Welcher Naturstein?

{STONES.map(s=>( ))}
Schritt 03 — Inschrift

Name & Daten

setName(e.target.value)}/> setDates(e.target.value)} style={{marginTop:14}}/>
Entwurf an Carmen Mohr senden
); } ReactDOM.createRoot(document.getElementById('configurator')).render();