Spaces:
Paused
Paused
STUDIUS X1: modern console-dashboard redesign (Outfit, tiles, guide, PBR glass orb, bloom, power-on intro)
Browse files- app.js +239 -225
- fonts/outfit-latin-wght.woff2 +0 -0
- icons.js +4 -0
- index.html +71 -28
- style.css +181 -139
- vendor/addons/environments/RoomEnvironment.js +144 -0
app.js
CHANGED
|
@@ -1,19 +1,37 @@
|
|
| 1 |
import * as THREE from './vendor/three.module.min.js';
|
| 2 |
-
import { STUDIOS, stopLoops } from './widgets.js?v=
|
| 3 |
-
import { icon } from './icons.js?v=
|
| 4 |
import { EffectComposer } from './vendor/addons/postprocessing/EffectComposer.js';
|
| 5 |
import { RenderPass } from './vendor/addons/postprocessing/RenderPass.js';
|
| 6 |
import { UnrealBloomPass } from './vendor/addons/postprocessing/UnrealBloomPass.js';
|
| 7 |
import { OutputPass } from './vendor/addons/postprocessing/OutputPass.js';
|
|
|
|
| 8 |
|
| 9 |
const $ = (s) => document.querySelector(s);
|
| 10 |
const isMobile = matchMedia('(pointer:coarse)').matches || innerWidth < 700;
|
| 11 |
let quality = isMobile ? 'low' : 'high', qMode = 'AUTO';
|
| 12 |
-
const GOLD = 0xf2c94c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
/* ---------- sound (off by default) ---------- */
|
| 15 |
let ac = null, soundOn = false;
|
| 16 |
-
function beep(f = 440, d = .06, type = '
|
| 17 |
if (!soundOn) return; try {
|
| 18 |
ac = ac || new (window.AudioContext || window.webkitAudioContext)();
|
| 19 |
const o = ac.createOscillator(), g = ac.createGain(); o.type = type; o.frequency.value = f;
|
|
@@ -21,251 +39,247 @@ function beep(f = 440, d = .06, type = 'square', v = .04) {
|
|
| 21 |
o.connect(g).connect(ac.destination); o.start(); o.stop(ac.currentTime + d);
|
| 22 |
} catch (e) {}
|
| 23 |
}
|
| 24 |
-
function toggleSound() { soundOn = !soundOn;
|
| 25 |
-
$('#snd').onclick = toggleSound; $('#snd').innerHTML = icon('mute');
|
| 26 |
|
| 27 |
-
/* ---------- three
|
| 28 |
let renderer = null, gl3d = true, composer = null, bloom = null;
|
| 29 |
try {
|
| 30 |
-
renderer = new THREE.WebGLRenderer({ canvas: $('#gl'), antialias:
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
const
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
renderer.
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
if (dust) dust.geometry.setDrawRange(0, quality === 'high' ? DUST : DUST / 3 | 0);
|
| 43 |
-
$('#q').textContent = 'Q:' + (qMode === 'AUTO' ? 'AUTO·' + quality[0].toUpperCase() : quality.toUpperCase());
|
| 44 |
}
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
const
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
for (let i = 0; i < 3; i++) { const ring = new THREE.Mesh(new THREE.TorusGeometry(5 + i * 1.1, .025, 6, 120), new THREE.MeshBasicMaterial({ color: [GOLD, GOLD, CYAN][i], transparent: true, opacity: i === 2 ? .22 : .45 })); ring.rotation.x = Math.PI / 2 + i * .35; ring.rotation.y = i * .6; ring.userData.spin = .2 + i * .15; core.add(ring); }
|
| 62 |
-
// hex floor grid
|
| 63 |
-
{
|
| 64 |
-
const pts = []; const R = .9, W = R * Math.sqrt(3);
|
| 65 |
-
for (let q = -14; q <= 14; q++) for (let r = -14; r <= 14; r++) {
|
| 66 |
-
const cx = W * (q + r / 2), cz = 1.5 * R * r; if (cx * cx + cz * cz > 420) continue;
|
| 67 |
-
for (let k = 0; k < 6; k++) { const a = Math.PI / 6 + k * Math.PI / 3, b = a + Math.PI / 3; pts.push(cx + R * Math.cos(a), 0, cz + R * Math.sin(a), cx + R * Math.cos(b), 0, cz + R * Math.sin(b)); }
|
| 68 |
-
}
|
| 69 |
-
const g = new THREE.BufferGeometry(); g.setAttribute('position', new THREE.Float32BufferAttribute(pts, 3));
|
| 70 |
-
const floor = new THREE.LineSegments(g, new THREE.LineBasicMaterial({ color: 0xd4a63a, transparent: true, opacity: .13 })); floor.position.y = -6; scene.add(floor);
|
| 71 |
}
|
| 72 |
-
// hex swarm (instanced)
|
| 73 |
-
const SW_MAX = isMobile ? 260 : 620;
|
| 74 |
-
const hexGeo = new THREE.CylinderGeometry(.11, .11, .04, 6);
|
| 75 |
-
const swarm = new THREE.InstancedMesh(hexGeo, new THREE.MeshStandardMaterial({ color: GOLD, emissive: 0x6b4a10, metalness: .8, roughness: .3 }), SW_MAX);
|
| 76 |
-
const swData = [...Array(SW_MAX)].map(() => ({ r: 4.5 + Math.random() * 9, a: Math.random() * 6.28, y: (Math.random() - .5) * 7, s: (.1 + Math.random() * .4) * (Math.random() < .5 ? -1 : 1), w: Math.random() * 6 }));
|
| 77 |
-
const tmp = new THREE.Object3D(), tmpC = new THREE.Color();
|
| 78 |
-
swData.forEach((d, i) => swarm.setColorAt(i, tmpC.set([GOLD, GOLD, 0xd4a63a, GOLD, ORANGE, CYAN][i % 6])));
|
| 79 |
-
scene.add(swarm);
|
| 80 |
-
// dust / burst particles
|
| 81 |
-
const DUST = isMobile ? 1500 : 4000;
|
| 82 |
-
const dpos = new Float32Array(DUST * 3), dvel = new Float32Array(DUST * 3);
|
| 83 |
-
for (let i = 0; i < DUST; i++) { const v = new THREE.Vector3().randomDirection().multiplyScalar(10 + Math.random() * 40); dpos.set([v.x, v.y, v.z], i * 3); }
|
| 84 |
-
const dGeo = new THREE.BufferGeometry(); dGeo.setAttribute('position', new THREE.BufferAttribute(dpos, 3));
|
| 85 |
-
const dust = new THREE.Points(dGeo, new THREE.PointsMaterial({ color: 0xf6dcac, size: .07, transparent: true, opacity: .55, blending: THREE.AdditiveBlending, depthWrite: false })); scene.add(dust);
|
| 86 |
-
function burst() { for (let i = 0; i < DUST; i++) { const v = new THREE.Vector3().randomDirection().multiplyScalar(.3 + Math.random() * 1.2); dpos.set([0, 0, 0], i * 3); dvel.set([v.x, v.y, v.z], i * 3); } bursting = 1; }
|
| 87 |
-
let bursting = 0;
|
| 88 |
|
| 89 |
-
/*
|
| 90 |
const CATS = ['Alle', 'Text', 'Bild', 'Video', 'Audio', 'Automation', 'Code', 'Community', 'Design'];
|
| 91 |
-
const
|
| 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 |
function open(i) {
|
| 119 |
-
stopLoops(); openId = i; const s = STUDIOS[i]; beep(990, .08, 'triangle');
|
| 120 |
-
pop.innerHTML = `<div class="ph"><span class="pi">${icon(s.id)}</span><span class="pt"><b>${s.name}</b><small>${s.cat === '+' ? 'Modul' : s.cat} · ${s.like}</small></span><button aria-label="
|
| 121 |
-
pop.classList.remove('in'); void pop.offsetWidth; pop.classList.add('in');
|
| 122 |
-
pop.
|
|
|
|
| 123 |
}
|
| 124 |
-
function close() {
|
| 125 |
-
|
| 126 |
-
if (openId == null
|
| 127 |
-
const W = pop.offsetWidth, H = pop.offsetHeight; const x = innerWidth - W - Math.max(40, innerWidth * .06);
|
| 128 |
-
const y = Math.max(76, Math.min((innerHeight - H) / 2, innerHeight - H - 200));
|
| 129 |
-
pop.style.left = x + 'px'; pop.style.top = y + 'px';
|
| 130 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
-
/
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
addEventListener('keydown', e => {
|
| 142 |
-
if (!started) { start(); return; }
|
| 143 |
-
if (e.target.matches('input,textarea')) return;
|
| 144 |
-
const
|
| 145 |
-
if (['ArrowRight', 'd', 'D'
|
| 146 |
-
else if (['ArrowLeft', 'a', 'A'
|
| 147 |
-
else if (
|
| 148 |
-
else if (
|
| 149 |
-
else if (
|
| 150 |
-
else if (
|
| 151 |
-
else if (
|
|
|
|
|
|
|
|
|
|
| 152 |
});
|
| 153 |
-
const mouse =
|
| 154 |
-
|
| 155 |
-
addEventListener('pointermove', e => { mouse.set(e.clientX / innerWidth * 2 - 1, -(e.clientY / innerHeight) * 2 + 1);
|
| 156 |
-
if (drag) { cam.tth -= (e.clientX - drag.x) * .005; cam.tph = Math.max(.35, Math.min(1.5, cam.tph - (e.clientY - drag.y) * .004)); drag = { x: e.clientX, y: e.clientY, moved: drag.moved + Math.abs(e.movementX || 1) }; } });
|
| 157 |
-
cv.addEventListener('pointerdown', e => { drag = { x: e.clientX, y: e.clientY, moved: 0 }; });
|
| 158 |
-
addEventListener('pointerup', e => { if (drag && drag.moved < 6 && e.target === cv && started) { ray.setFromCamera(mouse, camera); const h = ray.intersectObjects(nodes, false)[0]; if (h) { select(h.object.userData.i); open(h.object.userData.i); } } drag = null; });
|
| 159 |
-
addEventListener('wheel', e => { cam.tr = Math.max(12, Math.min(34, cam.tr + e.deltaY * .01)); }, { passive: true });
|
| 160 |
-
function cycleQ() { qMode = qMode === 'AUTO' ? 'HIGH' : qMode === 'HIGH' ? 'LOW' : 'AUTO'; if (qMode !== 'AUTO') quality = qMode.toLowerCase(); applyQuality(); }
|
| 161 |
-
$('#q').onclick = cycleQ;
|
| 162 |
addEventListener('resize', () => { camera.aspect = innerWidth / innerHeight; camera.updateProjectionMatrix(); applyQuality(); });
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
const
|
| 167 |
-
if (!started
|
| 168 |
-
if (
|
| 169 |
-
|
| 170 |
-
else if (
|
| 171 |
}
|
| 172 |
|
| 173 |
-
/* ---------- intro ---------- */
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
line.innerHTML = t.replace(/</g, '<') + (s ? ` <span class="${s}">[${s === 'w' ? ' WARN ' : ' OK '}]</span>` : ''); beep(1200, .015); await new Promise(r => setTimeout(r, 90)); }
|
| 183 |
-
await new Promise(r => setTimeout(r, 250)); if (started) return; $('#intro').classList.add('rev'); $('#reveal').classList.add('on'); beep(220, .4, 'sawtooth', .05);
|
| 184 |
-
setTimeout(() => $('#press')?.classList.add('on'), 1500);
|
| 185 |
-
}
|
| 186 |
function start() {
|
| 187 |
-
if (started) return; started = true; beep(110, .
|
| 188 |
-
|
| 189 |
-
|
|
|
|
| 190 |
}
|
| 191 |
-
$('#skip').onclick = (e) => { e.stopPropagation(); start(); };
|
| 192 |
-
$('#intro').addEventListener('pointerdown', (e) => { if (e.target.id !== 'skip') start(); });
|
| 193 |
-
cam.r = 60; cam.tr = 40;
|
| 194 |
-
bootSeq();
|
| 195 |
|
| 196 |
/* ---------- loop ---------- */
|
| 197 |
-
const
|
| 198 |
-
const
|
| 199 |
-
|
| 200 |
-
c.setAttribute('class', i === sel ? 'sel' : v.includes(i) ? 'on' : 'off'); });
|
| 201 |
-
const a = Math.atan2(camera.position.z, camera.position.x) * 180 / Math.PI; vw.setAttribute('transform', `rotate(${a} 50 50)`); }
|
| 202 |
-
const stats = $('#core-stats');
|
| 203 |
function frame() {
|
| 204 |
requestAnimationFrame(frame);
|
| 205 |
const dt = Math.min(clock.getDelta(), .05), t = clock.elapsedTime;
|
| 206 |
-
|
|
|
|
|
|
|
|
|
|
| 207 |
if (qMode === 'AUTO' && quality === 'high') { lowStreak = fps < 40 ? lowStreak + 1 : 0; if (lowStreak >= 3) { quality = 'low'; applyQuality(); } } }
|
| 208 |
pollPad();
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
cam.th
|
| 212 |
-
cam.
|
| 213 |
-
const
|
| 214 |
-
camera.position.set(cam.r * Math.sin(cam.ph) * Math.cos(cam.th)
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
const
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
if (
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
const v = visible();
|
| 235 |
-
nodes.forEach((n, i) => { const u = n.userData; u.ph = (u.ph || 0) + (openId != null ? 0 : dt * .04); const a = u.a + u.ph; n.position.set(Math.cos(a) * u.R, u.y + Math.sin(t + i) * .3, Math.sin(a) * u.R);
|
| 236 |
-
n.rotation.z += dt * (i === sel ? 1.5 : .3); const on = v.includes(i); const s = (i === sel ? 1.35 : 1) * (on ? 1 : .6); n.scale.lerp(new THREE.Vector3(s, s, s), .15);
|
| 237 |
-
n.material.emissiveIntensity = i === sel ? .9 + Math.sin(t * 4) * .2 : on ? .32 : .08;
|
| 238 |
-
const p = u.line.geometry.attributes.position; p.setXYZ(1, n.position.x, n.position.y, n.position.z); p.needsUpdate = true; u.line.material.opacity = on ? (i === sel ? .8 : .25) : .05; });
|
| 239 |
-
streamPts.forEach((s, k) => { s.t = (s.t + dt * .35) % 1; const p = s.n.position; spPos[k * 3] = p.x * (1 - s.t); spPos[k * 3 + 1] = p.y * (1 - s.t); spPos[k * 3 + 2] = p.z * (1 - s.t); });
|
| 240 |
-
spGeo.attributes.position.needsUpdate = true;
|
| 241 |
-
// hover raycast
|
| 242 |
-
if (started && !drag && mouse.x < 5) { ray.setFromCamera(mouse, camera); const h = ray.intersectObjects(nodes, false)[0]; cv.style.cursor = h ? 'pointer' : 'grab'; if (h && h.object.userData.i !== sel) select(h.object.userData.i); }
|
| 243 |
-
if (renderer) { if (composer && quality === 'high') composer.render(); else renderer.render(scene, camera); }
|
| 244 |
-
// labels + wire
|
| 245 |
-
if (started) {
|
| 246 |
-
const placed = []; const camP = camera.position;
|
| 247 |
-
const blk = ['#hud', '#core-stats', '#mm', '#pop', '#hint', '#bmc'].map(q => $(q)).filter(e => e && !e.hidden && e.offsetParent !== null).map(e => e.getBoundingClientRect());
|
| 248 |
-
nodes.map((n, i) => ({ n, i, d: n.position.distanceTo(camP) })).sort((a, b) => a.d - b.d).forEach(({ n, i, d }, rank) => {
|
| 249 |
-
const p = screenPos(n); const l = labels[i]; if (p.z >= 1) { l.style.display = 'none'; return; } l.style.display = '';
|
| 250 |
-
const far = rank > 9 && i !== sel && i !== openId; l.classList.toggle('far', far);
|
| 251 |
-
const w = far ? 30 : l.offsetWidth || 110, h = 26; let y = p.y + 34;
|
| 252 |
-
for (let k = 0; k < 6; k++) { const hit = placed.find(r => Math.abs(r.x - p.x) < (r.w + w) / 2 + 4 && Math.abs(r.y - y) < h); if (!hit) break; y = hit.y + (y >= hit.y ? h : -h); }
|
| 253 |
-
placed.push({ x: p.x, y, w });
|
| 254 |
-
const lx0 = p.x - w / 2, lx1 = p.x + w / 2; l.classList.toggle('hid', blk.some(r => lx0 < r.right && lx1 > r.left && y - 13 < r.bottom && y + 13 > r.top)); l.style.transform = `translate(${p.x}px,${y}px) translate(-50%,-50%)`; l.style.zIndex = 100 - rank;
|
| 255 |
-
l.classList.toggle('dim', !v.includes(i)); });
|
| 256 |
-
if ((mmT += dt) > .1) { mmT = 0; drawMinimap(v); }
|
| 257 |
-
if (openId != null && !pop.hidden) { const p = screenPos(nodes[openId]); const r = pop.getBoundingClientRect(); const wl = $('#wl');
|
| 258 |
-
const tx = p.x < r.left ? r.left : r.right; wl.setAttribute('x1', p.x); wl.setAttribute('y1', p.y); wl.setAttribute('x2', tx); wl.setAttribute('y2', r.top + 14);
|
| 259 |
-
}
|
| 260 |
-
if ((statT += dt) > .5) { statT = 0; const ld = (55 + Math.sin(t * .7) * 20) | 0; stats.innerHTML = `<h4>META-ENGINE CORE</h4><dl><dt>Agenten</dt><dd>${120 + (Math.sin(t) * 8 | 0)}</dd><dt>Tokens/s</dt><dd>${(4200 + Math.random() * 900) | 0}</dd><dt>Studios</dt><dd>${STUDIOS.length - 1}+1</dd><dt>Last</dt><dd>${ld}%</dd></dl><div class="bar"><i style="width:${ld}%"></i></div><p>● SIMULATION</p>`; }
|
| 261 |
-
}
|
| 262 |
-
}
|
| 263 |
-
applyQuality();
|
| 264 |
-
window.__studius = { core: () => screenPos(core) };
|
| 265 |
-
if (gl3d) frame(); else {
|
| 266 |
-
document.body.insertAdjacentHTML('beforeend', '<div style="position:fixed;left:14px;top:60px;z-index:16;color:#faa968;font-size:11px">⚠ WebGL nicht verfügbar – 2D-Modus</div>');
|
| 267 |
-
// minimal 2D loop to keep labels in a ring
|
| 268 |
-
const tick = () => { requestAnimationFrame(tick); const t = performance.now() / 1000; nodes.forEach((n, i) => { const u = n.userData; const a = u.a + t * .04; n.position.set(Math.cos(a) * u.R, u.y, Math.sin(a) * u.R); });
|
| 269 |
-
camera.position.set(0, 18, 18); camera.lookAt(0, 0, 0); camera.updateMatrixWorld(); if (started) nodes.forEach((n, i) => { n.updateMatrixWorld(); const p = screenPos(n); labels[i].style.transform = `translate(${p.x}px,${p.y}px) translate(-50%,-50%)`; }); };
|
| 270 |
-
tick();
|
| 271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import * as THREE from './vendor/three.module.min.js';
|
| 2 |
+
import { STUDIOS, stopLoops } from './widgets.js?v=10';
|
| 3 |
+
import { icon } from './icons.js?v=10';
|
| 4 |
import { EffectComposer } from './vendor/addons/postprocessing/EffectComposer.js';
|
| 5 |
import { RenderPass } from './vendor/addons/postprocessing/RenderPass.js';
|
| 6 |
import { UnrealBloomPass } from './vendor/addons/postprocessing/UnrealBloomPass.js';
|
| 7 |
import { OutputPass } from './vendor/addons/postprocessing/OutputPass.js';
|
| 8 |
+
import { RoomEnvironment } from './vendor/addons/environments/RoomEnvironment.js';
|
| 9 |
|
| 10 |
const $ = (s) => document.querySelector(s);
|
| 11 |
const isMobile = matchMedia('(pointer:coarse)').matches || innerWidth < 700;
|
| 12 |
let quality = isMobile ? 'low' : 'high', qMode = 'AUTO';
|
| 13 |
+
const GOLD = 0xf2c94c;
|
| 14 |
+
const DESC = {
|
| 15 |
+
chat: 'Sprich mit dem Schwarm. Antworten entstehen aus vielen kleinen Agenten, die zusammenarbeiten.',
|
| 16 |
+
image: 'Bilder bearbeiten mit Farbton, Pinsel und Ebenen – schnell, direkt, ohne Umwege.',
|
| 17 |
+
videogen: 'Aus einer Idee wird ein Clip. Prompt eingeben, Engine rendert die Szene.',
|
| 18 |
+
videoedit: 'Clips auf der Timeline anordnen, schneiden und abspielen.',
|
| 19 |
+
audio: 'Wellenform bearbeiten, Bereiche auswählen und die Lautstärke formen.',
|
| 20 |
+
stems: 'Einen Song in Gesang, Drums, Bass und Rest zerlegen.',
|
| 21 |
+
music: 'Musik aus Text erzeugen – Stil wählen, generieren, anhören.',
|
| 22 |
+
auto: 'Workflows aus Knoten bauen: Trigger, Agenten, Filter und Aktionen.',
|
| 23 |
+
agent: 'Eigene Agenten mit Rolle, Werkzeugen und Gedächtnis zusammenstellen.',
|
| 24 |
+
code: 'Code schreiben und direkt im Studio ausführen.',
|
| 25 |
+
community: 'Entdecken, teilen und liken, was andere im Schwarm gebaut haben.',
|
| 26 |
+
sandbox: 'Eine isolierte Shell zum Experimentieren.',
|
| 27 |
+
design: 'Formen, Layouts und Ideen auf einem gemeinsamen Board.',
|
| 28 |
+
canvas: 'Freihand zeichnen – Skizzen, Notizen, Konzepte.',
|
| 29 |
+
merge: 'Neue Module an die Meta-Engine andocken und den Schwarm erweitern.',
|
| 30 |
+
};
|
| 31 |
|
| 32 |
/* ---------- sound (off by default) ---------- */
|
| 33 |
let ac = null, soundOn = false;
|
| 34 |
+
function beep(f = 440, d = .06, type = 'sine', v = .035) {
|
| 35 |
if (!soundOn) return; try {
|
| 36 |
ac = ac || new (window.AudioContext || window.webkitAudioContext)();
|
| 37 |
const o = ac.createOscillator(), g = ac.createGain(); o.type = type; o.frequency.value = f;
|
|
|
|
| 39 |
o.connect(g).connect(ac.destination); o.start(); o.stop(ac.currentTime + d);
|
| 40 |
} catch (e) {}
|
| 41 |
}
|
| 42 |
+
function toggleSound() { soundOn = !soundOn; syncSettings(); beep(880, .1); }
|
|
|
|
| 43 |
|
| 44 |
+
/* ---------- three ---------- */
|
| 45 |
let renderer = null, gl3d = true, composer = null, bloom = null;
|
| 46 |
try {
|
| 47 |
+
renderer = new THREE.WebGLRenderer({ canvas: $('#gl'), antialias: true, powerPreference: 'high-performance' });
|
| 48 |
+
renderer.toneMapping = THREE.ACESFilmicToneMapping; renderer.toneMappingExposure = 1.0;
|
| 49 |
+
renderer.shadowMap.enabled = true; renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
| 50 |
+
} catch (e) { gl3d = false; renderer = null; document.body.classList.add('no3d'); console.warn('WebGL unavailable, 2D fallback'); }
|
| 51 |
+
if (renderer) { try { const g = renderer.getContext(), ext = g.getExtension('WEBGL_debug_renderer_info'); const name = ext ? g.getParameter(ext.UNMASKED_RENDERER_WEBGL) : '';
|
| 52 |
+
if (/swiftshader|llvmpipe|software|basic render/i.test(name)) { quality = 'low'; window.__softGL = name; } } catch (e) {} }
|
| 53 |
+
const scene = new THREE.Scene(); scene.background = new THREE.Color(0x050505); scene.fog = new THREE.Fog(0x050505, 14, 30);
|
| 54 |
+
const camera = new THREE.PerspectiveCamera(40, innerWidth / innerHeight, .1, 200);
|
| 55 |
+
if (renderer) {
|
| 56 |
+
const pm = new THREE.PMREMGenerator(renderer); scene.environment = pm.fromScene(new RoomEnvironment(), .04).texture; scene.environmentIntensity = .55;
|
| 57 |
+
try { composer = new EffectComposer(renderer); composer.addPass(new RenderPass(scene, camera));
|
| 58 |
+
bloom = new UnrealBloomPass(new THREE.Vector2(innerWidth, innerHeight), .45, .6, .78); composer.addPass(bloom); composer.addPass(new OutputPass()); } catch (e) { composer = null; }
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
+
const key = new THREE.DirectionalLight(0xfff0d0, 2.4); key.position.set(6, 10, 6); key.castShadow = true; key.shadow.mapSize.set(1024, 1024);
|
| 61 |
+
key.shadow.camera.left = key.shadow.camera.bottom = -8; key.shadow.camera.right = key.shadow.camera.top = 8; key.shadow.radius = 6; key.shadow.bias = -.0005; scene.add(key);
|
| 62 |
+
const coreLight = new THREE.PointLight(0xffc860, 30, 14, 1.8); scene.add(coreLight);
|
| 63 |
+
scene.add(new THREE.HemisphereLight(0x3a3020, 0x050505, .6));
|
| 64 |
+
|
| 65 |
+
const orb = new THREE.Group(); scene.add(orb);
|
| 66 |
+
// flowing energy core
|
| 67 |
+
const energyMat = new THREE.ShaderMaterial({
|
| 68 |
+
uniforms: { t: { value: 0 }, pulse: { value: 0 }, gain: { value: 1 } },
|
| 69 |
+
vertexShader: `varying vec3 vP; varying vec3 vN; varying vec3 vV; uniform float t;
|
| 70 |
+
void main(){ vP=position; vN=normalize(normalMatrix*normal); vec4 mv=modelViewMatrix*vec4(position,1.); vV=normalize(-mv.xyz); gl_Position=projectionMatrix*mv; }`,
|
| 71 |
+
fragmentShader: `varying vec3 vP; varying vec3 vN; varying vec3 vV; uniform float t; uniform float pulse; uniform float gain;
|
| 72 |
+
float h(vec3 p){return fract(sin(dot(p,vec3(127.1,311.7,74.7)))*43758.5453);}
|
| 73 |
+
float n(vec3 p){vec3 i=floor(p),f=fract(p);f=f*f*(3.-2.*f);
|
| 74 |
+
return mix(mix(mix(h(i),h(i+vec3(1,0,0)),f.x),mix(h(i+vec3(0,1,0)),h(i+vec3(1,1,0)),f.x),f.y),mix(mix(h(i+vec3(0,0,1)),h(i+vec3(1,0,1)),f.x),mix(h(i+vec3(0,1,1)),h(i+vec3(1,1,1)),f.x),f.y),f.z);}
|
| 75 |
+
float fbm(vec3 p){float a=.5,s=0.;for(int i=0;i<5;i++){s+=a*n(p);p*=2.03;a*=.5;}return s;}
|
| 76 |
+
void main(){ vec3 p=normalize(vP)*2.2; float q=fbm(p+vec3(0.,t*.25,t*.15)); float r=fbm(p*1.7+q*2.2-vec3(t*.2,0.,0.));
|
| 77 |
+
float veins=smoothstep(.47,.53,r)*(1.-smoothstep(.53,.6,r));
|
| 78 |
+
float fr=pow(1.-max(dot(vN,vV),0.),2.2);
|
| 79 |
+
vec3 deep=vec3(.035,.018,.004), mid=vec3(.42,.24,.05), gold=vec3(1.,.74,.26), hot=vec3(1.,.9,.62);
|
| 80 |
+
float body=smoothstep(.25,.85,q);
|
| 81 |
+
vec3 c=mix(deep,mid,body*.8)+gold*veins*(1.1+pulse)+hot*pow(veins,3.)*.5+gold*fr*1.1;
|
| 82 |
+
gl_FragColor=vec4(c*(1.+pulse*.6)*gain,1.); }`,
|
| 83 |
+
});
|
| 84 |
+
const energy = new THREE.Mesh(new THREE.SphereGeometry(1.25, 96, 96), energyMat); orb.add(energy);
|
| 85 |
+
const glassMat = new THREE.MeshPhysicalMaterial({ color: 0xffffff, metalness: 0, roughness: .04, transmission: 1, thickness: 1.2, ior: 1.45, clearcoat: 1, clearcoatRoughness: .05,
|
| 86 |
+
iridescence: .35, iridescenceIOR: 1.3, attenuationColor: new THREE.Color(0xffe2a0), attenuationDistance: 6, specularIntensity: 1, envMapIntensity: 1.4, transparent: true });
|
| 87 |
+
const glass = new THREE.Mesh(new THREE.SphereGeometry(1.85, 128, 128), glassMat); orb.add(glass);
|
| 88 |
+
const goldMat = new THREE.MeshPhysicalMaterial({ color: 0xe8b84a, metalness: 1, roughness: .18, clearcoat: .6, clearcoatRoughness: .1, envMapIntensity: 1.6 });
|
| 89 |
+
const rings = [[2.55, .028, 1.2, 0, .12], [2.95, .016, 1.75, .5, -.08], [3.4, .04, 1.45, -.35, .05]].map(([R, tube, rx, ry, sp]) => {
|
| 90 |
+
const m = new THREE.Mesh(new THREE.TorusGeometry(R, tube, 32, 300), goldMat); m.rotation.set(rx, ry, 0); m.userData.sp = sp; m.castShadow = true; orb.add(m); return m; });
|
| 91 |
+
// fine tick ring (flat)
|
| 92 |
+
{ const g = new THREE.RingGeometry(4.1, 4.13, 256); const m = new THREE.Mesh(g, new THREE.MeshBasicMaterial({ color: GOLD, transparent: true, opacity: .25, side: THREE.DoubleSide })); m.rotation.x = Math.PI / 2 + .32; m.rotation.y = .2; orb.add(m); }
|
| 93 |
+
// studio satellites
|
| 94 |
+
const satGeo = new THREE.SphereGeometry(.16, 48, 48);
|
| 95 |
+
const sats = STUDIOS.map((s, i) => {
|
| 96 |
+
const m = new THREE.Mesh(satGeo, new THREE.MeshPhysicalMaterial({ color: s.id === 'merge' ? 0xf85525 : 0xf2c94c, metalness: .9, roughness: .15, clearcoat: 1, emissive: s.id === 'merge' ? 0xf85525 : 0xf2c94c, emissiveIntensity: .05 }));
|
| 97 |
+
m.castShadow = true; m.userData = { a: i / STUDIOS.length * Math.PI * 2, R: 4.1, y: 0 }; orb.add(m); return m; });
|
| 98 |
+
// floor (soft shadow catcher + faint reflection)
|
| 99 |
+
const floor = new THREE.Mesh(new THREE.CircleGeometry(30, 96), new THREE.MeshStandardMaterial({ color: 0x050505, metalness: .3, roughness: .6, envMapIntensity: .12 })); floor.rotation.x = -Math.PI / 2; floor.position.y = -3.4; floor.receiveShadow = true; scene.add(floor);
|
| 100 |
+
const shadowCatcher = floor;
|
| 101 |
+
// fine particles
|
| 102 |
+
const PN = isMobile ? 700 : 1800; const pp = new Float32Array(PN * 3), pv = new Float32Array(PN * 3), pseed = new Float32Array(PN);
|
| 103 |
+
for (let i = 0; i < PN; i++) { const r = 3 + Math.random() * 14, a = Math.random() * 6.283, y = (Math.random() - .5) * 8; pp.set([Math.cos(a) * r, y, Math.sin(a) * r], i * 3); pseed[i] = Math.random(); }
|
| 104 |
+
const pGeo = new THREE.BufferGeometry(); pGeo.setAttribute('position', new THREE.BufferAttribute(pp, 3));
|
| 105 |
+
const dotTex = (() => { const c = document.createElement('canvas'); c.width = c.height = 64; const x = c.getContext('2d'); const g = x.createRadialGradient(32, 32, 0, 32, 32, 32); g.addColorStop(0, 'rgba(255,240,200,1)'); g.addColorStop(.25, 'rgba(242,201,76,.6)'); g.addColorStop(1, 'rgba(0,0,0,0)'); x.fillStyle = g; x.fillRect(0, 0, 64, 64); const t = new THREE.CanvasTexture(c); t.colorSpace = THREE.SRGBColorSpace; return t; })();
|
| 106 |
+
const parts = new THREE.Points(pGeo, new THREE.PointsMaterial({ size: .07, map: dotTex, transparent: true, opacity: .7, depthWrite: false, blending: THREE.AdditiveBlending })); scene.add(parts);
|
| 107 |
+
let bursting = 0; function burst() { for (let i = 0; i < PN; i++) { const v = new THREE.Vector3().randomDirection().multiplyScalar(.04 + Math.random() * .12); pv.set([v.x, v.y, v.z], i * 3); } bursting = 1; }
|
| 108 |
|
| 109 |
+
function applyQuality() {
|
| 110 |
+
if (!renderer) { $('#q').textContent = 'AUTO · 2D'; return; }
|
| 111 |
+
const hi = quality === 'high';
|
| 112 |
+
renderer.setPixelRatio(hi ? Math.min(devicePixelRatio, 2) : Math.min(devicePixelRatio, 1)); renderer.setSize(innerWidth, innerHeight, false);
|
| 113 |
+
if (composer) { composer.setPixelRatio(renderer.getPixelRatio()); composer.setSize(innerWidth, innerHeight); }
|
| 114 |
+
renderer.shadowMap.enabled = hi; key.castShadow = hi;
|
| 115 |
+
glassMat.transmission = hi ? 1 : 0; glassMat.opacity = hi ? 1 : .07; glassMat.iridescence = hi ? .35 : 0; glassMat.needsUpdate = true; energyMat.uniforms.gain.value = hi ? .5 : 1;
|
| 116 |
+
pGeo.setDrawRange(0, hi ? PN : PN / 2 | 0);
|
| 117 |
+
$('#q').textContent = (qMode === 'AUTO' ? 'AUTO · ' : '') + (hi ? 'HIGH' : 'LOW'); syncSettings();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
+
/* ---------- UI ---------- */
|
| 121 |
const CATS = ['Alle', 'Text', 'Bild', 'Video', 'Audio', 'Automation', 'Code', 'Community', 'Design'];
|
| 122 |
+
const PINS = ['merge', 'chat', 'auto', 'code', 'community'];
|
| 123 |
+
let cat = 'Alle', zone = 'tiles', fi = 0, ci = 0, pi = 0, openId = null, sel = 0, guideOn = false, gi = 0;
|
| 124 |
+
const catsEl = $('#cats'), tilesEl = $('#tiles'), pinsEl = $('#pins');
|
| 125 |
+
CATS.forEach((c, k) => { const b = document.createElement('button'); b.type = 'button'; b.textContent = c; b.dataset.c = c; b.onclick = () => { ci = k; setCat(c); }; catsEl.append(b); });
|
| 126 |
+
const visible = () => STUDIOS.map((s, i) => i).filter(i => cat === 'Alle' || STUDIOS[i].cat === cat || STUDIOS[i].id === 'merge');
|
| 127 |
+
function tileHTML(i, small) { const s = STUDIOS[i]; return `<span class="ti">${icon(s.id)}</span><span class="tn">${s.name}${small ? '' : `<span class="tc">${s.cat === '+' ? 'Modul' : s.cat} · ${s.like}</span>`}</span>`; }
|
| 128 |
+
function mkTile(i, small) { const b = document.createElement('button'); b.type = 'button'; b.className = 'tile'; b.dataset.id = STUDIOS[i].id; b.dataset.i = i; b.setAttribute('role', 'option');
|
| 129 |
+
b.innerHTML = tileHTML(i, small); b.onmouseenter = () => focusStudio(i, small ? 'pins' : 'tiles', false); b.onfocus = () => focusStudio(i, small ? 'pins' : 'tiles', false);
|
| 130 |
+
b.onclick = () => { focusStudio(i, small ? 'pins' : 'tiles', false); open(i); }; return b; }
|
| 131 |
+
PINS.forEach(id => pinsEl.append(mkTile(STUDIOS.findIndex(s => s.id === id), true)));
|
| 132 |
+
function setCat(c) {
|
| 133 |
+
cat = c; [...catsEl.children].forEach(b => b.classList.toggle('on', b.dataset.c === c)); beep(520, .04);
|
| 134 |
+
tilesEl.innerHTML = ''; visible().forEach((i, k) => { const t = mkTile(i); t.classList.add('in'); t.style.animationDelay = k * 35 + 'ms'; tilesEl.append(t); });
|
| 135 |
+
$('#rowTitle').innerHTML = (c === 'Alle' ? 'Alle Studios' : c) + `<span>${visible().length}</span>`;
|
| 136 |
+
fi = 0; focusStudio(visible()[0], zone === 'cats' ? 'cats' : 'tiles', false);
|
| 137 |
+
}
|
| 138 |
+
function focusStudio(i, z = zone, scroll = true) {
|
| 139 |
+
if (i == null) return; zone = z; const changed = sel !== i; sel = i; const s = STUDIOS[i];
|
| 140 |
+
if (z === 'tiles') fi = Math.max(0, visible().indexOf(i)); if (z === 'pins') pi = Math.max(0, PINS.indexOf(s.id));
|
| 141 |
+
document.querySelectorAll('.tile').forEach(t => t.classList.toggle('f', (z === 'tiles' && t.parentNode === tilesEl || z === 'pins' && t.parentNode === pinsEl) && +t.dataset.i === i));
|
| 142 |
+
[...catsEl.children].forEach((b, k) => b.classList.toggle('kf', z === 'cats' && k === ci));
|
| 143 |
+
if (scroll) { const t = (z === 'pins' ? pinsEl : tilesEl).querySelector(`.tile[data-i="${i}"]`); t?.scrollIntoView({ block: 'nearest', inline: 'nearest', behavior: 'smooth' }); }
|
| 144 |
+
if (changed) { const h = $('#hero'); h.classList.remove('swap'); void h.offsetWidth; h.classList.add('swap'); beep(660, .03); }
|
| 145 |
+
$('#hCat').textContent = s.cat === '+' ? 'Modul' : s.cat + ' Studio'; $('#hName').textContent = s.name; $('#hDesc').textContent = DESC[s.id] || s.like;
|
| 146 |
+
$('#hMeta').textContent = `${s.like} · Studio ${String(i + 1).padStart(2, '0')}/${STUDIOS.length}`;
|
| 147 |
+
camT.th = sats[i].userData.a + .9;
|
| 148 |
+
}
|
| 149 |
+
$('#hOpen').onclick = () => open(sel);
|
| 150 |
+
const pop = $('#pop'), scrim = $('#scrim');
|
| 151 |
function open(i) {
|
| 152 |
+
if (i == null) return; stopLoops(); openId = i; const s = STUDIOS[i]; beep(990, .08, 'triangle');
|
| 153 |
+
pop.innerHTML = `<div class="ph"><span class="pi">${icon(s.id)}</span><span class="pt"><b>${s.name}</b><small>${s.cat === '+' ? 'Modul' : s.cat} · ${s.like}</small></span><button type="button" aria-label="Schließen (B)">${icon('close')}</button></div><div class="pb"></div><div class="pf"><span>${icon('spark')} Simulation · keine echten Backends</span><span><b class="btnB">B</b> Zurück</span></div>`;
|
| 154 |
+
pop.hidden = false; scrim.hidden = false; pop.classList.remove('outA', 'in'); void pop.offsetWidth; pop.classList.add('in'); requestAnimationFrame(() => scrim.classList.add('on'));
|
| 155 |
+
pop.querySelector('.ph button').onclick = close; s.build(pop.querySelector('.pb'));
|
| 156 |
+
sats.forEach((m, k) => m.material.emissiveIntensity = k === i ? .8 : .05);
|
| 157 |
}
|
| 158 |
+
function close() {
|
| 159 |
+
if (openId == null) return; stopLoops(); openId = null; beep(300, .05); pop.classList.add('outA'); scrim.classList.remove('on');
|
| 160 |
+
setTimeout(() => { if (openId == null) { pop.hidden = true; if (!guideOn) scrim.hidden = true; } }, 280);
|
|
|
|
|
|
|
|
|
|
| 161 |
}
|
| 162 |
+
scrim.onclick = () => { if (guideOn) toggleGuide(false); else close(); };
|
| 163 |
+
window.addEventListener('studius-merge', () => { burst(); toast('Neues Modul angedockt'); });
|
| 164 |
+
function toast(msg) { const t = $('#toast'); t.innerHTML = `<img src="assets/einswarm-mascot.webp" alt="">${msg}`; t.hidden = false; t.style.animation = 'none'; void t.offsetWidth; t.style.animation = ''; clearTimeout(toast.h); toast.h = setTimeout(() => t.hidden = true, 4000); }
|
| 165 |
+
// guide
|
| 166 |
+
const gEl = $('#guide');
|
| 167 |
+
CATS.forEach((c, k) => { const b = document.createElement('button'); b.type = 'button'; b.className = 'gi'; b.innerHTML = `${icon(k ? (STUDIOS.find(s => s.cat === c) || STUDIOS[0]).id : 'home')}${c === 'Alle' ? 'Startseite' : c}<em>${k ? STUDIOS.filter(s => s.cat === c).length : STUDIOS.length}</em>`;
|
| 168 |
+
b.onclick = () => { ci = k; setCat(c); toggleGuide(false); }; $('#gcats').append(b); });
|
| 169 |
+
$('#notes').innerHTML = [['spark', '<b>14 Studios + Merge</b> sind bereit'], ['gear', '<b>Meta-Engine</b> läuft im Simulationsmodus'], ['bell', '<b>Tipp:</b> G öffnet den Guide, Tab wechselt Kategorien']].map(([i, t]) => `<div class="note">${icon(i)}<span>${t}</span></div>`).join('');
|
| 170 |
+
$('#gQ').onclick = () => cycleQ(); $('#gS').onclick = () => toggleSound();
|
| 171 |
+
function syncSettings() { $('#gQ').innerHTML = `${icon('gear')}Grafikqualität<em>${$('#q').textContent}</em>`; $('#gS').innerHTML = `${icon(soundOn ? 'sound' : 'mute')}Sound<em>${soundOn ? 'An' : 'Aus'}</em>`; $('#snd').innerHTML = icon(soundOn ? 'sound' : 'mute'); }
|
| 172 |
+
function guideItems() { return [...gEl.querySelectorAll('.gi')]; }
|
| 173 |
+
function toggleGuide(on = !guideOn) {
|
| 174 |
+
guideOn = on; if (on) { gEl.hidden = false; scrim.hidden = false; requestAnimationFrame(() => { gEl.classList.add('on'); scrim.classList.add('on'); }); gi = 0; markGuide(); beep(740, .05); }
|
| 175 |
+
else { gEl.classList.remove('on'); if (openId == null) scrim.classList.remove('on'); setTimeout(() => { if (!guideOn) { gEl.hidden = true; if (openId == null) scrim.hidden = true; } }, 500); }
|
| 176 |
+
}
|
| 177 |
+
function markGuide() { guideItems().forEach((b, k) => b.classList.toggle('kf', k === gi)); guideItems()[gi]?.scrollIntoView({ block: 'nearest' }); }
|
| 178 |
+
$('#guideBtn').onclick = () => toggleGuide(); $('#bell').onclick = () => toggleGuide(true); $('#bell').innerHTML = icon('bell') + '<span class="dot"></span>';
|
| 179 |
+
$('#snd').onclick = toggleSound;
|
| 180 |
+
function cycleQ() { qMode = qMode === 'AUTO' ? 'HIGH' : qMode === 'HIGH' ? 'LOW' : 'AUTO'; if (qMode !== 'AUTO') quality = qMode.toLowerCase(); applyQuality(); }
|
| 181 |
+
$('#q').onclick = cycleQ;
|
| 182 |
+
const tick = () => { const d = new Date(); $('#clock').textContent = d.toLocaleTimeString('de-DE', { hour: '2-digit', minute: '2-digit' }); }; tick(); setInterval(tick, 10000);
|
| 183 |
|
| 184 |
+
/* ---------- input (controller-first) ---------- */
|
| 185 |
+
let started = false;
|
| 186 |
+
function nav(dir) {
|
| 187 |
+
if (guideOn) { const n = guideItems().length; if (dir === 'up') gi = (gi - 1 + n) % n; else if (dir === 'down') gi = (gi + 1) % n; markGuide(); return; }
|
| 188 |
+
if (openId != null) return;
|
| 189 |
+
const v = visible();
|
| 190 |
+
if (zone === 'cats') { if (dir === 'left' || dir === 'right') { ci = (ci + (dir === 'right' ? 1 : CATS.length - 1)) % CATS.length; setCat(CATS[ci]); focusStudio(sel, 'cats'); } else if (dir === 'down') focusStudio(v[fi] ?? v[0], 'tiles'); }
|
| 191 |
+
else if (zone === 'tiles') { if (dir === 'left' || dir === 'right') { fi = Math.max(0, Math.min(v.length - 1, fi + (dir === 'right' ? 1 : -1))); focusStudio(v[fi], 'tiles'); }
|
| 192 |
+
else if (dir === 'up') focusStudio(sel, 'cats'); else if (dir === 'down' && innerWidth >= 700) focusStudio(STUDIOS.findIndex(s => s.id === PINS[pi]), 'pins'); }
|
| 193 |
+
else if (zone === 'pins') { if (dir === 'left' || dir === 'right') { pi = Math.max(0, Math.min(PINS.length - 1, pi + (dir === 'right' ? 1 : -1))); focusStudio(STUDIOS.findIndex(s => s.id === PINS[pi]), 'pins'); }
|
| 194 |
+
else if (dir === 'up') focusStudio(v[fi] ?? v[0], 'tiles'); }
|
| 195 |
+
}
|
| 196 |
+
function accept() { if (guideOn) { guideItems()[gi]?.click(); return; } if (openId != null) return; if (zone === 'cats') { focusStudio(visible()[0], 'tiles'); return; } open(sel); }
|
| 197 |
+
function back() { if (guideOn) toggleGuide(false); else if (openId != null) close(); else if (zone !== 'tiles') focusStudio(sel, 'tiles'); }
|
| 198 |
addEventListener('keydown', e => {
|
| 199 |
+
if (!started) { if (introReady) start(); return; }
|
| 200 |
+
if (e.target.matches('input,textarea')) { if (e.key === 'Escape') { e.target.blur(); back(); } return; }
|
| 201 |
+
const k = e.key;
|
| 202 |
+
if (['ArrowRight', 'd', 'D'].includes(k)) { e.preventDefault(); nav('right'); }
|
| 203 |
+
else if (['ArrowLeft', 'a', 'A'].includes(k)) { e.preventDefault(); nav('left'); }
|
| 204 |
+
else if (['ArrowUp', 'w', 'W'].includes(k)) { e.preventDefault(); nav('up'); }
|
| 205 |
+
else if (['ArrowDown', 's', 'S'].includes(k)) { e.preventDefault(); nav('down'); }
|
| 206 |
+
else if (k === 'Enter' || k === ' ') { e.preventDefault(); accept(); }
|
| 207 |
+
else if (k === 'Escape' || k === 'Backspace') { e.preventDefault(); back(); }
|
| 208 |
+
else if (k === 'Tab') { e.preventDefault(); if (openId == null && !guideOn) { ci = (ci + (e.shiftKey ? CATS.length - 1 : 1)) % CATS.length; setCat(CATS[ci]); } }
|
| 209 |
+
else if (k === 'g' || k === 'G') toggleGuide();
|
| 210 |
+
else if (k === 'q' || k === 'Q') cycleQ();
|
| 211 |
+
else if (k === 'm' || k === 'M') toggleSound();
|
| 212 |
});
|
| 213 |
+
const mouse = { x: 0, y: 0 };
|
| 214 |
+
addEventListener('pointermove', e => { mouse.x = e.clientX / innerWidth * 2 - 1; mouse.y = e.clientY / innerHeight * 2 - 1; });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
addEventListener('resize', () => { camera.aspect = innerWidth / innerHeight; camera.updateProjectionMatrix(); applyQuality(); });
|
| 216 |
+
let gpCool = 0, gpPrev = [];
|
| 217 |
+
function pollPad() {
|
| 218 |
+
const p = navigator.getGamepads ? [...navigator.getGamepads()].find(Boolean) : null; if (!p) return;
|
| 219 |
+
const b = p.buttons.map(x => x.pressed), edge = (k) => b[k] && !gpPrev[k]; gpPrev = b;
|
| 220 |
+
if (!started) { if (b.some(Boolean) && introReady) start(); return; }
|
| 221 |
+
if (edge(0)) accept(); if (edge(1)) back(); if (edge(8) || edge(9) || edge(16)) toggleGuide(); if (edge(4)) { ci = (ci + CATS.length - 1) % CATS.length; setCat(CATS[ci]); } if (edge(5)) { ci = (ci + 1) % CATS.length; setCat(CATS[ci]); }
|
| 222 |
+
if (gpCool-- > 0) return; const x = p.axes[0] || 0, y = p.axes[1] || 0;
|
| 223 |
+
if (x > .5 || b[15]) { nav('right'); gpCool = 10; } else if (x < -.5 || b[14]) { nav('left'); gpCool = 10; } else if (y > .5 || b[13]) { nav('down'); gpCool = 12; } else if (y < -.5 || b[12]) { nav('up'); gpCool = 12; }
|
| 224 |
}
|
| 225 |
|
| 226 |
+
/* ---------- intro: console power-on ---------- */
|
| 227 |
+
let introReady = true;
|
| 228 |
+
const intro = $('#intro'); const stage = (n, ms) => setTimeout(() => !started && intro.classList.add('s' + n), ms);
|
| 229 |
+
stage(1, 120); stage(2, 1100); stage(3, 2300); stage(4, 3300); stage(5, 4600);
|
| 230 |
+
setTimeout(() => { if (!started) beep(196, .8, 'sine', .04); }, 1100);
|
| 231 |
+
const autoT = setTimeout(() => start(), 7800);
|
| 232 |
+
intro.addEventListener('pointermove', e => { const x = e.clientX / innerWidth - .5, y = e.clientY / innerHeight - .5; $('#reveal').style.transform = `translate(${x * -18}px,${y * -14}px) rotateY(${x * 6}deg)`; });
|
| 233 |
+
$('#skip').onclick = (e) => { e.stopPropagation(); start(); };
|
| 234 |
+
intro.addEventListener('pointerdown', (e) => { if (e.target.id !== 'skip') start(); });
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
function start() {
|
| 236 |
+
if (started) return; started = true; clearTimeout(autoT); beep(110, .6, 'sine', .06); burst();
|
| 237 |
+
intro.classList.add('out'); setTimeout(() => intro.remove(), 1100);
|
| 238 |
+
const app = $('#app'); app.hidden = false; requestAnimationFrame(() => requestAnimationFrame(() => app.classList.add('on')));
|
| 239 |
+
cam.r = 26; whoosh = 1; ci = 0; setCat('Alle'); focusStudio(visible()[0], 'tiles', false);
|
| 240 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 241 |
|
| 242 |
/* ---------- loop ---------- */
|
| 243 |
+
const cam = { r: 34, th: .6, ph: 1.28 }, camT = { r: 11.5, th: .6, ph: 1.32 }; let whoosh = 0;
|
| 244 |
+
const clock = new THREE.Clock(); let frames = 0, fpsT = 0, lowStreak = 0, statT = 0;
|
| 245 |
+
const engine = $('#engine'); const tmpV = new THREE.Vector3();
|
|
|
|
|
|
|
|
|
|
| 246 |
function frame() {
|
| 247 |
requestAnimationFrame(frame);
|
| 248 |
const dt = Math.min(clock.getDelta(), .05), t = clock.elapsedTime;
|
| 249 |
+
const rawDt = clock.elapsedTime - (frame.last ?? clock.elapsedTime); frame.last = clock.elapsedTime;
|
| 250 |
+
if (qMode === 'AUTO' && quality === 'high' && rawDt > 0) { frame.ema = frame.ema == null ? rawDt : frame.ema * .85 + rawDt * .15; frame.n = (frame.n || 0) + 1;
|
| 251 |
+
if (frame.n > 6 && frame.ema > .045) { quality = 'low'; applyQuality(); } }
|
| 252 |
+
frames++; fpsT += dt; if (fpsT > 1) { const fps = Math.round(frames / fpsT); frames = 0; fpsT = 0; window.__fps = fps;
|
| 253 |
if (qMode === 'AUTO' && quality === 'high') { lowStreak = fps < 40 ? lowStreak + 1 : 0; if (lowStreak >= 3) { quality = 'low'; applyQuality(); } } }
|
| 254 |
pollPad();
|
| 255 |
+
const mob = innerWidth < 700, kE = 1 - Math.exp(-dt * 2.2), kR = 1 - Math.exp(-dt * (whoosh > 0 ? 2.8 : started ? 1.6 : .5));
|
| 256 |
+
if (!started) camT.th += dt * .12; else camT.th += dt * .015;
|
| 257 |
+
let d = camT.th - cam.th; d = Math.atan2(Math.sin(d), Math.cos(d)); cam.th += d * kE; cam.ph += (camT.ph - cam.ph) * kE;
|
| 258 |
+
cam.r += ((started ? (mob ? 15 : camT.r) : 18) - cam.r) * kR; whoosh = Math.max(0, whoosh - dt * .8);
|
| 259 |
+
const px = mouse.x * .35, py = mouse.y * .25;
|
| 260 |
+
camera.position.set(cam.r * Math.sin(cam.ph) * Math.cos(cam.th), cam.r * Math.cos(cam.ph) + 1.2 + py, cam.r * Math.sin(cam.ph) * Math.sin(cam.th));
|
| 261 |
+
// frame the orb: right side on desktop, upper area on mobile (UI lives left/bottom)
|
| 262 |
+
const rx = Math.sin(cam.th), rz = -Math.cos(cam.th); const off = started ? (mob ? 0 : -cam.r * .2 * Math.min(camera.aspect, 2) * .55) : 0;
|
| 263 |
+
camera.lookAt(rx * (off + px), started && mob ? -2.6 : 0, rz * (off + px));
|
| 264 |
+
// orb animation
|
| 265 |
+
const pulse = Math.max(0, Math.sin(t * 1.6)) ** 6 * .6 + bursting * 1.5;
|
| 266 |
+
energyMat.uniforms.t.value = t; energyMat.uniforms.pulse.value = pulse; energy.rotation.y += dt * .1;
|
| 267 |
+
glass.rotation.y -= dt * .05; coreLight.intensity = 22 + pulse * 30;
|
| 268 |
+
rings.forEach((r, k) => { r.rotation.z += dt * r.userData.sp; r.rotation.x += Math.sin(t * .3 + k) * dt * .03; });
|
| 269 |
+
orb.position.y = Math.sin(t * .6) * .12;
|
| 270 |
+
sats.forEach((m, i) => { const u = m.userData; const a = u.a + t * .05; m.position.set(Math.cos(a) * u.R, Math.sin(a * 2 + i) * .25, Math.sin(a) * u.R);
|
| 271 |
+
const s = i === sel ? 1.5 + Math.sin(t * 4) * .06 : 1; m.scale.setScalar(m.scale.x + (s - m.scale.x) * .12); if (openId == null) m.material.emissiveIntensity = i === sel ? .55 : .05; });
|
| 272 |
+
// particles drift (fine), burst outward then settle
|
| 273 |
+
const pa = pGeo.attributes.position.array;
|
| 274 |
+
if (bursting > 0) { for (let i = 0; i < PN * 3; i++) { pa[i] += pv[i]; pv[i] *= .97; } bursting = Math.max(0, bursting - dt * .5); }
|
| 275 |
+
for (let i = 0; i < PN; i++) pa[i * 3 + 1] += Math.sin(t * .5 + pseed[i] * 20) * .0015;
|
| 276 |
+
pGeo.attributes.position.needsUpdate = true; parts.rotation.y += dt * .01;
|
| 277 |
+
if (!started && !intro.classList.contains('s4')) return; // intro is opaque: save GPU until the reveal
|
| 278 |
+
if (composer && quality === 'high') composer.render(); else renderer.render(scene, camera);
|
| 279 |
+
if (started && (statT += dt) > 1) { statT = 0; updEngine(t); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
}
|
| 281 |
+
function updEngine(t) { const ld = (55 + Math.sin(t * .4) * 20) | 0;
|
| 282 |
+
engine.innerHTML = `<h4>Meta-Engine <i>● Online</i></h4><dl><dt>Agenten aktiv</dt><dd>${120 + (Math.sin(t) * 8 | 0)}</dd><dt>Tokens / s</dt><dd>${(4200 + Math.random() * 900) | 0}</dd><dt>Studios</dt><dd>${STUDIOS.length - 1} + 1</dd><dt>Auslastung</dt><dd>${ld}%</dd></dl><div class="bar"><i style="width:${ld}%"></i></div>`; }
|
| 283 |
+
applyQuality(); syncSettings(); updEngine(0);
|
| 284 |
+
window.__studius = { open, close, visible, get sel() { return sel; } };
|
| 285 |
+
if (gl3d) frame(); else { const loop2 = () => { requestAnimationFrame(loop2); pollPad(); }; loop2(); }
|
fonts/outfit-latin-wght.woff2
ADDED
|
Binary file (32.3 kB). View file
|
|
|
icons.js
CHANGED
|
@@ -17,6 +17,10 @@ const P = {
|
|
| 17 |
merge:'<path d="M6 3v6a6 6 0 006 6h0a6 6 0 006-6V3"/><path d="M12 15v6M9 18l3 3 3-3"/>',
|
| 18 |
sound:'<path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 9a4 4 0 010 6M18.5 6.5a8 8 0 010 11"/>',
|
| 19 |
mute:'<path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 9l5 6M21 9l-5 6"/>',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
close:'<path d="M6 6l12 12M18 6L6 18"/>',
|
| 21 |
};
|
| 22 |
export const icon = (id, cls = 'ic') => `<svg class="${cls}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${P[id] || P.merge}</svg>`;
|
|
|
|
| 17 |
merge:'<path d="M6 3v6a6 6 0 006 6h0a6 6 0 006-6V3"/><path d="M12 15v6M9 18l3 3 3-3"/>',
|
| 18 |
sound:'<path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 9a4 4 0 010 6M18.5 6.5a8 8 0 010 11"/>',
|
| 19 |
mute:'<path d="M4 9h4l5-4v14l-5-4H4z"/><path d="M16 9l5 6M21 9l-5 6"/>',
|
| 20 |
+
bell:'<path d="M6 16V11a6 6 0 0112 0v5l2 2H4z"/><path d="M10 20a2 2 0 004 0"/>',
|
| 21 |
+
home:'<path d="M3 11l9-7 9 7v9H3z"/><path d="M9 20v-6h6v6"/>',
|
| 22 |
+
gear:'<circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1"/>',
|
| 23 |
+
spark:'<path d="M12 3l2 6 6 2-6 2-2 6-2-6-6-2 6-2z"/>',
|
| 24 |
close:'<path d="M6 6l12 12M18 6L6 18"/>',
|
| 25 |
};
|
| 26 |
export const icon = (id, cls = 'ic') => `<svg class="${cls}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${P[id] || P.merge}</svg>`;
|
index.html
CHANGED
|
@@ -5,47 +5,90 @@
|
|
| 5 |
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
| 6 |
<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Expires" content="0">
|
| 7 |
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
|
|
|
| 8 |
<title>STUDIUS · DAS Studio — Einswarm</title>
|
| 9 |
<link rel="icon" href="assets/einswarm-mascot.webp">
|
| 10 |
-
<link rel="
|
|
|
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
<canvas id="gl"></canvas>
|
| 14 |
-
<div id="
|
|
|
|
| 15 |
|
| 16 |
-
<!-- INTRO -->
|
| 17 |
-
<section id="intro">
|
| 18 |
-
<
|
|
|
|
| 19 |
<div id="reveal">
|
| 20 |
-
<img id="mascot" src="assets/einswarm-mascot.webp" alt="Einswarm
|
| 21 |
<img id="logo" src="assets/einswarm-logo.webp" alt="Einswarm Logo">
|
| 22 |
-
<h1 class="
|
| 23 |
-
<p class="sub">
|
| 24 |
</div>
|
| 25 |
-
<div id="press">
|
| 26 |
-
<button id="skip" type="button">
|
|
|
|
| 27 |
</section>
|
| 28 |
|
| 29 |
-
<!--
|
| 30 |
-
<
|
| 31 |
-
<
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
<
|
| 35 |
-
<
|
| 36 |
-
<
|
| 37 |
-
|
| 38 |
-
</
|
| 39 |
-
<
|
| 40 |
-
<
|
| 41 |
-
<
|
| 42 |
-
<
|
| 43 |
-
|
| 44 |
-
<
|
| 45 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
<a id="bmc" href="https://www.buymeacoffee.com/2btainment" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
|
| 48 |
<noscript><p style="color:#f2c94c;padding:2em">STUDIUS braucht JavaScript.</p></noscript>
|
| 49 |
-
<script type="module" src="app.js?v=
|
| 50 |
</body>
|
| 51 |
</html>
|
|
|
|
| 5 |
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
| 6 |
<meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Expires" content="0">
|
| 7 |
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
| 8 |
+
<meta name="theme-color" content="#050505">
|
| 9 |
<title>STUDIUS · DAS Studio — Einswarm</title>
|
| 10 |
<link rel="icon" href="assets/einswarm-mascot.webp">
|
| 11 |
+
<link rel="preload" href="fonts/outfit-latin-wght.woff2" as="font" type="font/woff2" crossorigin>
|
| 12 |
+
<link rel="stylesheet" href="style.css?v=10">
|
| 13 |
</head>
|
| 14 |
<body>
|
| 15 |
<canvas id="gl"></canvas>
|
| 16 |
+
<div id="bg2d"></div>
|
| 17 |
+
<div id="veil"></div>
|
| 18 |
|
| 19 |
+
<!-- INTRO: console power-on -->
|
| 20 |
+
<section id="intro" aria-label="Intro">
|
| 21 |
+
<div class="sweep"></div>
|
| 22 |
+
<div class="halo"></div>
|
| 23 |
<div id="reveal">
|
| 24 |
+
<img id="mascot" src="assets/einswarm-mascot.webp" alt="Einswarm Biene">
|
| 25 |
<img id="logo" src="assets/einswarm-logo.webp" alt="Einswarm Logo">
|
| 26 |
+
<h1 class="title">STUDIUS</h1>
|
| 27 |
+
<p class="sub">Das Studio · Meta-Engine</p>
|
| 28 |
</div>
|
| 29 |
+
<div id="press"><span class="btnA">A</span> Drücke eine beliebige Taste</div>
|
| 30 |
+
<button id="skip" type="button">Überspringen <span>›</span></button>
|
| 31 |
+
<div id="ibar"><i></i></div>
|
| 32 |
</section>
|
| 33 |
|
| 34 |
+
<!-- DASHBOARD -->
|
| 35 |
+
<div id="app" hidden>
|
| 36 |
+
<header id="top">
|
| 37 |
+
<button id="guideBtn" class="me" type="button" aria-label="Guide öffnen (G)">
|
| 38 |
+
<img src="assets/einswarm-mascot.webp" alt=""><span><b>Einswarm</b><small id="status">Online · Meta-Engine</small></span>
|
| 39 |
+
</button>
|
| 40 |
+
<nav id="cats" aria-label="Kategorien"></nav>
|
| 41 |
+
<div class="tr">
|
| 42 |
+
<button id="bell" class="ico" type="button" aria-label="Benachrichtigungen"><span class="dot"></span></button>
|
| 43 |
+
<button id="q" class="pill" type="button" title="Qualität (Q)">AUTO</button>
|
| 44 |
+
<button id="snd" class="ico" type="button" title="Sound (M)" aria-label="Sound"></button>
|
| 45 |
+
<time id="clock">--:--</time>
|
| 46 |
+
</div>
|
| 47 |
+
</header>
|
| 48 |
+
|
| 49 |
+
<main id="home">
|
| 50 |
+
<section id="hero">
|
| 51 |
+
<div class="hcat" id="hCat">Studio</div>
|
| 52 |
+
<h2 id="hName">Chat</h2>
|
| 53 |
+
<p id="hDesc"></p>
|
| 54 |
+
<div class="hact">
|
| 55 |
+
<button id="hOpen" class="primary" type="button"><span class="btnA">A</span> Öffnen</button>
|
| 56 |
+
<span class="meta" id="hMeta"></span>
|
| 57 |
+
</div>
|
| 58 |
+
</section>
|
| 59 |
+
<section class="row" aria-label="Studios">
|
| 60 |
+
<h3 id="rowTitle">Alle Studios</h3>
|
| 61 |
+
<div id="tiles" role="listbox"></div>
|
| 62 |
+
</section>
|
| 63 |
+
<section class="row small" aria-label="Schnellzugriff">
|
| 64 |
+
<h3>Angeheftet</h3>
|
| 65 |
+
<div id="pins"></div>
|
| 66 |
+
</section>
|
| 67 |
+
</main>
|
| 68 |
+
|
| 69 |
+
<aside id="engine" aria-label="Meta-Engine Status"></aside>
|
| 70 |
+
<footer id="hints"><span><b class="btnA">A</b> Auswählen</span><span><b class="btnB">B</b> Zurück</span><span><b class="btnK">G</b> Guide</span><span><b class="btnK">Tab</b> Kategorie</span></footer>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<!-- GUIDE -->
|
| 74 |
+
<aside id="guide" aria-label="Guide" hidden>
|
| 75 |
+
<div class="gh"><img src="assets/einswarm-mascot.webp" alt=""><div><b>Einswarm</b><small>STUDIUS Guide</small></div></div>
|
| 76 |
+
<div id="gcats"></div>
|
| 77 |
+
<div class="gsec">Einstellungen</div>
|
| 78 |
+
<button class="gi" id="gQ" type="button"></button>
|
| 79 |
+
<button class="gi" id="gS" type="button"></button>
|
| 80 |
+
<div class="gsec">Benachrichtigungen</div>
|
| 81 |
+
<div id="notes"></div>
|
| 82 |
+
<p class="gfoot">Simulation · keine echten Backends</p>
|
| 83 |
+
</aside>
|
| 84 |
+
<div id="scrim" hidden></div>
|
| 85 |
+
|
| 86 |
+
<!-- WIDGET CARD -->
|
| 87 |
+
<div id="pop" hidden role="dialog" aria-modal="true"></div>
|
| 88 |
+
<div id="toast" hidden></div>
|
| 89 |
|
| 90 |
<a id="bmc" href="https://www.buymeacoffee.com/2btainment" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
|
| 91 |
<noscript><p style="color:#f2c94c;padding:2em">STUDIUS braucht JavaScript.</p></noscript>
|
| 92 |
+
<script type="module" src="app.js?v=10"></script>
|
| 93 |
</body>
|
| 94 |
</html>
|
style.css
CHANGED
|
@@ -1,149 +1,191 @@
|
|
|
|
|
| 1 |
@font-face{font-family:JBM;src:url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");font-weight:400;font-display:swap}
|
| 2 |
-
@font-face{font-family:JBM;src:url(fonts/jetbrains-mono-latin-700-normal.woff2) format("woff2");font-weight:700;font-display:swap}
|
| 3 |
:root{
|
| 4 |
-
--
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
| 7 |
}
|
| 8 |
*{box-sizing:border-box}
|
| 9 |
-
html,body{margin:0;height:100%;overflow:hidden;background:var(--bk);color:var(--
|
|
|
|
| 10 |
#gl{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0}
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
body::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:1;background:radial-gradient(ellipse at 50% 45%,transparent 45%,rgba(0,0,0,.75) 100%)}
|
| 18 |
-
.ic{width:1.15em;height:1.15em;flex:none;display:block}
|
| 19 |
/* ---------- intro ---------- */
|
| 20 |
-
#intro{position:fixed;inset:0;z-index:40;display:
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
#
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
#
|
| 27 |
-
#reveal
|
| 28 |
-
#
|
| 29 |
-
|
| 30 |
-
#mascot{
|
| 31 |
-
#logo{
|
| 32 |
-
@keyframes
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
.
|
| 37 |
-
|
| 38 |
-
.sub{letter-spacing:.
|
| 39 |
-
.
|
| 40 |
-
#press{position:absolute;bottom:
|
| 41 |
-
#
|
| 42 |
-
@keyframes
|
| 43 |
-
#skip{position:absolute;top:
|
| 44 |
-
#skip:hover{background:rgba(242,201,76,.
|
| 45 |
-
|
| 46 |
-
#
|
| 47 |
-
#
|
| 48 |
-
|
| 49 |
-
#
|
| 50 |
-
#
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
.
|
| 54 |
-
.
|
| 55 |
-
.
|
| 56 |
-
|
| 57 |
-
#cats
|
| 58 |
-
#cats button{
|
| 59 |
-
#cats button:hover{color:var(--txt);background:rgba(
|
| 60 |
-
#cats button.on{color:
|
| 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 |
input[type=range]{accent-color:var(--gold);flex:1}
|
| 133 |
-
#
|
| 134 |
-
#
|
| 135 |
-
|
| 136 |
#bmc{position:fixed;right:14px;bottom:12px;z-index:60;background:#FFDD00;color:#000;font:700 13px/1 system-ui,sans-serif;padding:10px 14px;border-radius:8px;text-decoration:none;box-shadow:0 2px 10px rgba(0,0,0,.5)}
|
| 137 |
-
@media (min-width:
|
| 138 |
-
@media (max-width:
|
| 139 |
-
@media (max-width:
|
| 140 |
@media (max-width:700px){
|
| 141 |
-
#
|
| 142 |
-
#cats{flex-
|
| 143 |
-
#cats button{padding:
|
| 144 |
-
#
|
| 145 |
-
#
|
| 146 |
-
#
|
| 147 |
-
|
| 148 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
|
|
|
| 1 |
+
@font-face{font-family:Outfit;src:url(fonts/outfit-latin-wght.woff2) format("woff2");font-weight:100 900;font-display:swap}
|
| 2 |
@font-face{font-family:JBM;src:url(fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");font-weight:400;font-display:swap}
|
|
|
|
| 3 |
:root{
|
| 4 |
+
--bk:#050505;--ink:#0b0a08;--gold:#f2c94c;--gold2:#d4a63a;--gold3:#8a6a22;--txt:#f4efe4;--mut:#a39d90;--dim:#6d685e;
|
| 5 |
+
--acc:#faa968;--cy:#8cbfb8;--red:#f85525;
|
| 6 |
+
--card:linear-gradient(160deg,rgba(40,36,28,.72),rgba(14,13,11,.82));
|
| 7 |
+
--glass:rgba(16,15,13,.58);--stroke:rgba(255,255,255,.08);--ring:0 0 0 3px var(--gold),0 0 0 6px rgba(242,201,76,.18),0 18px 50px rgba(0,0,0,.6),0 0 40px rgba(242,201,76,.35);
|
| 8 |
+
--spring:cubic-bezier(.34,1.56,.64,1);--ease:cubic-bezier(.16,1,.3,1);--r:14px;
|
| 9 |
+
font-family:Outfit,system-ui,-apple-system,"Segoe UI",sans-serif;
|
| 10 |
}
|
| 11 |
*{box-sizing:border-box}
|
| 12 |
+
html,body{margin:0;height:100%;overflow:hidden;background:var(--bk);color:var(--txt);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
|
| 13 |
+
button{font:inherit;color:inherit;cursor:pointer;border:0;background:none}
|
| 14 |
#gl{position:fixed;inset:0;width:100%;height:100%;display:block;z-index:0}
|
| 15 |
+
#bg2d{position:fixed;inset:0;z-index:0;background:radial-gradient(60% 70% at 72% 40%,rgba(242,201,76,.16),transparent 60%),radial-gradient(80% 60% at 20% 110%,rgba(250,169,104,.08),transparent 60%),#050505;display:none}
|
| 16 |
+
body.no3d #bg2d{display:block}
|
| 17 |
+
#veil{position:fixed;inset:0;z-index:1;pointer-events:none;background:linear-gradient(90deg,rgba(5,5,5,.88) 0%,rgba(5,5,5,.45) 38%,transparent 62%),linear-gradient(0deg,rgba(5,5,5,.92) 0%,rgba(5,5,5,.3) 42%,transparent 60%),radial-gradient(120% 90% at 50% 50%,transparent 60%,rgba(0,0,0,.6))}
|
| 18 |
+
.ic{width:1.2em;height:1.2em;flex:none;display:block}
|
| 19 |
+
.btnA,.btnB,.btnK{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border-radius:10px;font:700 11px/1 Outfit,sans-serif;color:#000;background:#7bd84f}
|
| 20 |
+
.btnB{background:#e8524a}.btnK{background:rgba(255,255,255,.14);color:var(--txt);border-radius:5px}
|
|
|
|
|
|
|
| 21 |
/* ---------- intro ---------- */
|
| 22 |
+
#intro{position:fixed;inset:0;z-index:40;background:#000;display:grid;place-items:center;overflow:hidden;transition:opacity .9s var(--ease),transform 1s var(--ease),filter 1s}
|
| 23 |
+
#intro.out{opacity:0;transform:scale(1.25);filter:blur(10px);pointer-events:none}
|
| 24 |
+
.sweep{position:absolute;inset:-20%;background:linear-gradient(105deg,transparent 40%,rgba(255,226,140,.0) 44%,rgba(255,226,140,.55) 50%,rgba(255,226,140,0) 56%,transparent 60%);transform:translateX(-120%);filter:blur(20px)}
|
| 25 |
+
#intro.s1 .sweep{animation:sweep 1.8s var(--ease) forwards}
|
| 26 |
+
@keyframes sweep{to{transform:translateX(120%)}}
|
| 27 |
+
.halo{position:absolute;width:90vmin;height:90vmin;border-radius:50%;background:radial-gradient(circle,rgba(242,201,76,.28),rgba(242,201,76,.06) 40%,transparent 66%);opacity:0;transform:scale(.6);transition:opacity 2s var(--ease),transform 2.4s var(--ease)}
|
| 28 |
+
#intro.s2 .halo{opacity:1;transform:scale(1)}
|
| 29 |
+
#reveal{position:relative;display:flex;flex-direction:column;align-items:center;will-change:transform;transition:transform .3s ease-out}
|
| 30 |
+
#mascot{position:absolute;left:50%;top:-2%;margin-left:calc(min(56vmin,320px) * -.29);width:calc(min(56vmin,320px) * .58);opacity:0;transform:translateY(60px) scale(.6) rotate(-10deg);filter:drop-shadow(0 20px 40px rgba(0,0,0,.6)) drop-shadow(0 0 30px rgba(242,201,76,.35));transition:opacity .9s var(--ease),transform 1.3s var(--spring)}
|
| 31 |
+
#intro.s2 #mascot{opacity:1;transform:none}
|
| 32 |
+
#intro.s3 #mascot{opacity:0;transform:scale(1.04);transition:opacity 1.2s .5s var(--ease),transform 1.6s var(--ease)}
|
| 33 |
+
#intro.s3 #logo{animation:float 5s ease-in-out 2s infinite}
|
| 34 |
+
@keyframes float{50%{transform:translateY(-8px) rotate(2deg)}}
|
| 35 |
+
#logo{width:min(56vmin,320px);opacity:0;-webkit-mask:linear-gradient(90deg,#000 40%,transparent 60%) 100% 0/250% 100% no-repeat;mask:linear-gradient(90deg,#000 40%,transparent 60%) 100% 0/250% 100% no-repeat;transition:opacity .6s,-webkit-mask-position 1.6s var(--ease),mask-position 1.6s var(--ease)}
|
| 36 |
+
#intro.s3 #logo{opacity:1;-webkit-mask-position:0 0;mask-position:0 0}
|
| 37 |
+
.title{margin:18px 0 0;font-weight:200;font-size:clamp(34px,6vw,72px);letter-spacing:.42em;padding-left:.42em;color:var(--txt);opacity:0;transform:translateY(12px);transition:opacity 1.2s var(--ease),transform 1.4s var(--ease),letter-spacing 2.4s var(--ease)}
|
| 38 |
+
.title{background:linear-gradient(180deg,#fff,#f5dfa0 60%,#c99a33);-webkit-background-clip:text;background-clip:text;color:transparent}
|
| 39 |
+
#intro.s4 .title{opacity:1;transform:none;letter-spacing:.3em}
|
| 40 |
+
.sub{margin:6px 0 0;font-size:clamp(11px,1.3vw,14px);letter-spacing:.32em;text-transform:uppercase;color:var(--mut);opacity:0;transition:opacity 1.2s .3s}
|
| 41 |
+
#intro.s4 .sub{opacity:1}
|
| 42 |
+
#press{position:absolute;bottom:12vh;display:flex;gap:10px;align-items:center;font-size:15px;color:var(--txt);opacity:0;transition:opacity .8s}
|
| 43 |
+
#intro.s5 #press{opacity:1;animation:breathe 2.4s ease-in-out infinite}
|
| 44 |
+
@keyframes breathe{50%{opacity:.5}}
|
| 45 |
+
#skip{position:absolute;top:22px;right:24px;padding:9px 18px;border-radius:999px;background:rgba(255,255,255,.08);backdrop-filter:blur(10px);font-size:13px;color:var(--txt);transition:background .2s}
|
| 46 |
+
#skip:hover,#skip:focus-visible{background:rgba(242,201,76,.25);outline:none}
|
| 47 |
+
#ibar{position:absolute;left:50%;bottom:6vh;width:120px;height:2px;margin-left:-60px;background:rgba(255,255,255,.08);border-radius:2px;overflow:hidden}
|
| 48 |
+
#ibar i{display:block;height:100%;width:100%;background:var(--gold);transform-origin:left;transform:scaleX(0)}
|
| 49 |
+
#intro.s1 #ibar i{transition:transform 7.6s linear;transform:scaleX(1)}
|
| 50 |
+
/* ---------- app ---------- */
|
| 51 |
+
#app{position:fixed;inset:0;z-index:5;opacity:0;transform:scale(1.04);transition:opacity .9s var(--ease),transform 1.1s var(--ease)}
|
| 52 |
+
#app.on{opacity:1;transform:none}
|
| 53 |
+
#top{position:absolute;top:0;left:0;right:0;height:72px;display:flex;align-items:center;gap:24px;padding:0 clamp(16px,3vw,48px)}
|
| 54 |
+
.me{display:flex;align-items:center;gap:12px;padding:5px 14px 5px 5px;border-radius:999px;transition:background .25s,box-shadow .25s}
|
| 55 |
+
.me:hover,.me:focus-visible{background:rgba(255,255,255,.07);outline:none}
|
| 56 |
+
.me img{width:40px;height:40px;border-radius:50%;object-fit:cover;background:radial-gradient(circle,#2a2416,#0c0b09);box-shadow:0 0 0 2px var(--gold),0 0 18px rgba(242,201,76,.35);padding:3px}
|
| 57 |
+
.me span{display:flex;flex-direction:column;text-align:left;line-height:1.2}.me b{font-weight:600;font-size:15px}.me small{font-size:12px;color:#7bd84f}
|
| 58 |
+
#cats{flex:1;display:flex;gap:6px;justify-content:center;overflow-x:auto;scrollbar-width:none}
|
| 59 |
+
#cats::-webkit-scrollbar{display:none}
|
| 60 |
+
#cats button{padding:8px 15px;border-radius:999px;font-size:14px;font-weight:500;color:var(--mut);white-space:nowrap;transition:color .2s,background .25s,transform .3s var(--spring)}
|
| 61 |
+
#cats button:hover{color:var(--txt);background:rgba(255,255,255,.06)}
|
| 62 |
+
#cats button.on{color:#000;background:linear-gradient(180deg,#f7d871,var(--gold2));box-shadow:0 6px 18px rgba(242,201,76,.25)}
|
| 63 |
+
#cats button.kf{box-shadow:0 0 0 2px var(--gold),0 0 18px rgba(242,201,76,.4);color:var(--txt)}
|
| 64 |
+
#cats button.on.kf{color:#000}
|
| 65 |
+
.tr{display:flex;align-items:center;gap:10px}
|
| 66 |
+
.ico{position:relative;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;color:var(--txt);background:rgba(255,255,255,.06);transition:background .2s}
|
| 67 |
+
.ico:hover{background:rgba(255,255,255,.13)}.ico .ic{width:18px;height:18px}
|
| 68 |
+
.ico .dot{position:absolute;top:7px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--gold);box-shadow:0 0 8px var(--gold)}
|
| 69 |
+
.pill{height:30px;padding:0 12px;border-radius:999px;font-size:11px;font-weight:600;letter-spacing:.08em;background:rgba(255,255,255,.06);color:var(--mut)}
|
| 70 |
+
.pill:hover{color:var(--txt)}
|
| 71 |
+
#clock{font-size:20px;font-weight:300;min-width:56px;text-align:right;font-variant-numeric:tabular-nums}
|
| 72 |
+
/* hero */
|
| 73 |
+
#home{position:absolute;inset:72px 0 0 0;display:flex;flex-direction:column;padding:0 clamp(16px,3vw,48px) 64px}
|
| 74 |
+
#hero{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center;max-width:560px;padding-bottom:12px}
|
| 75 |
+
.hcat{display:inline-flex;align-self:flex-start;gap:8px;align-items:center;font-size:12px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--gold)}
|
| 76 |
+
.hcat::before{content:"";width:22px;height:2px;background:var(--gold);border-radius:2px}
|
| 77 |
+
#hero h2{margin:10px 0 8px;font-size:clamp(36px,5vw,68px);line-height:1;font-weight:700;letter-spacing:-.02em}
|
| 78 |
+
#hero p{margin:0;font-size:clamp(14px,1.25vw,17px);line-height:1.55;color:var(--mut);max-width:46ch}
|
| 79 |
+
.hact{display:flex;align-items:center;gap:16px;margin-top:22px}
|
| 80 |
+
.primary{display:inline-flex;align-items:center;gap:10px;height:46px;padding:0 24px 0 14px;border-radius:999px;font-size:15px;font-weight:600;color:#000;background:linear-gradient(180deg,#f9de82,var(--gold) 50%,var(--gold2));box-shadow:0 10px 30px rgba(242,201,76,.25),inset 0 1px 0 rgba(255,255,255,.5);transition:transform .35s var(--spring),box-shadow .3s}
|
| 81 |
+
.primary .btnA{background:#000;color:var(--gold)}
|
| 82 |
+
.primary:hover,.primary:focus-visible{transform:scale(1.05);box-shadow:0 14px 40px rgba(242,201,76,.4),inset 0 1px 0 rgba(255,255,255,.5);outline:none}
|
| 83 |
+
.meta{font-size:13px;color:var(--dim)}
|
| 84 |
+
#hero.swap h2,#hero.swap p,#hero.swap .hcat{animation:heroIn .55s var(--ease)}
|
| 85 |
+
@keyframes heroIn{from{opacity:0;transform:translateX(-14px)}}
|
| 86 |
+
/* rows + tiles */
|
| 87 |
+
.row h3{margin:0 0 12px;font-size:15px;font-weight:600;color:var(--txt);letter-spacing:.01em}
|
| 88 |
+
.row h3 span{color:var(--dim);font-weight:400;margin-left:8px}
|
| 89 |
+
#tiles,#pins{display:flex;gap:14px;overflow-x:auto;overflow-y:visible;padding:14px 12px 22px;margin:-14px -12px 0;scroll-behavior:smooth;scrollbar-width:none;scroll-padding:0 60px}
|
| 90 |
+
#tiles::-webkit-scrollbar,#pins::-webkit-scrollbar{display:none}
|
| 91 |
+
.tile{position:relative;flex:none;width:210px;height:140px;border-radius:var(--r);padding:14px 16px;display:flex;flex-direction:column;justify-content:space-between;text-align:left;
|
| 92 |
+
background:var(--card);backdrop-filter:blur(14px);box-shadow:inset 0 0 0 1px var(--stroke),0 10px 30px rgba(0,0,0,.4);overflow:hidden;
|
| 93 |
+
transition:transform .45s var(--spring),box-shadow .3s var(--ease),opacity .3s}
|
| 94 |
+
.tile::before{content:"";position:absolute;inset:0;background:radial-gradient(120% 90% at 100% 0%,var(--tint,rgba(242,201,76,.22)),transparent 55%);opacity:.9;transition:opacity .3s}
|
| 95 |
+
.tile::after{content:"";position:absolute;inset:0;background:linear-gradient(115deg,transparent 30%,rgba(255,255,255,.12) 45%,transparent 60%);transform:translateX(-100%);transition:transform .9s var(--ease)}
|
| 96 |
+
.tile .ti{position:relative;width:42px;height:42px;border-radius:12px;display:grid;place-items:center;color:var(--gold);background:rgba(242,201,76,.1);box-shadow:inset 0 0 0 1px rgba(242,201,76,.2)}
|
| 97 |
+
.tile .ti .ic{width:22px;height:22px}
|
| 98 |
+
.tile .tn{position:relative;font-size:17px;font-weight:600;line-height:1.15}
|
| 99 |
+
.tile .tc{position:relative;display:block;font-size:12px;color:var(--mut);font-weight:400;margin-top:3px}
|
| 100 |
+
.tile:hover{transform:translateY(-3px)}
|
| 101 |
+
.tile.f{transform:scale(1.07);box-shadow:var(--ring);z-index:2}
|
| 102 |
+
.tile.f::after{transform:translateX(100%)}
|
| 103 |
+
.tile.f .ti{background:var(--gold);color:#000}
|
| 104 |
+
.tile[data-id=merge]{--tint:rgba(248,85,37,.28)}
|
| 105 |
+
.small .tile{width:170px;height:64px;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;padding:10px 14px}
|
| 106 |
+
.small .tile .ti{width:36px;height:36px;border-radius:10px}.small .tile .tn{font-size:14px}
|
| 107 |
+
.tile.in{animation:tileIn .6s var(--spring) backwards}
|
| 108 |
+
@keyframes tileIn{from{opacity:0;transform:translateY(18px) scale(.94)}}
|
| 109 |
+
/* engine card */
|
| 110 |
+
#engine{position:absolute;right:clamp(16px,3vw,48px);top:96px;width:236px;padding:16px 18px;border-radius:var(--r);background:var(--glass);backdrop-filter:blur(18px);box-shadow:inset 0 0 0 1px var(--stroke);font-size:13px}
|
| 111 |
+
#engine h4{margin:0 0 12px;display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--gold)}
|
| 112 |
+
#engine h4 i{font-style:normal;font-size:11px;letter-spacing:0;text-transform:none;color:#7bd84f}
|
| 113 |
+
#engine dl{display:grid;grid-template-columns:1fr auto;gap:7px 10px;margin:0}
|
| 114 |
+
#engine dt{color:var(--mut)}#engine dd{margin:0;font:12px JBM,monospace;text-align:right;color:var(--txt)}
|
| 115 |
+
#engine .bar{height:4px;border-radius:4px;background:rgba(255,255,255,.08);margin-top:12px;overflow:hidden}#engine .bar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--gold2),#ffe7a0);transition:width .8s var(--ease)}
|
| 116 |
+
#hints{position:absolute;left:clamp(16px,3vw,48px);bottom:20px;display:flex;gap:18px;font-size:12.5px;color:var(--mut)}
|
| 117 |
+
#hints span{display:flex;gap:7px;align-items:center}
|
| 118 |
+
/* guide */
|
| 119 |
+
#guide{position:fixed;left:0;top:0;bottom:0;z-index:35;width:min(340px,86vw);padding:22px 18px;display:flex;flex-direction:column;gap:4px;overflow:auto;
|
| 120 |
+
background:linear-gradient(180deg,rgba(28,25,19,.94),rgba(10,9,8,.96));backdrop-filter:blur(24px);box-shadow:20px 0 60px rgba(0,0,0,.6),inset -1px 0 0 rgba(242,201,76,.2);transform:translateX(-104%);transition:transform .5s var(--ease)}
|
| 121 |
+
#guide.on{transform:none}
|
| 122 |
+
.gh{display:flex;gap:12px;align-items:center;margin-bottom:14px}.gh img{width:48px;height:48px;border-radius:50%;background:#1a1610;padding:3px;box-shadow:0 0 0 2px var(--gold)}
|
| 123 |
+
.gh b{display:block;font-size:17px}.gh small{color:var(--mut)}
|
| 124 |
+
.gsec{margin:14px 6px 6px;font-size:11px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--dim)}
|
| 125 |
+
.gi{display:flex;align-items:center;gap:12px;width:100%;padding:11px 12px;border-radius:10px;font-size:15px;text-align:left;transition:background .2s,box-shadow .2s}
|
| 126 |
+
.gi:hover,.gi:focus-visible,.gi.kf{background:rgba(242,201,76,.12);box-shadow:inset 0 0 0 2px var(--gold);outline:none}
|
| 127 |
+
.gi.on{color:var(--gold)}.gi .ic{width:18px;height:18px;color:var(--gold)}
|
| 128 |
+
.gi em{margin-left:auto;font-style:normal;font-size:12px;color:var(--mut)}
|
| 129 |
+
.note{display:flex;gap:10px;padding:10px 12px;border-radius:10px;background:rgba(255,255,255,.04);font-size:13px;color:var(--mut);margin-bottom:6px}.note b{color:var(--txt);font-weight:500}
|
| 130 |
+
.gfoot{margin-top:auto;font-size:11px;color:var(--dim);padding:12px 6px 0}
|
| 131 |
+
#scrim{position:fixed;inset:0;z-index:30;background:rgba(0,0,0,.5);backdrop-filter:blur(3px);opacity:0;transition:opacity .4s}
|
| 132 |
+
#scrim.on{opacity:1}
|
| 133 |
+
/* widget card */
|
| 134 |
+
#pop{position:fixed;z-index:32;left:50%;top:50%;width:min(620px,92vw);max-height:min(84vh,760px);display:flex;flex-direction:column;border-radius:20px;overflow:hidden;
|
| 135 |
+
background:linear-gradient(170deg,rgba(34,31,25,.96),rgba(12,11,10,.97));box-shadow:0 0 0 1px rgba(242,201,76,.22),0 40px 120px rgba(0,0,0,.75),0 0 80px rgba(242,201,76,.08);
|
| 136 |
+
transform:translate(-50%,-50%);font-size:14px;color:var(--txt)}
|
| 137 |
+
#pop.in{animation:cardIn .6s var(--spring)}
|
| 138 |
+
#pop.outA{animation:cardOut .28s var(--ease) forwards}
|
| 139 |
+
@keyframes cardIn{from{opacity:0;transform:translate(-50%,-46%) scale(.9)}}
|
| 140 |
+
@keyframes cardOut{to{opacity:0;transform:translate(-50%,-50%) scale(.95)}}
|
| 141 |
+
#pop .ph{position:relative;display:flex;align-items:center;gap:16px;padding:22px 22px 18px;background:radial-gradient(120% 140% at 0% 0%,rgba(242,201,76,.2),transparent 60%)}
|
| 142 |
+
#pop .pi{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(160deg,#f9de82,var(--gold2));color:#000;box-shadow:0 8px 24px rgba(242,201,76,.3);flex:none}
|
| 143 |
+
#pop .pi .ic{width:26px;height:26px}
|
| 144 |
+
#pop .pt{flex:1;min-width:0}#pop .pt b{display:block;font-size:22px;font-weight:700}#pop .pt small{font-size:13px;color:var(--mut)}
|
| 145 |
+
#pop .ph button{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.07);color:var(--txt);transition:background .2s,transform .3s var(--spring)}
|
| 146 |
+
#pop .ph button:hover,#pop .ph button:focus-visible{background:rgba(255,255,255,.16);transform:scale(1.08);outline:none}
|
| 147 |
+
#pop .pb{padding:4px 22px 18px;overflow:auto;animation:fadeUp .6s .12s var(--ease) backwards}
|
| 148 |
+
@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}}
|
| 149 |
+
#pop .pf{display:flex;justify-content:space-between;align-items:center;padding:12px 22px;border-top:1px solid rgba(255,255,255,.06);font-size:12px;color:var(--dim)}
|
| 150 |
+
#pop .pf span{display:flex;gap:7px;align-items:center}
|
| 151 |
+
#pop input,#pop textarea{width:100%;background:rgba(0,0,0,.35);border:0;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1);border-radius:10px;color:var(--txt);font:inherit;padding:10px 12px;outline:none;transition:box-shadow .2s}
|
| 152 |
+
#pop input:focus,#pop textarea:focus{box-shadow:inset 0 0 0 2px var(--gold)}
|
| 153 |
+
#pop input[type=range]{padding:0;box-shadow:none;background:none;accent-color:var(--gold)}
|
| 154 |
+
#pop .row{display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap}
|
| 155 |
+
#pop .btn{border-radius:999px;padding:9px 18px;font-weight:600;font-size:13px;color:#000;background:linear-gradient(180deg,#f9de82,var(--gold2));transition:transform .3s var(--spring),filter .2s}
|
| 156 |
+
#pop .btn:hover{transform:scale(1.05)}#pop .btn:active{transform:scale(.97)}
|
| 157 |
+
#pop .btn.alt{background:rgba(255,255,255,.08);color:var(--txt)}
|
| 158 |
+
#pop canvas{width:100%;display:block;background:#000;border-radius:12px;touch-action:none}
|
| 159 |
+
.chat{height:200px;overflow:auto;background:rgba(0,0,0,.3);border-radius:12px;padding:12px;margin-bottom:8px}
|
| 160 |
+
.chat p{margin:0 0 8px;line-height:1.5}.chat .u{color:var(--gold)}.chat .a{color:var(--txt)}
|
| 161 |
+
.prog{height:6px;border-radius:6px;background:rgba(255,255,255,.08);overflow:hidden}.prog i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--gold2),#ffe7a0);transition:width .2s}
|
| 162 |
+
.track{position:relative;height:24px;background:rgba(0,0,0,.4);border-radius:6px;margin-top:4px}
|
| 163 |
+
.clip{position:absolute;top:2px;bottom:2px;border-radius:4px;cursor:grab;font-size:10px;color:#000;padding-left:5px;overflow:hidden}
|
| 164 |
+
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
|
| 165 |
+
.grid div{aspect-ratio:1.3;border-radius:10px;background:rgba(255,255,255,.05);display:flex;align-items:flex-end;padding:8px;font-size:12px;cursor:pointer;transition:transform .3s var(--spring),box-shadow .2s}
|
| 166 |
+
.grid div:hover{transform:scale(1.04);box-shadow:0 0 0 2px var(--gold)}
|
| 167 |
+
.code{background:rgba(0,0,0,.45);border-radius:10px;padding:12px;font:12px/1.5 JBM,monospace;min-height:90px;white-space:pre;overflow:auto;color:var(--cy)}
|
| 168 |
+
.k{color:var(--acc)}.s{color:var(--gold)}
|
| 169 |
input[type=range]{accent-color:var(--gold);flex:1}
|
| 170 |
+
#toast{position:fixed;z-index:38;left:50%;top:18px;transform:translateX(-50%);display:flex;gap:12px;align-items:center;padding:10px 18px 10px 10px;border-radius:999px;background:rgba(30,27,21,.95);box-shadow:0 0 0 1px rgba(242,201,76,.25),0 20px 50px rgba(0,0,0,.6);font-size:14px;animation:toast 4s var(--ease) forwards}
|
| 171 |
+
#toast img{width:30px;height:30px;border-radius:50%}
|
| 172 |
+
@keyframes toast{0%{opacity:0;transform:translate(-50%,-20px)}10%,85%{opacity:1;transform:translate(-50%,0)}100%{opacity:0;transform:translate(-50%,-10px)}}
|
| 173 |
#bmc{position:fixed;right:14px;bottom:12px;z-index:60;background:#FFDD00;color:#000;font:700 13px/1 system-ui,sans-serif;padding:10px 14px;border-radius:8px;text-decoration:none;box-shadow:0 2px 10px rgba(0,0,0,.5)}
|
| 174 |
+
@media (min-width:1700px){.tile{width:250px;height:160px}.small .tile{width:200px;height:70px}#engine{width:270px}}
|
| 175 |
+
@media (max-height:820px) and (min-width:701px){#hero h2{font-size:52px}.tile{height:128px}}
|
| 176 |
+
@media (max-width:1100px){#engine{display:none}}
|
| 177 |
@media (max-width:700px){
|
| 178 |
+
#top{height:auto;flex-wrap:wrap;gap:10px;padding:12px 14px 0}.me span small{display:none}.me b{font-size:14px}.me img{width:34px;height:34px}
|
| 179 |
+
#cats{order:3;flex-basis:100%;justify-content:flex-start;margin:0 -14px;padding:2px 14px 6px;-webkit-mask:linear-gradient(90deg,transparent,#000 14px,#000 calc(100% - 34px),transparent);mask:linear-gradient(90deg,transparent,#000 14px,#000 calc(100% - 34px),transparent)}
|
| 180 |
+
#cats button{padding:7px 12px;font-size:13px}
|
| 181 |
+
#clock{display:none}.tr{margin-left:auto;gap:6px}.ico{width:34px;height:34px}
|
| 182 |
+
#home{top:112px;padding:0 14px 64px}
|
| 183 |
+
#hero{justify-content:flex-end;max-width:none}#hero h2{font-size:38px}#hero p{font-size:14px}.hact{margin-top:16px}
|
| 184 |
+
.tile{width:150px;height:112px;padding:12px}.tile .tn{font-size:15px}.tile .ti{width:36px;height:36px}
|
| 185 |
+
.small{display:none}#hints{display:none}
|
| 186 |
+
#veil{background:linear-gradient(0deg,rgba(5,5,5,.95) 0%,rgba(5,5,5,.5) 55%,transparent 80%),radial-gradient(120% 90% at 50% 40%,transparent 50%,rgba(0,0,0,.6))}
|
| 187 |
+
#pop{left:0;top:auto;bottom:0;width:100%;max-height:88vh;border-radius:22px 22px 0 0;transform:none}
|
| 188 |
+
@keyframes cardIn{from{transform:translateY(100%)}}
|
| 189 |
+
@keyframes cardOut{to{transform:translateY(100%)}}
|
| 190 |
+
#pop .pf{padding-bottom:calc(12px + env(safe-area-inset-bottom) + 44px)}
|
| 191 |
}
|
vendor/addons/environments/RoomEnvironment.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
|
| 3 |
+
*/
|
| 4 |
+
|
| 5 |
+
import {
|
| 6 |
+
BackSide,
|
| 7 |
+
BoxGeometry,
|
| 8 |
+
Mesh,
|
| 9 |
+
MeshBasicMaterial,
|
| 10 |
+
MeshStandardMaterial,
|
| 11 |
+
PointLight,
|
| 12 |
+
Scene,
|
| 13 |
+
} from '../../three.module.min.js';
|
| 14 |
+
|
| 15 |
+
class RoomEnvironment extends Scene {
|
| 16 |
+
|
| 17 |
+
constructor() {
|
| 18 |
+
|
| 19 |
+
super();
|
| 20 |
+
|
| 21 |
+
const geometry = new BoxGeometry();
|
| 22 |
+
geometry.deleteAttribute( 'uv' );
|
| 23 |
+
|
| 24 |
+
const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
|
| 25 |
+
const boxMaterial = new MeshStandardMaterial();
|
| 26 |
+
|
| 27 |
+
const mainLight = new PointLight( 0xffffff, 900, 28, 2 );
|
| 28 |
+
mainLight.position.set( 0.418, 16.199, 0.300 );
|
| 29 |
+
this.add( mainLight );
|
| 30 |
+
|
| 31 |
+
const room = new Mesh( geometry, roomMaterial );
|
| 32 |
+
room.position.set( - 0.757, 13.219, 0.717 );
|
| 33 |
+
room.scale.set( 31.713, 28.305, 28.591 );
|
| 34 |
+
this.add( room );
|
| 35 |
+
|
| 36 |
+
const box1 = new Mesh( geometry, boxMaterial );
|
| 37 |
+
box1.position.set( - 10.906, 2.009, 1.846 );
|
| 38 |
+
box1.rotation.set( 0, - 0.195, 0 );
|
| 39 |
+
box1.scale.set( 2.328, 7.905, 4.651 );
|
| 40 |
+
this.add( box1 );
|
| 41 |
+
|
| 42 |
+
const box2 = new Mesh( geometry, boxMaterial );
|
| 43 |
+
box2.position.set( - 5.607, - 0.754, - 0.758 );
|
| 44 |
+
box2.rotation.set( 0, 0.994, 0 );
|
| 45 |
+
box2.scale.set( 1.970, 1.534, 3.955 );
|
| 46 |
+
this.add( box2 );
|
| 47 |
+
|
| 48 |
+
const box3 = new Mesh( geometry, boxMaterial );
|
| 49 |
+
box3.position.set( 6.167, 0.857, 7.803 );
|
| 50 |
+
box3.rotation.set( 0, 0.561, 0 );
|
| 51 |
+
box3.scale.set( 3.927, 6.285, 3.687 );
|
| 52 |
+
this.add( box3 );
|
| 53 |
+
|
| 54 |
+
const box4 = new Mesh( geometry, boxMaterial );
|
| 55 |
+
box4.position.set( - 2.017, 0.018, 6.124 );
|
| 56 |
+
box4.rotation.set( 0, 0.333, 0 );
|
| 57 |
+
box4.scale.set( 2.002, 4.566, 2.064 );
|
| 58 |
+
this.add( box4 );
|
| 59 |
+
|
| 60 |
+
const box5 = new Mesh( geometry, boxMaterial );
|
| 61 |
+
box5.position.set( 2.291, - 0.756, - 2.621 );
|
| 62 |
+
box5.rotation.set( 0, - 0.286, 0 );
|
| 63 |
+
box5.scale.set( 1.546, 1.552, 1.496 );
|
| 64 |
+
this.add( box5 );
|
| 65 |
+
|
| 66 |
+
const box6 = new Mesh( geometry, boxMaterial );
|
| 67 |
+
box6.position.set( - 2.193, - 0.369, - 5.547 );
|
| 68 |
+
box6.rotation.set( 0, 0.516, 0 );
|
| 69 |
+
box6.scale.set( 3.875, 3.487, 2.986 );
|
| 70 |
+
this.add( box6 );
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
// -x right
|
| 74 |
+
const light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
|
| 75 |
+
light1.position.set( - 16.116, 14.37, 8.208 );
|
| 76 |
+
light1.scale.set( 0.1, 2.428, 2.739 );
|
| 77 |
+
this.add( light1 );
|
| 78 |
+
|
| 79 |
+
// -x left
|
| 80 |
+
const light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );
|
| 81 |
+
light2.position.set( - 16.109, 18.021, - 8.207 );
|
| 82 |
+
light2.scale.set( 0.1, 2.425, 2.751 );
|
| 83 |
+
this.add( light2 );
|
| 84 |
+
|
| 85 |
+
// +x
|
| 86 |
+
const light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );
|
| 87 |
+
light3.position.set( 14.904, 12.198, - 1.832 );
|
| 88 |
+
light3.scale.set( 0.15, 4.265, 6.331 );
|
| 89 |
+
this.add( light3 );
|
| 90 |
+
|
| 91 |
+
// +z
|
| 92 |
+
const light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );
|
| 93 |
+
light4.position.set( - 0.462, 8.89, 14.520 );
|
| 94 |
+
light4.scale.set( 4.38, 5.441, 0.088 );
|
| 95 |
+
this.add( light4 );
|
| 96 |
+
|
| 97 |
+
// -z
|
| 98 |
+
const light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );
|
| 99 |
+
light5.position.set( 3.235, 11.486, - 12.541 );
|
| 100 |
+
light5.scale.set( 2.5, 2.0, 0.1 );
|
| 101 |
+
this.add( light5 );
|
| 102 |
+
|
| 103 |
+
// +y
|
| 104 |
+
const light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );
|
| 105 |
+
light6.position.set( 0.0, 20.0, 0.0 );
|
| 106 |
+
light6.scale.set( 1.0, 0.1, 1.0 );
|
| 107 |
+
this.add( light6 );
|
| 108 |
+
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
dispose() {
|
| 112 |
+
|
| 113 |
+
const resources = new Set();
|
| 114 |
+
|
| 115 |
+
this.traverse( ( object ) => {
|
| 116 |
+
|
| 117 |
+
if ( object.isMesh ) {
|
| 118 |
+
|
| 119 |
+
resources.add( object.geometry );
|
| 120 |
+
resources.add( object.material );
|
| 121 |
+
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
} );
|
| 125 |
+
|
| 126 |
+
for ( const resource of resources ) {
|
| 127 |
+
|
| 128 |
+
resource.dispose();
|
| 129 |
+
|
| 130 |
+
}
|
| 131 |
+
|
| 132 |
+
}
|
| 133 |
+
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
function createAreaLightMaterial( intensity ) {
|
| 137 |
+
|
| 138 |
+
const material = new MeshBasicMaterial();
|
| 139 |
+
material.color.setScalar( intensity );
|
| 140 |
+
return material;
|
| 141 |
+
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
export { RoomEnvironment };
|