Files
the-nexus/modules/state.js
Alexander Whitestone cbfacdfe19
Some checks failed
Deploy Nexus / deploy (push) Failing after 3s
Staging Smoke Test / smoke-test (push) Successful in 1s
refactor: split app.js (5416 lines) into 21 modules — hard cap 1000 lines/file
app.js: 5416 → 528 lines (entry point, animation loop, event wiring)
modules/state.js: shared mutable state object
modules/constants.js: color palette
modules/matrix-rain.js: matrix rain canvas effect
modules/scene-setup.js: scene, camera, renderer, lighting, stars
modules/platform.js: glass platform, perlin noise, floating island, clouds
modules/heatmap.js: commit heatmap
modules/sigil.js: Timmy sigil
modules/controls.js: mouse, overview, zoom, photo mode
modules/effects.js: energy beam, sovereignty meter, rune ring
modules/earth.js: holographic earth
modules/warp.js: warp tunnel, crystals, lightning
modules/dual-brain.js: dual-brain holographic panel
modules/audio.js: Web Audio, spatial, portal hums
modules/debug.js: debug mode, websocket, session export
modules/celebrations.js: easter egg, shockwave, fireworks
modules/portals.js: portal loading
modules/bookshelves.js: floating bookshelves, spine textures
modules/oath.js: The Oath interactive SOUL.md
modules/panels.js: agent status board, LoRA panel
modules/weather.js: weather system, portal health
modules/extras.js: gravity zones, speech, timelapse, bitcoin

Largest file: 528 lines (app.js). No file exceeds 1000.
All files pass node --check. No refactoring — mechanical split only.
2026-03-24 15:12:22 -04:00

84 lines
1.4 KiB
JavaScript

// Shared mutable state — imported by all modules that need cross-module scalar access
import * as THREE from 'three';
export const S = {
// Mouse & camera
mouseX: 0,
mouseY: 0,
targetRotX: 0,
targetRotY: 0,
// Overview
overviewMode: false,
overviewT: 0,
// Zoom
zoomT: 0,
zoomTargetT: 0,
zoomActive: false,
_zoomCamTarget: new THREE.Vector3(),
_zoomLookTarget: new THREE.Vector3(),
// Photo
photoMode: false,
// Warp
isWarping: false,
warpStartTime: 0,
warpNavigated: false,
warpDestinationUrl: null,
warpPortalColor: new THREE.Color(0x4488ff),
// Stars
_starPulseIntensity: 0,
// Energy beam
energyBeamPulse: 0,
_activeAgentCount: 0,
// Batcave
batcaveProbeLastUpdate: -999,
// Lightning
lastLightningRefreshTime: 0,
// Oath
oathActive: false,
oathLines: [],
oathRevealTimer: null,
// Speech
timmySpeechSprite: null,
timmySpeechState: null,
// Timelapse
timelapseActive: false,
timelapseRealStart: 0,
timelapseProgress: 0,
timelapseNextCommitIdx: 0,
// Bitcoin
lastKnownBlockHeight: null,
// Audio
audioCtx: null,
masterGain: null,
audioRunning: false,
portalHumsStarted: false,
sparkleTimer: null,
// Debug
debugMode: false,
// Matrix
_matrixCommitHashes: [],
// Sovereignty easter egg
sovereigntyBuffer: '',
sovereigntyBufferTimer: null,
// Sovereignty score
sovereigntyScore: 85,
sovereigntyLabel: 'Mostly Sovereign',
};