[claude] Phase 1: Core Foundation — scene, ticker, theme, state (#410) (#463)
Some checks failed
Deploy Nexus / deploy (push) Has been cancelled
Staging Smoke Test / smoke-test (push) Has been cancelled

This commit was merged in pull request #463.
This commit is contained in:
2026-03-24 22:16:49 +00:00
parent 6db2871785
commit 09c83e8734
4 changed files with 133 additions and 34 deletions

35
app.js
View File

@@ -1,9 +1,12 @@
// === THE NEXUS — Main Entry Point ===
// Thin orchestrator: imports core modules, wires updates, starts the ticker.
import * as THREE from 'three';
import { S, Broadcaster } from './modules/state.js';
import { NEXUS } from './modules/constants.js';
import { scene, camera, renderer, composer } from './modules/scene-setup.js';
import { clock, warpPass } from './modules/warp.js';
import { scene, composer } from './modules/core/scene.js';
import { subscribe, start } from './modules/core/ticker.js';
import { NEXUS } from './modules/core/theme.js'; // eslint-disable-line no-unused-vars
import { state } from './modules/core/state.js'; // eslint-disable-line no-unused-vars
import { S } from './modules/state.js';
import { warpPass } from './modules/warp.js';
import { nostr } from './modules/nostr.js';
import { createNostrPanelTexture } from './modules/nostr-panel.js';
@@ -17,13 +20,9 @@ nostrPanel.position.set(-6, 3.5, -7.5);
nostrPanel.rotation.y = 0.4;
scene.add(nostrPanel);
// === MAIN ANIMATION LOOP ===
function animate() {
requestAnimationFrame(animate);
const delta = clock.getDelta();
const elapsed = clock.elapsedTime;
// Update Nostr UI periodically or on event
// === MAIN UPDATE — subscribed to the single RAF loop in ticker.js ===
subscribe((elapsed, delta) => {
// Update Nostr UI periodically
if (Math.random() > 0.95) {
updateNostrUI();
nostrTexture.needsUpdate = true;
@@ -35,8 +34,14 @@ function animate() {
if (S.energyBeamPulse < 0) S.energyBeamPulse = 0;
}
composer.render();
}
// Warp pass time uniform
if (S.isWarping) {
warpPass.uniforms['time'].value = elapsed;
}
animate();
console.log('Nexus Sovereign Node: NOSTR CONNECTED.');
composer.render();
});
// === START THE SINGLE RAF LOOP ===
start();
console.log('Nexus Sovereign Node: ONLINE.');