Spaces:
Paused
Paused
STUDIUS X1: intro auto-continue driven by rendered time
Browse files- app.js +3 -2
- index.html +1 -1
app.js
CHANGED
|
@@ -228,7 +228,7 @@ 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 =
|
| 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(); });
|
|
@@ -274,6 +274,7 @@ function frame() {
|
|
| 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); }
|
|
@@ -282,4 +283,4 @@ 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(); }
|
|
|
|
| 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 |
+
let introT = 0; const autoT = 0; // auto-continue is driven by rendered frame time (see loop), so slow devices still see the full reveal
|
| 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(); });
|
|
|
|
| 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) { introT += dt; if (introT > 7.8 && intro.classList.contains('s5')) start(); }
|
| 278 |
if (!started && !intro.classList.contains('s4')) return; // intro is opaque: save GPU until the reveal
|
| 279 |
if (composer && quality === 'high') composer.render(); else renderer.render(scene, camera);
|
| 280 |
if (started && (statT += dt) > 1) { statT = 0; updEngine(t); }
|
|
|
|
| 283 |
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>`; }
|
| 284 |
applyQuality(); syncSettings(); updEngine(0);
|
| 285 |
window.__studius = { open, close, visible, get sel() { return sel; } };
|
| 286 |
+
if (gl3d) frame(); else { setTimeout(() => start(), 7800); const loop2 = () => { requestAnimationFrame(loop2); pollPad(); }; loop2(); }
|
index.html
CHANGED
|
@@ -89,6 +89,6 @@
|
|
| 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=
|
| 93 |
</body>
|
| 94 |
</html>
|
|
|
|
| 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=11"></script>
|
| 93 |
</body>
|
| 94 |
</html>
|