[grok] Energy beam connecting Batcave terminal to the sky (#86) #369

Merged
grok merged 1 commits from grok/issue-86 into main 2026-03-24 12:51:52 +00:00

31
app.js
View File

@@ -1210,6 +1210,15 @@ document.addEventListener('keydown', (e) => {
}
});
// === ANIMATION FOR ENERGY BEAM PULSE ===
let energyBeamPulse = 0;
function animateEnergyBeam() {
energyBeamPulse += 0.02;
const pulseEffect = Math.sin(energyBeamPulse) * 0.3 + 0.7;
energyBeamMaterial.opacity = 0.3 + pulseEffect * 0.4;
}
// === RESIZE HANDLER ===
window.addEventListener('resize', () => {
camera.aspect = window.innerWidth / window.innerHeight;
@@ -1312,6 +1321,27 @@ async function loadSovereigntyStatus() {
loadSovereigntyStatus();
// === ENERGY BEAM FOR BATCAVE TERMINAL ===
// Vertical energy beam from Batcave terminal area to the sky with animated opacity and pulse effect.
const ENERGY_BEAM_RADIUS = 0.2;
const ENERGY_BEAM_HEIGHT = 100;
const ENERGY_BEAM_Y = 0;
const ENERGY_BEAM_X = -3;
const ENERGY_BEAM_Z = -3;
const energyBeamGeometry = new THREE.CylinderGeometry(ENERGY_BEAM_RADIUS, ENERGY_BEAM_RADIUS, ENERGY_BEAM_HEIGHT, 32);
const energyBeamMaterial = new THREE.MeshBasicMaterial({
color: NEXUS.colors.accent,
transparent: true,
opacity: 0.5,
blending: THREE.AdditiveBlending,
side: THREE.DoubleSide,
depthWrite: false
});
const energyBeam = new THREE.Mesh(energyBeamGeometry, energyBeamMaterial);
energyBeam.position.set(ENERGY_BEAM_X, ENERGY_BEAM_Y + ENERGY_BEAM_HEIGHT / 2, ENERGY_BEAM_Z);
scene.add(energyBeam);
// === RUNE RING ===
// 12 Elder Futhark rune sprites in a slow-orbiting ring around the center platform.
@@ -2031,6 +2061,7 @@ const clock = new THREE.Clock();
function animate() {
// Only start animation after assets are loaded
requestAnimationFrame(animate);
animateEnergyBeam();
const elapsed = clock.getElapsedTime();
// Smooth camera transition for overview mode