Spaces:
Running
Running
combo7: Bauplan 3D-Waben (Finder) as adventure summary
Browse filesFiles changed (5)
40 unmodified lines41424344454616 unmodified lines6364656667686940 unmodified lines<!-- Ebenen: WebGL-Welt · statische Bild-Ebenen (Fallback / reduzierte Bewegung) · Vignette --><canvas class="adv-gl" aria-hidden="true"></canvas><div class="adv-bg" aria-hidden="true"></div><div class="adv-veil" aria-hidden="true"></div><div class="adv-flash" aria-hidden="true"></div>16 unmodified lines<h1 class="adv-card__title">Flieg mit dem Schwarm</h1><p class="adv-card__lead"></p><div class="adv-choices" role="group" aria-label="Wähle deinen Pfad"></div><div class="rb"></div><div class="adv-card__actions"></div></div>40 unmodified lines4142434445464716 unmodified lines6465666768697040 unmodified lines<!-- Ebenen: WebGL-Welt · statische Bild-Ebenen (Fallback / reduzierte Bewegung) · Vignette --><canvas class="adv-gl" aria-hidden="true"></canvas><canvas class="rb-hive" aria-hidden="true"></canvas><div class="adv-bg" aria-hidden="true"></div><div class="adv-veil" aria-hidden="true"></div><div class="adv-flash" aria-hidden="true"></div>16 unmodified lines<h1 class="adv-card__title">Flieg mit dem Schwarm</h1><p class="adv-card__lead"></p><div class="adv-choices" role="group" aria-label="Wähle deinen Pfad"></div><div class="rb fd-plan"></div><div class="adv-card__actions"></div></div>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310/* Bauplan-Waben exakt aus agenten-finder (cellTexture / makeCell / buildPlanStation-Layout). */import { WebGLRenderer, Scene, PerspectiveCamera, Vector2, Vector3, Group, Mesh, ShaderMaterial, BufferGeometry, BufferAttribute, Points, LineSegments, AdditiveBlending, RingGeometry, CircleGeometry, CanvasTexture, MathUtils, Color, SRGBColorSpace, TextureLoader, PlaneGeometry} from "three";import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";import { RenderPass } from "three/addons/postprocessing/RenderPass.js";import { UnrealBloomPass } from "three/addons/postprocessing/UnrealBloomPass.js";import { ShaderPass } from "three/addons/postprocessing/ShaderPass.js";import { OutputPass } from "three/addons/postprocessing/OutputPass.js";
const ICON = { users: "M12.2 8.5a3.2 3.2 0 1 1-6.4 0a3.2 3.2 0 1 1 6.4 0M3 19.5c.6-3.3 3-5 6-5s5.4 1.7 6 5M15.5 5.6a3 3 0 0 1 0 5.8M17.5 14.8c1.8.6 3 2.2 3.4 4.7", edit: "M4.5 19.5h4l10-10-4-4-10 10zM13 7l4 4", tasks: "M4 6.5l1.6 1.6L8.5 5M4 12.5l1.6 1.6 2.9-3.1M4 18.5l1.6 1.6 2.9-3.1M11.5 6.5H20M11.5 12.5H20M11.5 18.5H20", wave: "M3 12h1.5M6.5 8.5v7M10 5v14M13.5 9v6M17 6.5v11M20.5 10.5v3", eye: "M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12zM15 12a3 3 0 1 1-6 0a3 3 0 1 1 6 0", lock: "M7 10.5h10a2.5 2.5 0 0 1 2.5 2.5v5a2.5 2.5 0 0 1-2.5 2.5H7a2.5 2.5 0 0 1-2.5-2.5v-5A2.5 2.5 0 0 1 7 10.5zM8 10.5V7.8a4 4 0 0 1 8 0v2.7M12 14.5v2.5", scale: "M12 3.5v17M7 20.5h10M5 7.5h14M5 7.5l-2.5 6a3 3 0 0 0 5 0zM19 7.5l-2.5 6a3 3 0 0 0 5 0z", check: "M21 12a9 9 0 1 1-18 0a9 9 0 1 1 18 0M8.2 12.3l2.6 2.6 5-5.4", sliders: "M6 4v16M12 4v16M18 4v16M4 13h4v3H4zM10 7h4v3h-4zM16 11h4v3h-4z", spiral: "M20 12a8 8 0 1 1-2.3-5.6M20 4.5v4h-4M14.2 12a2.2 2.2 0 1 1-4.4 0a2.2 2.2 0 1 1 4.4 0", shield: "M12 2.8 19.5 6v5.6c0 4.6-3.2 8.2-7.5 9.6-4.3-1.4-7.5-5-7.5-9.6V6zM8.8 12l2.2 2.2 4.4-4.6", flask: "M9.5 3h5M10 3v6L4.8 18a2 2 0 0 0 1.7 3h11a2 2 0 0 0 1.7-3L14 9V3M7.5 14.5h9", hex: "M12 2.5 20.5 7.3v9.4L12 21.5l-8.5-4.8V7.3zM12 8.2 15.4 10v4L12 15.8 8.6 14v-4z", clock: "M20.5 12a8.5 8.5 0 1 1-17 0a8.5 8.5 0 1 1 17 0M12 7.5V12l3 2", search: "M17.5 11a6.5 6.5 0 1 1-13 0a6.5 6.5 0 1 1 13 0M20 20l-4.2-4.2", spark: "M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6"};const svgIcon = (k, cls = "fd-ico") => `<svg class="${cls}" viewBox="0 0 24 24" aria-hidden="true"><path d="${ICON[k] || ICON.hex}"/></svg>`;
const FONT = '"Atkinson Hyperlegible Next", system-ui, sans-serif';function wrapLines(c, text, maxW) { const words = String(text).split(" "), lines = []; let line = ""; for (const w of words) { const t = line ? line + " " + w : w; if (c.measureText(t).width > maxW && line) { lines.push(line); line = w; } else line = t; } if (line) lines.push(line); return lines;}function drawIcon(c, key, cx, cy, size, color, lw = 1.7) { c.save(); c.translate(cx - size / 2, cy - size / 2); c.scale(size / 24, size / 24); c.strokeStyle = color; c.lineWidth = lw; c.lineCap = "round"; c.lineJoin = "round"; c.stroke(new Path2D(ICON[key] || ICON.hex)); c.restore();}function hexPath(c, cx, cy, r) { c.beginPath(); for (let k = 0; k < 6; k++) { const a = Math.PI / 3 * k; c.lineTo(cx + r * Math.cos(a), cy + r * Math.sin(a)); } c.closePath(); }const goldGrad = (c, y0, y1) => { const g = c.createLinearGradient(0, y0, 0, y1); g.addColorStop(0, "#fff6d8"); g.addColorStop(.55, "#f4e2a6"); g.addColorStop(1, "#e8c766"); return g; };function cellTexture(kind, data, n) { const S = 512, cv = document.createElement("canvas"); cv.width = cv.height = S; const c = cv.getContext("2d"); c.textAlign = "center"; c.textBaseline = "alphabetic"; if (kind === "choice") { drawIcon(c, data.icon, S / 2, 126, 74, "#e8c766", 1.6); c.font = `700 46px ${FONT}`; c.fillStyle = "#fbf3da"; const L = wrapLines(c, data.t, 360).slice(0, 2); let y = L.length > 1 ? 228 : 252; L.forEach(l => { c.fillText(l, S / 2, y); y += 52; }); c.font = `400 27px ${FONT}`; c.fillStyle = "rgba(233,228,214,.8)"; wrapLines(c, data.d, 320).slice(0, 2).forEach(l => { c.fillText(l, S / 2, y + 4); y += 33; }); const g = c.createLinearGradient(220, 405, 290, 460); g.addColorStop(0, "#f7e7b0"); g.addColorStop(1, "#a8842a"); hexPath(c, S / 2, 434, 26); c.fillStyle = g; c.fill(); c.fillStyle = "#17130a"; c.font = `800 26px ${FONT}`; c.fillText(String(n), S / 2, 443); } else if (kind === "start") { drawIcon(c, "hex", S / 2, 150, 70, "#f4e2a6", 1.5); c.font = `400 112px "Parisienne", "Great Vibes", cursive`; c.fillStyle = goldGrad(c, 210, 320); c.fillText("Los geht's", S / 2, 300); c.font = `700 26px ${FONT}`; c.fillStyle = "rgba(244,226,166,.9)"; c.fillText("3 FRAGEN · 1 BAUPLAN", S / 2, 370); } else if (kind === "center") { c.font = `700 24px ${FONT}`; c.fillStyle = "rgba(244,226,166,.88)"; c.fillText("DEIN AGENT", S / 2, 142); const parts = data.name.split("-"); // „Concierge-Agent“ → zwei Zeilen c.font = `400 ${parts[0].length > 9 ? 92 : 104}px "Parisienne", "Great Vibes", cursive`; c.fillStyle = goldGrad(c, 175, 325); c.save(); c.shadowColor = "rgba(0,0,0,.85)"; c.shadowBlur = 14; c.fillText(parts[0] + "-", S / 2, 236); c.fillText(parts.slice(1).join("-"), S / 2, 318); c.restore(); c.font = `400 28px ${FONT}`; c.fillStyle = "rgba(233,228,214,.88)"; c.fillText(data.suffix, S / 2, 366); c.font = `700 22px ${FONT}`; c.fillStyle = "rgba(232,199,102,.85)"; c.fillText(`BAUPLAN ${data.id}`, S / 2, 420); } else { const guard = kind === "guard"; drawIcon(c, guard ? "shield" : data[2], S / 2, guard ? 150 : 136, guard ? 80 : 70, guard ? "#f4e2a6" : "#e8c766", 1.6); c.font = `700 ${guard ? 48 : 45}px ${FONT}`; c.fillStyle = "#fbf3da"; const L = wrapLines(c, data[0], 370).slice(0, 2); let y = guard ? (L.length > 1 ? 258 : 284) : (L.length > 1 ? 232 : 256); L.forEach(l => { c.fillText(l, S / 2, y); y += 52; }); if (!guard) { c.font = `400 27px ${FONT}`; c.fillStyle = "rgba(233,228,214,.8)"; wrapLines(c, data[1], 320).slice(0, 2).forEach(l => { c.fillText(l, S / 2, y + 6); y += 33; }); } else { c.font = `700 22px ${FONT}`; c.fillStyle = "rgba(232,199,102,.88)"; c.fillText("GUARDRAIL", S / 2, y + 12); } } const t = new CanvasTexture(cv); t.colorSpace = SRGBColorSpace; t.anisotropy = 4; return t;}
export { ICON, svgIcon, cellTexture };
const small = () => Math.min(innerWidth, innerHeight) < 700 || matchMedia("(max-width: 760px)").matches;const IMG = n => `assets/${n}${small() ? "-960" : ""}.webp`;const DEPTH = n => `assets/${n}-depth.png`;
export function createBauplanHive(canvas, { lite = false, getCard = () => null } = {}) { const renderer = new WebGLRenderer({ canvas, antialias: !lite, powerPreference: "high-performance", alpha: false, stencil: false }); let dpr = Math.min(devicePixelRatio || 1, lite ? 1.25 : 1.75); renderer.setPixelRatio(dpr); renderer.setClearColor(0x0b0a08, 1); const scene = new Scene(), camera = new PerspectiveCamera(55, 1, .1, 2000); scene.add(camera); const TAN = Math.tan(MathUtils.degToRad(27.5)), U = { time: { value: 0 } }; const GOLD = new Color(0xe8c766), GOLD_L = new Color(0xf4e2a6); const vsUV = "varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }"; const loader = new TextureLoader(); const texLoad = (url, srgb = true) => { const t = loader.load(url); if (srgb) t.colorSpace = SRGBColorSpace; t.anisotropy = 4; return t; }; const BD = 900, ITER = lite ? 3 : 6; const bdMat = new ShaderMaterial({ uniforms: { map: { value: texLoad(IMG("brand-hexnet")) }, depthMap: { value: texLoad(DEPTH("brand-hexnet"), false) }, uPush: { value: .35 }, uOpacity: { value: 1 }, uBias: { value: 1.1 }, uBright: { value: .5 }, uShift: { value: new Vector2() }, uFocus: { value: .75 } }, vertexShader: vsUV, fragmentShader: `uniform sampler2D map, depthMap; uniform float uPush, uOpacity, uBias, uBright, uFocus; uniform vec2 uShift; varying vec2 vUv; void main(){ vec2 c=vec2(.5,.54); vec2 uv=vUv; for(int i=0;i<${ITER};i++){ float d=texture2D(depthMap,uv).r; uv=c+(vUv-c)/(1.+uPush*(.1+.95*d*d))+uShift*(d-.35);} float d=texture2D(depthMap,uv).r; float blur=uBias*smoothstep(0.,.55,abs(d-uFocus)); gl_FragColor=vec4(texture2D(map,clamp(uv,.002,.998),blur).rgb*uBright,uOpacity); #include <colorspace_fragment> }`, transparent: true, depthTest: false, depthWrite: false }); const bd = new Mesh(new PlaneGeometry(1, 1), bdMat); bd.position.z = -BD; bd.renderOrder = -10; bd.frustumCulled = false; camera.add(bd); function fitBackdrops() { const h = 2 * BD * TAN, w = h * camera.aspect, ia = 16 / 9; const W = (camera.aspect > ia ? w : h * ia) * 1.1, H = (camera.aspect > ia ? w / ia : h) * 1.1; bd.scale.set(W, H, 1); }
function pulseLines(pairs) { const pos = [], aT = [], seed = []; pairs.forEach(([a, b]) => { pos.push(a.x, a.y, a.z, b.x, b.y, b.z); aT.push(0, 1); const s = Math.random(); seed.push(s, s); }); const g = new BufferGeometry(); g.setAttribute("position", new BufferAttribute(new Float32Array(pos), 3)); g.setAttribute("aT", new BufferAttribute(new Float32Array(aT), 1)); g.setAttribute("aSeed", new BufferAttribute(new Float32Array(seed), 1)); const m = new ShaderMaterial({ uniforms: { time: U.time, uOp: { value: 0 }, uColor: { value: GOLD } }, vertexShader: "attribute float aT, aSeed; varying float vT, vS; void main(){ vT = aT; vS = aSeed; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }", fragmentShader: `uniform float time, uOp; uniform vec3 uColor; varying float vT, vS; void main(){ float p = fract(time * (.18 + vS * .25) + vS * 7.0); float gg = exp(-pow((vT - p) * 14.0, 2.0)); float base = .1 + .06 * sin(time * 1.3 + vS * 20.0); gl_FragColor = vec4(uColor * (base + gg * 3.0), (base + gg) * uOp); #include <colorspace_fragment> }`, transparent: true, depthWrite: false, blending: AdditiveBlending }); const l = new LineSegments(g, m); l.frustumCulled = false; return l; } function randomNet(center, extN, n, k, maxLen, opRef) { const nodes = []; for (let i = 0; i < n; i++) nodes.push(new Vector3((Math.random() - .5) * extN.x, (Math.random() - .5) * extN.y, (Math.random() - .5) * extN.z).add(center)); const pairs = []; nodes.forEach((a, i) => nodes.map((b, j) => [j, a.distanceToSquared(b)]).filter(([j, d]) => j > i && d < maxLen * maxLen).sort((x, y) => x[1] - y[1]).slice(0, k).forEach(([j]) => pairs.push([a, nodes[j]]))); const lines = pulseLines(pairs); if (opRef) lines.material.uniforms.uOp = opRef; const ng = new BufferGeometry(), np = new Float32Array(nodes.length * 3), ns = new Float32Array(nodes.length); nodes.forEach((v, i) => { np.set([v.x, v.y, v.z], i * 3); ns[i] = Math.random(); }); ng.setAttribute("position", new BufferAttribute(np, 3)); ng.setAttribute("aSeed", new BufferAttribute(ns, 1)); const nm = new ShaderMaterial({ uniforms: { time: U.time, uOp: lines.material.uniforms.uOp, uSize: { value: 2.2 * dpr }, uColor: { value: GOLD_L } }, vertexShader: "uniform float time, uSize; attribute float aSeed; varying float vA; void main(){ vec4 mv = modelViewMatrix * vec4(position, 1.0); gl_Position = projectionMatrix * mv; vA = .5 + .5 * sin(time * 2.0 + aSeed * 30.0); gl_PointSize = uSize * (1.0 + vA) * 30.0 / max(1.0, -mv.z); }", fragmentShader: "uniform float uOp; uniform vec3 uColor; varying float vA; void main(){ float d = length(gl_PointCoord - .5) * 2.0; gl_FragColor = vec4(uColor * 1.6, (1.0 - smoothstep(.2, 1.0, d)) * (.5 + vA * .5) * uOp);\n#include <colorspace_fragment>\n}", transparent: true, depthWrite: false, blending: AdditiveBlending }); const grp = new Group(); grp.add(lines, new Points(ng, nm)); grp.userData.op = lines.material.uniforms.uOp; return grp; } const R = 6, GAP = .8, RS = R + GAP, HH = Math.sqrt(3) * RS; const winGeo = new CircleGeometry(R, 6), rimGeo = new RingGeometry(R - .42, R, 6, 1), haloGeo = new RingGeometry(R + .55, R + .67, 6, 1);function makeCell(map, { tint = 0, gold = 0 } = {}) { const g = new Group(), uHot = { value: 0 }, uOp = { value: 0 }; const win = new Mesh(winGeo, new ShaderMaterial({ uniforms: { map: { value: map }, uOp, uHot, uTint: { value: tint }, uGold: { value: gold }, time: U.time, uSeed: { value: Math.random() } }, vertexShader: vsUV, fragmentShader: `uniform sampler2D map; uniform float uOp, uHot, uTint, uGold, time, uSeed; varying vec2 vUv; void main(){ vec2 p = (vUv - .5) * 2.0; float hd = max(abs(p.y), abs(p.x) * .866 + abs(p.y) * .5) / .866; vec3 base = mix(vec3(.05, .043, .032), vec3(.11, .09, .06), vUv.y) + vec3(.9, .75, .4) * .05 * (1.0 - vUv.y); base = mix(base, vec3(.13, .1, .045), uTint * .7); base = mix(base, vec3(.3, .22, .08), uGold); float edge = smoothstep(.72, 1.0, hd); float sweep = smoothstep(.08, .0, abs(vUv.x * .8 + vUv.y * .6 - fract(time * .07 + uSeed) * 2.6 + .4)); vec4 t = texture2D(map, vUv); vec3 col = base + vec3(.95, .78, .4) * (edge * (.22 + uHot * .5) + sweep * (.06 + .14 * uHot)) + vec3(.06, .05, .03) * uHot; col = mix(col, t.rgb * (1.0 + uHot * .2), t.a); gl_FragColor = vec4(col, (.88 + uHot * .08) * uOp); #include <colorspace_fragment> }`, transparent: true, depthWrite: false })); const rim = new Mesh(rimGeo, new ShaderMaterial({ uniforms: { time: U.time, uHot, uOp, uTint: { value: tint } }, vertexShader: vsUV, fragmentShader: `uniform float time, uHot, uOp, uTint; varying vec2 vUv; void main(){ float a = atan(vUv.y - .5, vUv.x - .5); float s = .55 + .45 * sin(a * 3.0 - time * 1.6); vec3 c = mix(vec3(.91, .78, .4), vec3(1.0, .95, .8), s * .5) * (.75 + uHot * 1.3) * (.7 + s * .5) * (1.0 - uTint * .3); gl_FragColor = vec4(c, uOp); #include <colorspace_fragment> }`, transparent: true, depthWrite: false, blending: AdditiveBlending })); const halo = new Mesh(haloGeo, new ShaderMaterial({ uniforms: { uOp, uHot }, vertexShader: "void main(){ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }", fragmentShader: "uniform float uOp, uHot; void main(){ gl_FragColor = vec4(vec3(.95, .82, .5) * (.4 + uHot * .7), uOp * (.2 + uHot * .5));\n#include <colorspace_fragment>\n}", transparent: true, depthWrite: false, blending: AdditiveBlending })); win.renderOrder = 1; rim.renderOrder = 2; halo.renderOrder = 2; g.add(win, rim, halo); g.userData = { win, uHot, uOp, hot: 0, seed: Math.random() * 6, home: new Vector3(), from: new Vector3(), t0: 0 }; return g;}
function honeyWall(z, cols, rows, skip) { const pos = [], fade = []; for (let q = -cols; q <= cols; q++) for (let r = -rows; r <= rows; r++) { const x = q * 1.5 * RS, y = (r + (q & 1 ? .5 : 0)) * HH; if (skip.some(s => Math.hypot(s.x - x, s.y - y) < RS * 1.2)) continue; const d = Math.hypot(x / (cols * 1.5 * RS), y / (rows * HH)); if (d > 1.05) continue; const f = Math.max(0, 1 - d * .9) * (.35 + Math.random() * .65); for (let k = 0; k < 6; k++) { const a0 = Math.PI / 3 * k, a1 = Math.PI / 3 * (k + 1), rr = R * .96; pos.push(x + rr * Math.cos(a0), y + rr * Math.sin(a0), z, x + rr * Math.cos(a1), y + rr * Math.sin(a1), z); fade.push(f, f); } } const g = new BufferGeometry(); g.setAttribute("position", new BufferAttribute(new Float32Array(pos), 3)); g.setAttribute("aF", new BufferAttribute(new Float32Array(fade), 1)); const m = new ShaderMaterial({ uniforms: { time: U.time, uOp: { value: 0 } }, vertexShader: "attribute float aF; varying float vF; varying vec3 vP; void main(){ vF = aF; vP = position; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }", fragmentShader: "uniform float time, uOp; varying float vF; varying vec3 vP; void main(){ float s = .6 + .4 * sin(time * .8 + vP.x * .08 + vP.y * .11); gl_FragColor = vec4(vec3(.91, .76, .4) * (.5 + s * .5), vF * .34 * s * uOp);\n#include <colorspace_fragment>\n}", transparent: true, depthWrite: false, blending: AdditiveBlending }); const l = new LineSegments(g, m); l.frustumCulled = false; return l;}
function disposeCell(g) { g.userData.win.material.uniforms.map.value?.dispose?.(); g.traverse(o => o.material?.dispose?.()); } const root = new Group(); scene.add(root); let cells = [], wall = null, net = null, buildT = 0, planKey = "", ext = { w: 10, h: 10 }; function clear() { cells.forEach(c => { root.remove(c); disposeCell(c); }); cells = []; [wall, net].forEach(o => { if (!o) return; root.remove(o); o.traverse(x => { x.geometry?.dispose?.(); x.material?.dispose?.(); }); }); wall = net = null; } function setPlan(p) { const key = (p.id || "") + "|" + (p.core || []).map(m => m[0]).join(",") + "|" + (p.guards || []).map(g => g[0]).join(","); if (planKey === key && cells.length) { buildT = 0; return; } planKey = key; clear(); const ax = (q, r) => new Vector2(q * 1.5 * RS, -(r + q / 2) * HH); const ring1 = [[0, -1], [1, -1], [1, 0], [0, 1], [-1, 1], [-1, 0]].map(([q, r]) => ax(q, r)); const ring2 = [[0, -2], [1, -2], [2, -2], [2, -1], [2, 0], [1, 1], [0, 2], [-1, 2], [-2, 2], [-2, 1], [-2, 0], [-1, -1]].map(([q, r]) => ax(q, r)); const items = [{ kind: "center", data: { name: p.name, suffix: p.suffix, id: p.id }, pos: new Vector2(0, 0) }]; (p.core || []).slice(0, 6).forEach((m, i) => items.push({ kind: "mod", data: m, pos: ring1[i] })); const outer = [...(p.core || []).slice(6).map(m => ({ kind: "mod", data: m })), ...(p.extra || []).map(m => ({ kind: "mod", data: m, extra: true })), ...(p.guards || []).map(g => ({ kind: "guard", data: g }))]; const n2 = Math.min(12, outer.length), used = new Set(); outer.slice(0, n2).forEach((it, i) => { let k = Math.round(i * 12 / n2) % 12; while (used.has(k)) k = (k + 1) % 12; used.add(k); it.pos = ring2[k]; items.push(it); }); items.forEach((it, i) => { const c = makeCell(cellTexture(it.kind, it.data), { gold: it.kind === "center" ? .28 : 0, tint: it.kind === "guard" ? 1 : it.extra ? .5 : 0 }); c.userData.home.set(it.pos.x, it.pos.y, it.kind === "center" ? 1.2 : 0); const ang = Math.atan2(it.pos.y, it.pos.x) + (Math.random() - .5) * .6, rr = 40 + Math.random() * 30; c.userData.from.set(Math.cos(ang) * rr, Math.sin(ang) * rr, -40 - Math.random() * 40); c.userData.t0 = i === 0 ? 0 : .15 + i * .07; c.userData.base = 1; c.position.copy(c.userData.from); root.add(c); cells.push(c); }); const pairs = []; for (let i = 0; i < items.length; i++) for (let j = i + 1; j < items.length; j++) if (items[i].pos.distanceTo(items[j].pos) < HH * 1.05) pairs.push([new Vector3(items[i].pos.x, items[i].pos.y, -.6), new Vector3(items[j].pos.x, items[j].pos.y, -.6)]); const n = new Group(), lines = pulseLines(pairs); n.add(lines, randomNet(new Vector3(0, 0, -26), new Vector3(110, 70, 40), lite ? 40 : 90, 3, 20, lines.material.uniforms.uOp)); n.userData.op = lines.material.uniforms.uOp; net = n; root.add(net); wall = honeyWall(-5, lite ? 5 : 7, lite ? 4 : 5, items.map(it => it.pos)); root.add(wall); ext = { w: 3 * RS + R + 1.5, h: 2 * HH + R * .87 + .8 }; buildT = 0; pose(); } function fit(halfW, halfH, nx, ny, minD, rx, ry) { const a = camera.aspect, d = Math.max(minD, halfW / (TAN * a * rx), halfH / (TAN * ry)); return { d, ox: -nx * d * TAN * a, oy: -ny * d * TAN }; } const rig = { p: new Vector3(0, 0, 60), l: new Vector3() }; function pose() { const wide = innerWidth >= 1000 && camera.aspect > 1.15; let f; if (wide) { const card = getCard(), cl = card?.getBoundingClientRect?.() || { right: innerWidth * .38 }; const left = Math.min(.2, ((cl.right || innerWidth * .38) + 24) / innerWidth * 2 - 1), nx = (left + 1) / 2; f = fit(ext.w, ext.h, nx, .0, 30, (1 - left) / 2 * .96, .82); } else { const H = innerHeight, top = 80, ct = H * .52; const a = 1 - 2 * top / H, b = 1 - 2 * Math.max(top + 90, ct) / H; f = fit(ext.w, ext.h, 0, (a + b) / 2, 28, .94, Math.max(.12, (a - b) / 2)); } const look = new Vector3(f.ox, f.oy, 0); rig.p.copy(look).add(new Vector3(0, .4, f.d)); rig.l.copy(look); } let composer = null, bloom = null; if (!lite) { try { composer = new EffectComposer(renderer); composer.addPass(new RenderPass(scene, camera)); bloom = new UnrealBloomPass(new Vector2(1, 1), .62, .5, .88); composer.addPass(bloom); composer.addPass(new ShaderPass({ uniforms: { tDiffuse: { value: null }, time: U.time }, vertexShader: "varying vec2 vUv; void main(){ vUv=uv; gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.); }", fragmentShader: `uniform sampler2D tDiffuse; uniform float time; varying vec2 vUv; float h(vec2 p){ return fract(sin(dot(p,vec2(12.9898,78.233)))*43758.5453); } void main(){ vec2 d=vUv-.5; float v=smoothstep(.95,.25,length(d*vec2(1.1,1.))); vec3 c=texture2D(tDiffuse,vUv).rgb; c*=mix(.42,1.,v); c+=(h(vUv*1000.+time)-.5)*.012; gl_FragColor=vec4(c,1.); }` })); composer.addPass(new OutputPass()); } catch { composer = null; } } function resize() { const w = canvas.clientWidth || innerWidth, h = canvas.clientHeight || innerHeight; if (w < 2 || h < 2) return; camera.aspect = w / h; camera.updateProjectionMatrix(); renderer.setSize(w, h, false); composer?.setSize(w, h); bloom?.resolution.set(w, h); fitBackdrops(); pose(); } let raf = 0, running = false, last = 0, tAcc = 0; function frame(now) { raf = requestAnimationFrame(frame); const dt = Math.min(.25, (now - (last || now)) / 1000); last = now; tAcc += Math.min(.05, dt); U.time.value = tAcc; buildT += dt; if (net) net.userData.op.value = .9; if (wall?.material?.uniforms?.uOp) wall.material.uniforms.uOp.value = .55; cells.forEach(c => { const u = c.userData; const t = MathUtils.clamp((buildT - u.t0) / 1.1, 0, 1), e = 1 - Math.pow(1 - t, 3); c.position.lerpVectors(u.from, u.home, e); c.position.y += Math.sin(tAcc * .8 + u.seed) * .12 * e; c.rotation.z = (1 - e) * 1.2; c.scale.setScalar(u.base); u.uOp.value = MathUtils.smoothstep(t, 0, .5); }); camera.position.lerp(rig.p, .25); camera.lookAt(rig.l); if (composer) composer.render(dt); else renderer.render(scene, camera); } function start() { if (running) return; running = true; last = 0; resize(); raf = requestAnimationFrame(frame); } function stop() { running = false; cancelAnimationFrame(raf); } addEventListener("resize", resize); return { setPlan, start, stop, resize, rebuild: () => { buildT = 0; pose(); } };}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455/* Agent bauen – Ergänzungen zum Original-Adventure (Bausteine, Ergebnis). Gleiche Gestaltungssprache wie adventure.css. */.adv[data-kind="sub"] .adv-card{max-height:calc(100svh - 7.5rem);overflow:auto;overscroll-behavior:contain}.adv[data-kind="agent"] .adv-card{width:min(66rem,calc(100% - 1.6rem));text-align:left;max-height:calc(100svh - 7rem);overflow:auto;overscroll-behavior:contain}.adv[data-kind="agent"] .adv-card__title{font-size:clamp(2rem,1.4rem + 2vw,3.2rem)}.rb:empty{display:none}.rb__mods{display:grid;gap:.8rem;margin-top:.9rem}.rb__grp{border:0;margin:0;padding:0;display:grid;gap:.45rem}.rb__grp legend{font:700 .74rem/1.3 var(--es-font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--es-gold);margin-bottom:.35rem}.rb__mod{position:relative;display:flex;align-items:center;gap:.6rem;width:100%;text-align:left;padding:.62rem .8rem .62rem 2.4rem;border-radius:14px;border:1px solid rgba(232,199,102,.26);background:linear-gradient(160deg,rgba(232,199,102,.08),rgba(232,199,102,.02));color:#efe9da;font:500 .94rem/1.35 var(--es-font-ui);cursor:pointer;transition:transform .25s,background .25s,border-color .25s,box-shadow .25s}.rb__mod::before{content:"";position:absolute;left:.85rem;top:50%;width:.95rem;height:1.1rem;translate:0 -50%;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);background:rgba(232,199,102,.3);transition:background .25s,box-shadow .25s}.rb__mod[aria-pressed="true"]{border-color:rgba(244,226,166,.75);background:linear-gradient(160deg,rgba(232,199,102,.24),rgba(232,199,102,.07));box-shadow:0 0 22px -6px rgba(232,199,102,.55)}.rb__mod[aria-pressed="true"]::before{background:var(--es-gold-gradient,linear-gradient(135deg,#f7e7b0,#e8c766 50%,#a8842a))}.rb__mod:hover{transform:translateY(-2px);border-color:rgba(244,226,166,.6)}.rb__mod.is-req{cursor:default}.rb__mod small{margin-left:auto;font:700 .66rem/1 var(--es-font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--es-gold)}.rb__mod:focus-visible,.rb__more button:focus-visible{outline:2px solid #fff1c4;outline-offset:2px}.rb__sum{display:grid;grid-template-columns:minmax(0,1fr) minmax(15rem,22rem);gap:1.4rem 1.8rem;align-items:center;margin-top:.8rem}/* Waben-Cluster (combo3/combo4): Agent Mitte, Bausteine drumherum – rechts am Summary */.rb__comb{position:relative;width:100%;aspect-ratio:1/1.05;justify-self:center}.rb__cell{--w:31%;position:absolute;width:var(--w);aspect-ratio:1/1.1547;display:grid;place-items:center;text-align:center;font-style:normal;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);background:rgba(232,199,102,.18);transition:background .35s,transform .35s}.rb__cell::before{content:"";position:absolute;inset:2px;clip-path:inherit;background:rgba(10,9,7,.82)}.rb__cell span{position:relative;padding:0 8%}.rb__cell b{display:block;font:700 clamp(.62rem,.5rem + .35vw,.85rem)/1.15 var(--es-font-ui);color:#a8aaa5}.rb__cell small{display:block;margin-top:.15rem;font-size:.62rem;color:#b9b2a2}.rb__cell.is-on{background:linear-gradient(160deg,#fff1c9,#e8c766 45%,#7a5a22);animation:rb-in .55s both}.rb__cell.is-on::before{background:radial-gradient(circle at 50% 38%,rgba(232,199,102,.38),rgba(10,9,7,.88) 72%)}.rb__cell.is-on b{color:#fff1c4}.rb__cell.is-on small{color:#d8d0bc}.rb__cell[data-cell="0"]{left:34.5%;top:33%;box-shadow:0 0 36px rgba(232,199,102,.55)}.rb__cell[data-cell="0"] b{font-size:clamp(.72rem,.55rem + .4vw,.95rem);color:#fff1c4}.rb__cell[data-cell="1"]{left:34.5%;top:0}.rb__cell[data-cell="2"]{left:64%;top:16.5%}.rb__cell[data-cell="3"]{left:64%;top:49.5%}.rb__cell[data-cell="4"]{left:34.5%;top:66%}.rb__cell[data-cell="5"]{left:5%;top:49.5%}.rb__cell[data-cell="6"]{left:5%;top:16.5%}.rb__cell[data-cell="1"]{animation-delay:.06s}.rb__cell[data-cell="2"]{animation-delay:.12s}.rb__cell[data-cell="3"]{animation-delay:.18s}.rb__cell[data-cell="4"]{animation-delay:.24s}.rb__cell[data-cell="5"]{animation-delay:.3s}.rb__cell[data-cell="6"]{animation-delay:.36s}@keyframes rb-in{from{opacity:0;transform:scale(.62)}to{opacity:1;transform:none}}.rb__mod::before{clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%)!important;width:1.15rem!important;height:1rem!important}.rb__text h2{margin:0;font:700 1.15rem/1.3 var(--es-font-ui);color:#fff1c4}.rb__text p{margin:.35rem 0 0;color:#e9e4d6;font-size:.93rem;line-height:1.55}.rb__text dl{margin:.7rem 0 0;display:grid;grid-template-columns:minmax(9rem,13rem) 1fr;gap:.3rem .9rem;font-size:.86rem;line-height:1.45}.rb__text dt{color:var(--es-gold);font-weight:700}.rb__text dd{margin:0;color:#ece6d6}.rb__text h3{margin:.8rem 0 .25rem;font:700 .74rem/1.3 var(--es-font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--es-gold)}.rb__text ol{margin:0;padding-left:1.2rem;font-size:.86rem;line-height:1.5;color:#ece6d6}.rb__text .rb__note{font-size:.8rem;color:#b9b2a2}.rb__more{display:flex;flex-wrap:wrap;gap:.3rem 1rem;align-items:center}.rb__more button{background:none;border:0;padding:.2rem 0;color:#f4e2a6;font:600 .86rem/1.3 var(--es-font-ui);text-decoration:underline;text-underline-offset:3px;cursor:pointer}.rb__ok{font-size:.8rem;color:var(--es-gold)}@media (max-width:760px){.adv-classic{display:inline-flex}.rb__sum{grid-template-columns:1fr;gap:.7rem}.rb__comb{order:-1;width:min(14rem,70vw);margin:0 auto}.rb__cell small{font-size:.58rem}.rb__text dl{grid-template-columns:1fr}.rb__text dt{margin-top:.3rem}.adv[data-kind="sub"] .adv-card,.adv[data-kind="agent"] .adv-card{max-height:calc(100svh - 6.5rem)}.rb__mod{font-size:.88rem;padding:.52rem .7rem .52rem 2.2rem}}@media (prefers-reduced-motion:reduce){.rb__cell{animation:none!important}.rb__mod{transition:none}}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586/* Agent bauen – Stationen + Bauplan-Summary (Finder-3D-Waben rechts). */.adv[data-kind="sub"] .adv-card{max-height:calc(100svh - 7.5rem);overflow:auto;overscroll-behavior:contain}.rb:empty{display:none}.rb__mods{display:grid;gap:.8rem;margin-top:.9rem}.rb__grp{border:0;margin:0;padding:0;display:grid;gap:.45rem}.rb__grp legend{font:700 .74rem/1.3 var(--es-font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--es-gold);margin-bottom:.35rem}.rb__mod{position:relative;display:flex;align-items:center;gap:.6rem;width:100%;text-align:left;padding:.62rem .8rem .62rem 2.4rem;border-radius:14px;border:1px solid rgba(232,199,102,.26);background:linear-gradient(160deg,rgba(232,199,102,.08),rgba(232,199,102,.02));color:#efe9da;font:500 .94rem/1.35 var(--es-font-ui);cursor:pointer;transition:transform .25s,background .25s,border-color .25s,box-shadow .25s}.rb__mod::before{content:"";position:absolute;left:.85rem;top:50%;width:1.15rem;height:1rem;translate:0 -50%;clip-path:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);background:rgba(232,199,102,.3);transition:background .25s,box-shadow .25s}.rb__mod[aria-pressed="true"]{border-color:rgba(244,226,166,.75);background:linear-gradient(160deg,rgba(232,199,102,.24),rgba(232,199,102,.07));box-shadow:0 0 22px -6px rgba(232,199,102,.55)}.rb__mod[aria-pressed="true"]::before{background:var(--es-gold-gradient,linear-gradient(135deg,#f7e7b0,#e8c766 50%,#a8842a))}.rb__mod:hover{transform:translateY(-2px);border-color:rgba(244,226,166,.6)}.rb__mod.is-req{cursor:default}.rb__mod small{margin-left:auto;font:700 .66rem/1 var(--es-font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--es-gold)}.rb__mod:focus-visible,.rb__more button:focus-visible{outline:2px solid #fff1c4;outline-offset:2px}/* Bauplan-Hive (Finder 3D) – Vollbild hinter der linken Tafel */.rb-hive{position:fixed;inset:0;width:100%;height:100%;z-index:1;display:block;opacity:0;pointer-events:none;transition:opacity .6s ease;outline:none}.adv[data-kind="agent"] .rb-hive{opacity:1}.adv[data-kind="agent"] .adv-gl{opacity:0 !important;pointer-events:none}.adv[data-kind="agent"] .adv-bg{opacity:0;pointer-events:none}.adv[data-kind="agent"] .adv-veil{opacity:.35}/* Linke Bauplan-Tafel (wie agenten-finder fd bauplan) */.adv{--fd-hex:polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%);--fd-cut:1.05rem}.adv[data-kind="agent"] .adv-card{left:max(1.2rem,calc(50% - 600px));translate:0 0;top:4.9rem;bottom:max(1rem,env(safe-area-inset-bottom));width:min(36rem,calc(100% - 2.4rem));text-align:left;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(232,199,102,.45) transparent;padding:1.3rem 1.5rem 1.2rem;max-height:none}.adv[data-kind="agent"] .adv-card__title{font-size:clamp(2.4rem,1.6rem + 2.2vw,3.5rem)}.adv[data-kind="agent"] .adv-card__lead{margin-left:0;max-width:none}.fd-suffix{display:block;margin-top:.15rem;font:600 .82rem/1.3 var(--es-font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--es-gold-light);-webkit-text-fill-color:var(--es-gold-light);filter:none}.adv[data-kind="agent"] .adv-card__actions{position:sticky;bottom:-1.2rem;display:grid;grid-template-columns:1fr 1fr;gap:.5rem;margin:1rem -1.5rem -1.2rem;padding:1rem 1.5rem 1rem;background:linear-gradient(180deg,rgba(16,14,10,0),rgba(16,14,10,.97) 22%)}.adv[data-kind="agent"] .adv-card__actions .adv-btn{justify-content:center;min-height:2.5rem;padding-inline:.7rem;font-size:.88rem}.adv .fd-ico,.fd-cell__ico{width:1.05rem;height:1.05rem;flex:none;fill:none;stroke:var(--es-gold);stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.fd-answers{display:flex;flex-wrap:wrap;gap:.45rem;margin:.9rem 0 0;padding:0;list-style:none}.fd-answers li{display:flex;align-items:center;gap:.5rem;padding:.4rem .75rem .4rem .6rem;border-radius:12px;background:rgba(232,199,102,.07);border:1px solid rgba(232,199,102,.22);font-size:.88rem;color:#f3f0e8;line-height:1.2}.fd-answers small{display:block;font:700 .64rem/1.2 var(--es-font-ui);letter-spacing:.12em;text-transform:uppercase;color:var(--es-gold)}.fd-sec{margin-top:1.15rem}.fd-sec h2{display:flex;align-items:center;gap:.55rem;margin:0 0 .6rem;font:700 .76rem/1.3 var(--es-font-ui);letter-spacing:.16em;text-transform:uppercase;color:var(--es-gold)}.fd-sec h2::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,rgba(232,199,102,.4),transparent)}.fd-cells{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem .5rem;margin:0;padding:0;list-style:none}.fd-cell{--cut:.8rem;position:relative;isolation:isolate;display:grid;grid-template-columns:auto 1fr;grid-template-areas:"ico b" "ico s";align-items:center;gap:.05rem .55rem;padding:.5rem calc(var(--cut) + .3rem);min-height:3.2rem;clip-path:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% 50%,calc(100% - var(--cut)) 100%,var(--cut) 100%,0 50%);background:linear-gradient(160deg,rgba(232,199,102,.5),rgba(232,199,102,.16))}.fd-cell::before{content:"";position:absolute;inset:1px;z-index:-1;clip-path:polygon(var(--cut) 0,calc(100% - var(--cut)) 0,100% 50%,calc(100% - var(--cut)) 100%,var(--cut) 100%,0 50%);background:linear-gradient(160deg,rgba(38,33,24,.96),rgba(14,12,9,.96))}.fd-cell--extra{background:linear-gradient(160deg,rgba(244,226,166,.32),rgba(244,226,166,.1))}.fd-cell--extra::before{background:linear-gradient(160deg,rgba(30,27,21,.96),rgba(12,11,9,.96))}.fd-cell__ico{grid-area:ico}.fd-cell b{grid-area:b;font-size:.92rem;line-height:1.2;color:#fbf3da}.fd-cell span{grid-area:s;font-size:.78rem;line-height:1.3;color:var(--es-text-muted)}.fd-guards,.fd-steps{display:grid;gap:.45rem;margin:0;padding:0;list-style:none}.fd-guards li{display:flex;gap:.6rem;align-items:flex-start;font-size:.9rem;line-height:1.45;color:#e9e4d6}.fd-guards li .fd-ico{margin-top:.15rem;stroke:var(--es-gold-light)}.fd-guards b,.fd-steps b{color:#fbf3da}.fd-steps li{display:flex;gap:.65rem;align-items:flex-start;font-size:.9rem;line-height:1.45;color:#e9e4d6}.fd-steps__n{flex:none;display:grid;place-items:center;width:1.75rem;height:1.52rem;margin-top:.02rem;clip-path:var(--fd-hex);background:var(--es-gold-gradient);color:var(--es-on-gold);font:800 .78rem/1 var(--es-font-ui)}.fd-note{display:flex;gap:.6rem;margin:1rem 0 0;padding:.7rem .85rem;border-radius:14px;background:rgba(232,199,102,.08);border:1px dashed rgba(232,199,102,.38);font-size:.88rem;line-height:1.45;color:#e9e4d6}.fd-note .fd-ico{margin-top:.15rem}.fd-disclaimer{margin:.9rem 0 0;font-size:.78rem;line-height:1.45;color:var(--es-text-dim)}.rb__more{display:flex;flex-wrap:wrap;gap:.3rem 1rem;align-items:center;margin-top:.7rem}.rb__more button{background:none;border:0;padding:.2rem 0;color:#f4e2a6;font:600 .86rem/1.3 var(--es-font-ui);text-decoration:underline;text-underline-offset:3px;cursor:pointer}.rb__ok{font-size:.8rem;color:var(--es-gold)}@media (max-width:999px){.adv[data-kind="agent"] .adv-card{left:50%;translate:-50% 0;top:auto;bottom:max(1rem,env(safe-area-inset-bottom));width:min(40rem,calc(100% - 1.6rem));max-height:min(52svh,28rem)}.adv[data-kind="agent"] .adv-card__actions{grid-template-columns:1fr}}@media (max-width:760px){.adv-classic{display:inline-flex}.adv[data-kind="sub"] .adv-card,.adv[data-kind="agent"] .adv-card{max-height:calc(100svh - 6.5rem)}.adv[data-kind="agent"] .adv-card{max-height:min(48svh,26rem);padding:1rem 1.1rem .9rem}.adv[data-kind="agent"] .adv-card__actions{margin:1rem -1.1rem -.9rem;padding:1rem 1.1rem .9rem}.rb__mod{font-size:.88rem;padding:.52rem .7rem .52rem 2.2rem}.fd-cells{grid-template-columns:1fr}}@media (prefers-reduced-motion:reduce){.rb__mod{transition:none}.rb-hive{transition:none}}
7 unmodified lines891011121338 unmodified lines52535455565747 unmodified lines10510610710810911011111211311411511611711811912012112212312412512612738 unmodified lines1661671681691701711721737 unmodified linesstatic (kein WebGL oder prefers-reduced-motion: Bild-Überblendungen)===================================================================== */import { CATS, CASES } from "../combo/builder.src.js";import {WebGLRenderer, Scene, PerspectiveCamera, Vector2, Vector3, Group, Mesh, PlaneGeometry, ShaderMaterial,TextureLoader, SRGBColorSpace, BufferGeometry, BufferAttribute, Points, LineSegments, AdditiveBlending,38 unmodified lines];const INTRO_SECONDS = reduceMotion ? 7.5 : 11;/* ---------------------------------------------------------------- Routen */function parse(hash = location.hash) {const p = hash.replace(/^#\/?/, "").split("/").filter(Boolean);47 unmodified linesactions = `<button class="adv-btn adv-btn--gold" type="button" data-go="${nx}">${r.si + 1 < p.subs.length ? `Nächste Station: ${esc(p.subs[r.si + 1].title)}` : "Agent zusammensetzen"}<svg aria-hidden="true"><use href="#i-arrow"/></svg></button>`+ `<button class="adv-btn" type="button" data-back><svg aria-hidden="true"><use href="#i-chev-l"/></svg>Zurück</button>`;} else if (r.kind === "agent") {const p = PATHS[r.pi], c = p.c, sel = SEL[r.pi];kicker = `Ziel erreicht · ${p.short}`; title = "Dein Agent steht"; lead = "";// Waben-Cluster rechts: Agent in der Mitte, sechs Baustein-Waben drumherum (wie combo3/combo4)const cells = [["", (c.short || c.name.split(" ")[0])], ...CATS.map(([k, n]) => [k, n.split(" ")[0]])];extra = `<div class="rb__sum"><div class="rb__text"><h2>${esc(c.name)}</h2><p>${esc(c.was)}</p><dl>${CATS.map(([k, n]) => `<dt>${esc(n)}</dt><dd>${sel[k].map(o => esc(lab(o))).join(" · ") || "–"}</dd>`).join("")}<dt>Kontrollierte Risiken</dt><dd>${c.risiken.map(esc).join(" · ")}</dd></dl><h3>Typische Pilot-Schritte (Vorschlag, ${esc(c.dauer)})</h3><ol>${c.pilot.map(x => `<li>${esc(x)}</li>`).join("")}</ol><p class="rb__note">Ein Vorschlag als Gesprächsgrundlage – Umfang und Zeitplan klären wir im Erstgespräch. Es wird nichts automatisch gesendet.</p><p class="rb__more"><button type="button" data-a="copy">Zusammenfassung kopieren</button><button type="button" data-a="dl">Als Text herunterladen</button><button type="button" data-a="reset">Neu beginnen</button><span class="rb__ok" role="status"></span></p></div><div class="rb__comb" aria-hidden="true">${cells.map(([k, t], i) => `<i class="rb__cell is-on" data-cell="${i}"><span><b>${esc(t)}</b>${k ? `<small>${sel[k].length} Baustein${sel[k].length === 1 ? "" : "e"}</small>` : ""}</span></i>`).join("")}</div></div>`;actions = `<button class="adv-btn adv-btn--gold" type="button" data-a="contact">Als Anfrage übernehmen<svg aria-hidden="true"><use href="#i-arrow"/></svg></button><button class="adv-btn" type="button" data-a="chat">Im Schwarmraum besprechen</button><button class="adv-btn" type="button" data-back><svg aria-hidden="true"><use href="#i-chev-l"/></svg>Zurück</button>`;}const apply = () => {c.kicker.textContent = kicker; c.title.textContent = title; c.lead.textContent = lead;c.choices.innerHTML = choices; c.actions.innerHTML = actions; c.extra.innerHTML = extra; c.card.dataset.kind = r.kind;c.choices.setAttribute("aria-label", r.kind === "wahl" ? "Wähle deinen Pfad" : "Wähle eine Station");c.card.classList.remove("is-swapping");requestAnimationFrame(() => world?.refit?.());if (kbUser) (c.choices.querySelector("button") || c.actions.querySelector("a,button"))?.focus({ preventScroll: true });};if (r.kind === "intro") { apply(); return; }38 unmodified linesdocument.title = (r.kind === "intro" ? "Abenteuer" : r.kind === "wahl" ? "Wohin fliegen wir?" : r.kind === "path" || r.kind === "agent" ? PATHS[r.pi].title : PATHS[r.pi].subs[r.si].title) + " · EINswarm";if (r.kind === "intro") startIntro(); else stopIntro();const w3 = x => x && x.kind === "agent" ? { kind: "path", pi: x.pi } : x;if (world && mode !== "static") { const a = w3(r), b = w3(prev); if (same(a, b) && !instant) flash(); else world.goTo(a, b, instant); }else { if (r.kind !== "intro") bgShow(imgFor(r)); if (prev && r.kind !== "intro" && !instant) flash(); }}const go = h => setRoute(parse(h));const back = () => { if (route && route.kind !== "intro" && route.kind !== "wahl") setRoute(parentR(route)); };7 unmodified lines89101112131438 unmodified lines535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312447 unmodified lines17217317417517617717817918018118218318418518618718818919019119219338 unmodified lines2322332342352362372382392402412422432447 unmodified linesstatic (kein WebGL oder prefers-reduced-motion: Bild-Überblendungen)===================================================================== */import { CATS, CASES } from "../combo/builder.src.js";import { createBauplanHive, svgIcon } from "./bauplan-hive.src.js";import {WebGLRenderer, Scene, PerspectiveCamera, Vector2, Vector3, Group, Mesh, PlaneGeometry, ShaderMaterial,TextureLoader, SRGBColorSpace, BufferGeometry, BufferAttribute, Points, LineSegments, AdditiveBlending,38 unmodified lines];const INTRO_SECONDS = reduceMotion ? 7.5 : 11;const CAT_ICO = { daten: "tasks", tools: "sliders", guard: "shield", dsgvo: "scale", frei: "check", audit: "clock" };function shortCell(t, n = 26) { t = lab(t); return t.length > n ? t.slice(0, n - 1) + "…" : t; }function planFrom(pi) {const path = PATHS[pi], c = path.c, sel = SEL[pi];const name = path.title.includes("-") ? path.title : path.title.replace(/ Agent$/, "") + "-Agent";const core = [];for (const [k, n] of CATS) {if (k === "guard") continue;for (const o of sel[k]) core.push([shortCell(o), n, CAT_ICO[k] || "hex"]);}if (!core.some(m => m[0] === "Wächter")) core.push(["Wächter", "prüft jede Aktion gegen die Guardrails", "shield"]);if (!core.some(m => m[0] === "Falsifikator")) core.push(["Falsifikator", "prüft Aussagen deterministisch", "flask"]);const guards = [["EU", "EU-Verarbeitung", "Daten werden ausschließlich in der EU verarbeitet."],...sel.guard.map(o => { const t = lab(o); const s = shortCell(t, 18); return [s, s, t]; }),...sel.dsgvo.filter(o => /AVV|Art\.?\s*28|Rechtsgrundlage|Betroffenen|EU/i.test(lab(o))).map(o => {const t = lab(o); const s = /AVV|28/.test(t) ? "AVV Art. 28" : /Rechtsgrundlage/i.test(t) ? "Rechtsgrundlage" : /Betroffenen/i.test(t) ? "Betroffenenrechte" : shortCell(t, 18);return [s, s, t];}),["Tests", "Deterministische Tests", "Gleiche Eingabe, gleiches Ergebnis. Fällt ein Test durch, wird nichts ausgeführt."],["Nur mit Freigabe", "Änderungen nur nach menschlicher Freigabe", "Verbesserungen werden vorgeschlagen, getestet und erst nach Freigabe übernommen."]];const seen = new Set(); const uniqGuards = [];for (const g of guards) { if (seen.has(g[0])) continue; seen.add(g[0]); uniqGuards.push(g); }return {id: `A${pi + 1}`, name, suffix: "mit festen Grenzen", role: c.was,core: core.slice(0, 10), extra: [], guards: uniqGuards.slice(0, 10),answers: CATS.map(([k, n]) => [n, sel[k].map(lab).join(", ") || "–", CAT_ICO[k]]),steps: c.pilot.map((x, i) => [`Schritt ${i + 1}`, x]),note: "Ein Vorschlag als Gesprächsgrundlage – Umfang und Zeitplan klären wir im Erstgespräch. Es wird nichts automatisch gesendet."};}function planHTML(pl) {const cell = (m, extra) => `<li class="fd-cell${extra ? " fd-cell--extra" : ""}">${svgIcon(m[2], "fd-cell__ico")}<b>${esc(m[0])}</b><span>${esc(m[1])}</span></li>`;return `<ul class="fd-answers" aria-label="Deine Bausteine">${pl.answers.map(([k, v, ic]) => `<li>${svgIcon(ic)}<span><small>${esc(k)}</small>${esc(v)}</span></li>`).join("")}</ul>`+ `<section class="fd-sec"><h2>Module</h2><ul class="fd-cells">${pl.core.map(m => cell(m)).join("")}${pl.extra.map(m => cell(m, true)).join("")}</ul></section>`+ `<section class="fd-sec"><h2>Guardrails</h2><ul class="fd-guards">${pl.guards.map(g => `<li>${svgIcon("shield")}<span><b>${esc(g[1])}.</b> ${esc(g[2])}</span></li>`).join("")}</ul></section>`+ `<section class="fd-sec"><h2>Schritt für Schritt</h2><ol class="fd-steps">${pl.steps.map((s, i) => `<li><span class="fd-steps__n">${i + 1}</span><span><b>${esc(s[0])}.</b> ${esc(s[1])}</span></li>`).join("")}</ol></section>`+ (pl.note ? `<p class="fd-note">${svgIcon("spark")}<span><b>Hinweis:</b> ${esc(pl.note)}</span></p>` : "")+ `<p class="fd-disclaimer">Aus deinem Abenteuer zusammengesetzt – eine Orientierung, kein Angebot.</p>`+ `<p class="rb__more"><button type="button" data-a="copy">Zusammenfassung kopieren</button><button type="button" data-a="dl">Als Text herunterladen</button><button type="button" data-a="reset">Neu beginnen</button><span class="rb__ok" role="status"></span></p>`;}let hive = null, hivePlan = null;function ensureHive() {if (hive || mode === "static") return hive;const canvas = $(".rb-hive"); if (!canvas) return null;try {hive = createBauplanHive(canvas, { lite: mode === "lite" || small || coarse || weak, getCard: () => ui.card });} catch (err) { console.warn("Bauplan-Hive:", err); hive = null; }return hive;}function showHive(pi) {const h = ensureHive(); if (!h) return;hivePlan = planFrom(pi);h.setPlan(hivePlan);h.start();world?.stop();requestAnimationFrame(() => { h.resize(); h.rebuild(); });}function hideHive() {if (!hive) return;hive.stop();if (world && mode !== "static" && route && route.kind !== "agent") world.start();}/* ---------------------------------------------------------------- Routen */function parse(hash = location.hash) {const p = hash.replace(/^#\/?/, "").split("/").filter(Boolean);47 unmodified linesactions = `<button class="adv-btn adv-btn--gold" type="button" data-go="${nx}">${r.si + 1 < p.subs.length ? `Nächste Station: ${esc(p.subs[r.si + 1].title)}` : "Agent zusammensetzen"}<svg aria-hidden="true"><use href="#i-arrow"/></svg></button>`+ `<button class="adv-btn" type="button" data-back><svg aria-hidden="true"><use href="#i-chev-l"/></svg>Zurück</button>`;} else if (r.kind === "agent") {const p = PATHS[r.pi], pl = planFrom(r.pi);kicker = `Dein Bauplan · Nr. ${pl.id}`; title = pl.name; lead = pl.role;extra = planHTML(pl);actions = `<button class="adv-btn adv-btn--gold" type="button" data-a="contact">Als Anfrage übernehmen<svg aria-hidden="true"><use href="#i-arrow"/></svg></button><button class="adv-btn" type="button" data-a="chat">Im Schwarmraum besprechen</button><button class="adv-btn" type="button" data-back><svg aria-hidden="true"><use href="#i-chev-l"/></svg>Zurück</button><button class="adv-btn" type="button" data-a="reset">Neu beginnen</button>`;}const apply = () => {c.kicker.textContent = kicker; c.title.textContent = title; c.lead.textContent = lead;if (r.kind === "agent") {const pl = planFrom(r.pi);c.title.insertAdjacentHTML("beforeend", ` <span class="fd-suffix">${esc(pl.suffix)}</span>`);}c.choices.innerHTML = choices; c.actions.innerHTML = actions; c.extra.innerHTML = extra; c.card.dataset.kind = r.kind;c.choices.setAttribute("aria-label", r.kind === "wahl" ? "Wähle deinen Pfad" : "Wähle eine Station");c.card.classList.remove("is-swapping"); c.card.scrollTop = 0;if (r.kind === "agent" && mode !== "static") showHive(r.pi); else hideHive();requestAnimationFrame(() => { world?.refit?.(); if (r.kind === "agent") hive?.resize(); });if (kbUser) (c.choices.querySelector("button") || c.actions.querySelector("a,button"))?.focus({ preventScroll: true });};if (r.kind === "intro") { apply(); return; }38 unmodified linesdocument.title = (r.kind === "intro" ? "Abenteuer" : r.kind === "wahl" ? "Wohin fliegen wir?" : r.kind === "path" || r.kind === "agent" ? PATHS[r.pi].title : PATHS[r.pi].subs[r.si].title) + " · EINswarm";if (r.kind === "intro") startIntro(); else stopIntro();const w3 = x => x && x.kind === "agent" ? { kind: "path", pi: x.pi } : x;if (r.kind === "agent") {if (mode === "static") { bgShow("brand-hexnet"); if (prev && !instant) flash(); }else if (prev && prev.kind !== "agent" && !instant) flash();} else if (world && mode !== "static") {hideHive();const a = w3(r), b = w3(prev); if (same(a, b) && !instant) flash(); else world.goTo(a, b, instant);} else { if (r.kind !== "intro") bgShow(imgFor(r)); if (prev && r.kind !== "intro" && !instant) flash(); }}const go = h => setRoute(parse(h));const back = () => { if (route && route.kind !== "intro" && route.kind !== "wahl") setRoute(parentR(route)); };
einswarm-de-reise.html+2-1
einswarm-de/reise/bauplan-hive.src.jsAdded+310
einswarm-de/reise/reise.css+70-39
einswarm-de/reise/reise.js
einswarm-de/reise/reise.src.js+85-14