-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatten_generator.html
More file actions
441 lines (420 loc) · 19.1 KB
/
Copy pathplatten_generator.html
File metadata and controls
441 lines (420 loc) · 19.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
<!doctype html>
<html lang="de">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Platten-Generator — Modulschmiede</title>
<style>
:root{
--bg:#12151a; --panel:#1a1e26; --panel2:#212632; --line:#2c333f;
--txt:#e6e9ef; --mut:#9aa5b4; --acc:#e0862f; --acc2:#3a78c2;
--ok:#4a9d5b;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--txt);
font:14px/1.5 system-ui,Segoe UI,Roboto,sans-serif}
header{padding:14px 20px;border-bottom:1px solid var(--line);
display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}
header h1{font-size:17px;margin:0;font-weight:600}
header .sub{color:var(--mut);font-size:12.5px}
.wrap{display:grid;grid-template-columns:340px 1fr;gap:0;min-height:calc(100vh - 52px)}
.controls{background:var(--panel);border-right:1px solid var(--line);
padding:14px 16px;overflow-y:auto;max-height:calc(100vh - 52px)}
.view{padding:16px 20px;overflow-y:auto;max-height:calc(100vh - 52px)}
@media(max-width:820px){
.wrap{grid-template-columns:1fr}
.controls,.view{max-height:none;overflow-y:visible;border-right:none}
.controls{border-bottom:1px solid var(--line)}
}
fieldset{border:1px solid var(--line);border-radius:9px;margin:0 0 14px;padding:10px 12px 12px}
legend{color:var(--acc);font-weight:600;font-size:12.5px;letter-spacing:.03em;
text-transform:uppercase;padding:0 6px}
.row{display:grid;grid-template-columns:1fr 84px;align-items:center;gap:8px;margin:7px 0}
.row label{color:var(--mut);font-size:13px}
.row input[type=range]{grid-column:1/3;width:100%;accent-color:var(--acc);margin:2px 0 0}
.row .num{width:100%;background:var(--panel2);border:1px solid var(--line);
color:var(--txt);border-radius:6px;padding:4px 6px;font-size:13px;text-align:right;min-height:36px}
.row.full{grid-template-columns:1fr}
.toggle{display:flex;align-items:center;justify-content:space-between;margin:4px 0 8px;
min-height:40px;cursor:pointer;user-select:none}
.toggle span{color:var(--mut)}
select,.seg{width:100%}
select{background:var(--panel2);border:1px solid var(--line);color:var(--txt);
border-radius:6px;padding:6px;font-size:13px}
.seg{display:flex;gap:4px}
.seg button{flex:1;background:var(--panel2);border:1px solid var(--line);color:var(--mut);
padding:6px 4px;border-radius:6px;cursor:pointer;font-size:13px;min-height:40px}
.seg button.on{background:var(--acc);border-color:var(--acc);color:#161616;font-weight:600}
input[type=checkbox]{width:44px;height:24px;appearance:none;background:var(--panel2);
border:1px solid var(--line);border-radius:24px;position:relative;cursor:pointer;flex:none}
input[type=checkbox]::after{content:"";position:absolute;top:1px;left:1px;width:20px;height:20px;
border-radius:50%;background:var(--mut);transition:.15s}
input[type=checkbox]:checked{background:rgba(224,134,47,.3);border-color:var(--acc)}
input[type=checkbox]:checked::after{left:21px;background:var(--acc)}
button:focus-visible,input:focus-visible,select:focus-visible{
outline:2px solid var(--acc2);outline-offset:2px}
.seg button:hover,.btn.sec:hover{border-color:var(--acc2)}
.previews{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
@media(max-width:1100px){.previews{grid-template-columns:1fr}}
.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:12px}
.card h3{margin:0 0 8px;font-size:12.5px;color:var(--mut);font-weight:600;
text-transform:uppercase;letter-spacing:.03em}
.card > svg{width:100%;height:auto;display:block;background:#0d1014;border-radius:6px}
.hint{background:var(--panel2);border-left:3px solid var(--acc2);border-radius:0 6px 6px 0;
padding:9px 12px;margin:12px 0;font-size:13px;color:#cdd6e2}
.hint b{color:var(--txt)}
.codebar{display:flex;gap:8px;align-items:center;margin:4px 0 8px;flex-wrap:wrap}
.btn{background:var(--acc);color:#161616;border:none;border-radius:7px;padding:8px 14px;
font-weight:600;cursor:pointer;font-size:13px;min-height:40px;
display:inline-flex;align-items:center;gap:7px}
.btn svg{width:15px;height:15px;flex:none}
.btn.sec{background:var(--panel2);color:var(--txt);border:1px solid var(--line)}
.btn:active{transform:translateY(1px)}
pre{background:#0d1014;border:1px solid var(--line);border-radius:8px;padding:12px;
overflow:auto;font:12px/1.5 ui-monospace,Consolas,monospace;color:#cdd6e2;max-height:340px;margin:0}
.meas{color:var(--mut);font-size:12px;margin-top:6px}
.meas b{color:var(--acc)}
code.k{color:var(--acc)}
</style>
</head>
<body>
<header>
<h1>Platten-Generator</h1>
<span class="sub">Platte + Gleitschienen-Aufnahme · parametrisch → OpenSCAD</span>
</header>
<div class="wrap">
<!-- ============ CONTROLS ============ -->
<div class="controls" id="controls"></div>
<!-- ============ VIEW ============ -->
<div class="view">
<div class="previews">
<div class="card">
<h3>Vorderansicht (1:1 Form)</h3>
<svg id="front" viewBox="0 0 240 400" preserveAspectRatio="xMidYMid meet"></svg>
<div class="meas" id="measFront"></div>
</div>
<div class="card">
<h3>Querschnitt Fuss <span style="color:#6b7683">(Dicke überzeichnet)</span></h3>
<svg id="sect" viewBox="0 0 240 400" preserveAspectRatio="xMidYMid meet"></svg>
<div class="meas" id="measSect"></div>
</div>
</div>
<div class="hint" id="printHint"></div>
<div class="card">
<div class="codebar">
<button class="btn" id="dl" type="button">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 2v8m0 0L4.5 6.5M8 10l3.5-3.5M2.5 13.5h11"/></svg>
.scad herunterladen</button>
<button class="btn sec" id="cp" type="button">
<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5.5" y="5.5" width="8" height="8" rx="1.5"/><path d="M10.5 5.5V4a1.5 1.5 0 0 0-1.5-1.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5"/></svg>
Code kopieren</button>
<span class="meas" id="copied" role="status" aria-live="polite"></span>
</div>
<pre id="code"></pre>
<div class="meas" style="margin-top:10px">
Danach in OpenSCAD öffnen → <code class="k">Render (F6)</code> →
<code class="k">STL exportieren</code>. Alle Regler sind auch im OpenSCAD-Customizer nutzbar.
</div>
</div>
</div>
</div>
<script>
// ---------------- Zustand ----------------
const P = {
breite:100, hoehe:180, wand_einzel:2, eck_radius:8,
fase_an:true, fase_oben:34, fase_seite:118,
loch_an:true, loch_anzahl:7, loch_d:3, loch_abstand:12.5, loch_start_y:170, loch_rand_x:10,
dw_an:true, dw_hoehe:99, spalt:3.2, wand_doppel:2.4, steg:2, position:"mittig", mund_fase:1.5,
aufloesung:96
};
// ---------------- Control-Definitionen ----------------
const GROUPS = [
["Platte", [
["breite","Breite (X)",40,300,1],
["hoehe","Höhe (Y)",40,400,1],
["wand_einzel","Wand einzel",0.8,6,0.1],
["eck_radius","Eck-Radius",0,25,0.5],
]],
["Fase oben rechts", [
["fase_an","Fase an","bool"],
["fase_oben","flache Oberkante (x)",0,300,1],
["fase_seite","Fase trifft Kante (y)",0,400,1],
]],
["Löcher", [
["loch_an","Löcher an","bool"],
["loch_anzahl","Anzahl",0,40,1],
["loch_d","Durchmesser",0.5,20,0.1],
["loch_abstand","Abstand (Mitte)",2,60,0.5],
["loch_start_y","oberstes Loch (y)",0,400,1],
["loch_rand_x","Abstand li. Kante",1,150,0.5],
]],
["Doppelwand-Fuss", [
["dw_an","Doppelwand an","bool"],
["position","Spalt-/Wand-Position","seg",["mittig","links","rechts"]],
["dw_hoehe","Höhe Doppelwand",5,400,1],
["spalt","Spaltbreite",0.5,15,0.1],
["wand_doppel","Wand doppel",0.8,8,0.1],
["steg","Steg oben",0,20,0.5],
["mund_fase","Einführ-Fase",0,6,0.1],
]],
["Qualität", [
["aufloesung","Auflösung ($fn)",24,180,4],
]],
];
// ---------------- Controls bauen ----------------
const cont = document.getElementById("controls");
GROUPS.forEach(([title,fields])=>{
const fs=document.createElement("fieldset");
fs.innerHTML=`<legend>${title}</legend>`;
fields.forEach(f=>{
const key=f[0], lab=f[1];
if(f[2]==="bool"){
const d=document.createElement("label"); d.className="toggle";
d.innerHTML=`<span>${lab}</span>`;
const c=document.createElement("input"); c.type="checkbox"; c.checked=P[key];
c.setAttribute("aria-label",lab);
c.onchange=()=>{P[key]=c.checked; render();};
d.appendChild(c); fs.appendChild(d);
} else if(f[2]==="seg"){
const opts=f[3];
const wrap=document.createElement("div"); wrap.className="row full";
wrap.innerHTML=`<label>${lab}</label>`;
const seg=document.createElement("div"); seg.className="seg";
opts.forEach(o=>{
const b=document.createElement("button"); b.textContent=o; b.type="button";
b.setAttribute("aria-pressed",String(P[key]===o));
if(P[key]===o)b.classList.add("on");
b.onclick=()=>{P[key]=o;
[...seg.children].forEach(x=>{x.classList.remove("on");x.setAttribute("aria-pressed","false");});
b.classList.add("on"); b.setAttribute("aria-pressed","true"); render();};
seg.appendChild(b);
});
wrap.appendChild(seg); fs.appendChild(wrap);
} else {
const [_,__,mn,mx,st]=f;
const r=document.createElement("div"); r.className="row";
r.innerHTML=`<label>${lab}</label>`;
const num=document.createElement("input"); num.type="number"; num.className="num";
num.value=P[key]; num.min=mn; num.max=mx; num.step=st;
num.setAttribute("aria-label",lab);
const rng=document.createElement("input"); rng.type="range";
rng.min=mn; rng.max=mx; rng.step=st; rng.value=P[key];
rng.setAttribute("aria-label",lab);
// Slider bewegt -> Zahl folgt
rng.oninput=()=>{const v=parseFloat(rng.value); P[key]=v; num.value=v; render();};
// Tippen im Zahlenfeld: NICHT zurueckschreiben (sonst frisst es "2." beim Tippen)
num.oninput=()=>{const v=parseFloat(num.value); if(isNaN(v))return; P[key]=v; rng.value=v; render();};
// Beim Verlassen: leere/ungueltige Eingabe zuruecksetzen, Wert auf min/max begrenzen
num.onchange=()=>{
let v=parseFloat(num.value);
if(isNaN(v)) v=P[key];
v=Math.min(mx,Math.max(mn,v));
P[key]=v; num.value=v; rng.value=v; render();
};
r.appendChild(num); r.appendChild(rng); fs.appendChild(r);
}
});
cont.appendChild(fs);
});
// ---------------- abgeleitete Geometrie (wie SCAD) ----------------
function derive(){
const p=P;
const FT = p.dw_an ? (p.position==="mittig" ? 2*p.wand_doppel+p.spalt
: p.wand_einzel+p.spalt+p.wand_doppel)
: p.wand_einzel;
const slotStart = p.position==="links" ? p.wand_einzel : p.wand_doppel;
const wallZ = !p.dw_an ? 0
: p.position==="mittig" ? FT/2 - p.wand_einzel/2
: p.position==="links" ? 0
: FT - p.wand_einzel;
return {FT, slotStart, wallZ};
}
// ---------------- Vorderansicht ----------------
function drawFront(){
const p=P, svg=document.getElementById("front");
const W=p.breite, H=p.hoehe, pad=20;
const s=Math.min((240-2*pad)/W,(400-2*pad)/H);
const ox=(240-W*s)/2, oy=(400-H*s)/2;
const X=x=>ox+x*s, Y=y=>oy+(H-y)*s; // y invertiert
let pts;
if(p.fase_an) pts=[[0,0],[W,0],[W,p.fase_seite],[p.fase_oben,H],[0,H]];
else pts=[[0,0],[W,0],[W,H],[0,H]];
const poly=pts.map(q=>`${X(q[0]).toFixed(1)},${Y(q[1]).toFixed(1)}`).join(" ");
let holes="";
if(p.loch_an) for(let i=0;i<p.loch_anzahl;i++){
const hy=p.loch_start_y-i*p.loch_abstand;
if(hy<0||hy>H)continue;
holes+=`<circle cx="${X(p.loch_rand_x).toFixed(1)}" cy="${Y(hy).toFixed(1)}" r="${Math.max(1,p.loch_d/2*s).toFixed(1)}" fill="#0d1014" stroke="#e0862f" stroke-width="1"/>`;
}
// Doppelwand-Bereich markieren
let dwBand="";
if(p.dw_an){
const dwY=Math.min(p.dw_hoehe,H); // Anzeige-Clamp: Linie nie ueber die Platte hinaus
dwBand=`<line x1="${X(0)}" y1="${Y(dwY)}" x2="${X(W)}" y2="${Y(dwY)}" stroke="#3a78c2" stroke-width="1.2" stroke-dasharray="5 4"/>`;
}
svg.innerHTML=`<polygon points="${poly}" fill="#243247" stroke="#4a6a8f" stroke-width="1.6"/>${dwBand}${holes}`;
document.getElementById("measFront").innerHTML=
`<b>${W}</b> × <b>${H}</b> mm${p.dw_an?` · Doppelwand bis <b>${p.dw_hoehe}</b>`:""}`;
}
// ---------------- Querschnitt ----------------
function drawSect(){
const p=P, svg=document.getElementById("sect");
const {FT,slotStart,wallZ}=derive();
const H=p.hoehe, pad=20;
const zScale=14; // Dicke ueberzeichnet
const Wz=FT*zScale;
const sy=(400-2*pad)/H;
const oy=pad, ox=(240-Wz)/2;
const X=z=>ox+z*zScale, Y=y=>oy+(H-y)*sy;
let g="";
if(!p.dw_an){
g+=`<rect x="${X(0)}" y="${Y(H)}" width="${p.wand_einzel*zScale}" height="${H*sy}" fill="#243247" stroke="#4a6a8f"/>`;
} else {
const yTop=Math.min(p.dw_hoehe,H); // Anzeige: Doppelwand endet spaetestens an der Plattenhoehe
const steg=Math.min(p.steg,yTop); // Anzeige-Guard gegen negative Hoehen
// linke Schiene
g+=`<rect x="${X(0)}" y="${Y(yTop)}" width="${slotStart*zScale}" height="${yTop*sy}" fill="#243247" stroke="#4a6a8f"/>`;
// rechte Schiene
const rx=slotStart+p.spalt;
g+=`<rect x="${X(rx)}" y="${Y(yTop)}" width="${(FT-rx)*zScale}" height="${yTop*sy}" fill="#243247" stroke="#4a6a8f"/>`;
// Steg oben (verbindet)
g+=`<rect x="${X(0)}" y="${Y(yTop)}" width="${FT*zScale}" height="${steg*sy}" fill="#2c3e57" stroke="#4a6a8f"/>`;
// Einzelwand oben
g+=`<rect x="${X(wallZ)}" y="${Y(H)}" width="${p.wand_einzel*zScale}" height="${(H-yTop+steg)*sy}" fill="#31527a" stroke="#5a83b8"/>`;
// Slot-Beschriftung + Trennwand
const sx=X(slotStart), sw=p.spalt*zScale;
g+=`<rect x="${sx}" y="${Y(yTop-steg)}" width="${sw}" height="${(yTop-steg)*sy}" fill="#0d1014" stroke="#e0862f" stroke-dasharray="4 3"/>`;
g+=`<text x="${sx+sw/2}" y="${Y(0)+14}" fill="#e0862f" font-size="10" text-anchor="middle">Slot ${p.spalt}</text>`;
}
svg.innerHTML=g;
document.getElementById("measSect").innerHTML= p.dw_an
? `Fuss <b>${FT.toFixed(1)}</b> mm · Wand ${slotStart.toFixed(1)} | Spalt ${p.spalt} | Wand ${(FT-slotStart-p.spalt).toFixed(1)} · Pos: <b>${p.position}</b>`
: `Einzelwand <b>${p.wand_einzel}</b> mm`;
}
// ---------------- Druck-Hinweis ----------------
function drawHint(){
const p=P, el=document.getElementById("printHint");
if(!p.dw_an){ el.innerHTML=`<b>Druck:</b> flach auf großer Fläche — unkritisch.`; return; }
if(p.position==="mittig"){
el.innerHTML=`<b>Druck (empfohlen):</b> <b>stehend auf den zwei Schienen</b> (Slot zeigt nach unten aufs Bett). Symmetrisch → Einzelwand steigt mittig hoch, sauberste Statik. Slot druckt stützenfrei, Steg oben ist eine kurze Brücke. Brim setzen (hoch & schmal).`;
} else {
el.innerHTML=`<b>Druck:</b> <b>stehend auf den Schienen</b> drucken (Slot nach unten). Eine große Fläche ist durchgehend/bündig (Seite <b>${p.position}</b>). Liegend flach geht wegen der Doppelwand nicht ohne Stützen im Slot.`;
}
}
// ---------------- SCAD erzeugen ----------------
function scad(){
const p=P;
const b=v=>v?"true":"false";
return `// ============================================================
// Platte + Gleitschienen-Aufnahme — generiert im HTML-Generator
// ============================================================
/* [Platte] */
breite = ${p.breite};
hoehe = ${p.hoehe};
wand_einzel = ${p.wand_einzel};
eck_radius = ${p.eck_radius};
/* [Fase oben rechts] */
fase_an = ${b(p.fase_an)};
fase_oben = ${p.fase_oben};
fase_seite = ${p.fase_seite};
/* [Loecher] */
loch_an = ${b(p.loch_an)};
loch_anzahl = ${p.loch_anzahl};
loch_d = ${p.loch_d};
loch_abstand = ${p.loch_abstand};
loch_start_y = ${p.loch_start_y};
loch_rand_x = ${p.loch_rand_x};
/* [Doppelwand-Fuss] */
dw_an = ${b(p.dw_an)};
dw_hoehe = ${p.dw_hoehe};
spalt = ${p.spalt};
wand_doppel = ${p.wand_doppel};
steg = ${p.steg};
position = "${p.position}"; // mittig | links | rechts
mund_fase = ${p.mund_fase};
/* [Qualitaet] */
aufloesung = ${p.aufloesung};
$fn = aufloesung;
// ---------- abgeleitet ----------
FT = dw_an ? ( position=="mittig" ? 2*wand_doppel + spalt
: wand_einzel + spalt + wand_doppel )
: wand_einzel;
slotStart = position=="links" ? wand_einzel : wand_doppel;
wallZ = !dw_an ? 0
: position=="mittig" ? FT/2 - wand_einzel/2
: position=="links" ? 0
: FT - wand_einzel;
module profile2d(){
pts = fase_an
? [[0,0],[breite,0],[breite,fase_seite],[fase_oben,hoehe],[0,hoehe]]
: [[0,0],[breite,0],[breite,hoehe],[0,hoehe]];
offset(r=eck_radius) offset(delta=-eck_radius) polygon(pts);
}
module holes(){
maxZ = dw_an ? FT : wand_einzel;
for(i=[0:loch_anzahl-1])
translate([loch_rand_x, loch_start_y - i*loch_abstand, -1])
cylinder(h=maxZ+2, d=loch_d, $fn=32);
}
module slotcut(){
yTop = dw_hoehe - steg;
union(){
translate([-1,-1,slotStart]) cube([breite+2, yTop+1, spalt]);
if(mund_fase>0)
hull(){
translate([-1,-1, slotStart-mund_fase]) cube([breite+2,0.01, spalt+2*mund_fase]);
translate([-1, mund_fase, slotStart]) cube([breite+2,0.01, spalt]);
}
}
}
difference(){
union(){
translate([0,0,wallZ]) linear_extrude(wand_einzel) profile2d();
if(dw_an)
intersection(){
linear_extrude(FT) profile2d();
translate([-1,-1,-1]) cube([breite+2, dw_hoehe+1, FT+2]);
}
}
if(dw_an) slotcut();
if(loch_an) holes();
}
`;
}
// ---------------- Render-Loop ----------------
// rAF-Coalescing: beim Slider-Ziehen feuern viele input-Events,
// gezeichnet wird trotzdem max. 1x pro Frame.
let renderQueued=false;
function render(){
if(renderQueued)return;
renderQueued=true;
requestAnimationFrame(()=>{
renderQueued=false;
drawFront(); drawSect(); drawHint();
document.getElementById("code").textContent=scad();
});
}
// ---------------- Buttons ----------------
document.getElementById("dl").onclick=()=>{
const blob=new Blob([scad()],{type:"text/plain"});
const a=document.createElement("a");
const url=URL.createObjectURL(blob);
a.href=url;
a.download=`platte_${P.breite}x${P.hoehe}_${P.dw_an?P.position:"flach"}.scad`;
a.click();
setTimeout(()=>URL.revokeObjectURL(url),1000); // nicht synchron revoken (Firefox-Falle)
};
let copiedTimer=null;
document.getElementById("cp").onclick=async()=>{
const el=document.getElementById("copied");
clearTimeout(copiedTimer);
try{
await navigator.clipboard.writeText(scad());
el.textContent="kopiert ✓";
copiedTimer=setTimeout(()=>{el.textContent="";},1500);
}catch(e){el.textContent="Strg+A im Code, dann Strg+C";}
};
render();
</script>
</body>
</html>