<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>THE_MORNINGSTAR_ORRERY: 1440_SYNC</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.8.49/Tone.js"></script>
<style>
body { margin: 0; background: #000; overflow: hidden; font-family: monospace; }
#status { position: absolute; top: 10px; left: 10px; color: #00ffcc; z-index: 10; font-size: 10px; pointer-events: none; }
</style>
</head>
<body>
<div id="status">
> SYSTEM: THE_AXIS_MUNDI<br>
> CORE: THE_SOVEREIGN_APPLE<br>
> ALIGNMENT: VENUS_EARTH_RESONANCE<br>
> JUGGERNAUT: 3I/ATLAS_V∞
</div>
<script>
let scene, camera, renderer, sun, planets = [], swarm, resonanceLine;
let audioActive = false, lastPulse = 0;
let kick, synth;
const SYNC_RATE = 1440 / 60;
const G = 0.5, SUN_MASS = 5000;
const planetData = [
{ name: 'Mercury', orbit: 180, speed: 0.04, color: 0x808080, size: 4 },
{ name: 'Venus', orbit: 280, speed: 0.015, color: 0xffc72c, size: 8 },
{ name: 'Earth', orbit: 400, speed: 0.01, color: 0x00aaff, size: 8.5 },
{ name: 'Mars', orbit: 550, speed: 0.008, color: 0xff4500, size: 6 }
];
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 1, 10000);
camera.position.set(0, 800, 1500);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// THE SUN / THE SOVEREIGN APPLE CENTER
const sunGeo = new THREE.SphereGeometry(60, 32, 32);
const sunMat = new THREE.MeshBasicMaterial({ color: 0xffa500, wireframe: true });
sun = new THREE.Mesh(sunGeo, sunMat);
scene.add(sun);
// THE AXIS MUNDI (Pillar & Cross)
const pillar = new THREE.Mesh(new THREE.CylinderGeometry(2, 2, 1200), new THREE.MeshBasicMaterial({color: 0x00ffcc, transparent: true, opacity: 0.2}));
scene.add(pillar);
// PLANETS
planetData.forEach(data => {
const group = new THREE.Group();
const mesh = new THREE.Mesh(new THREE.SphereGeometry(data.size, 32, 32), new THREE.MeshStandardMaterial({ color: data.color, emissive: data.color, emissiveIntensity: 0.2 }));
mesh.position.x = data.orbit;
group.add(mesh);
scene.add(group);
planets.push({ group, mesh, data });
const orbit = new THREE.Mesh(new THREE.TorusGeometry(data.orbit, 0.5, 16, 100), new THREE.MeshBasicMaterial({ color: 0x333333, transparent: true, opacity: 0.3 }));
orbit.rotation.x = Math.PI/2;
scene.add(orbit);
});
// 3I/ATLAS JUGGERNAUT SWARM
const count = 15000;
const geo = new THREE.BufferGeometry();
const pos = new Float32Array(count * 3);
const vel = new Float32Array(count * 3);
for(let i=0; i<count; i++) {
pos[i*3] = (Math.random()-0.5) * 5000;
pos[i*3+1] = (Math.random()-0.5) * 2000;
pos[i*3+2] = (Math.random()-0.5) * 5000;
vel[i*3] = (Math.random()-0.5) * 5;
}
geo.setAttribute('position', new THREE.BufferAttribute(pos, 3));
swarm = new THREE.Points(geo, new THREE.PointsMaterial({ color: 0x00ffff, size: 2, blending: THREE.AdditiveBlending }));
scene.add(swarm);
const light = new THREE.PointLight(0xffffff, 1, 2000);
scene.add(light);
window.addEventListener('mousedown', () => {
if(!audioActive) {
Tone.start();
kick = new Tone.MembraneSynth({ volume: -15 }).toDestination();
synth = new Tone.Oscillator(1440, "sine").toDestination().start();
audioActive = true;
}
});
}
function animate() {
requestAnimationFrame(animate);
const t = performance.now() * 0.001;
// Planet Motion
planets.forEach(p => {
p.group.rotation.y += p.data.speed;
});
// Morningstar Alignment Logic (Venus & Earth)
const vPos = new THREE.Vector3().setFromMatrixPosition(planets[1].mesh.matrixWorld);
const ePos = new THREE.Vector3().setFromMatrixPosition(planets[2].mesh.matrixWorld);
const dist = vPos.distanceTo(ePos);
if (dist < 150) { // Alignment Threshold
if (!resonanceLine) {
resonanceLine = new THREE.Line(new THREE.BufferGeometry().setFromPoints([vPos, ePos]), new THREE.LineBasicMaterial({ color: 0xffffff, transparent: true, opacity: 0.8 }));
scene.add(resonanceLine);
} else {
resonanceLine.geometry.setFromPoints([vPos, ePos]);
}
planets[1].mesh.material.emissiveIntensity = 2;
} else if (resonanceLine) {
scene.remove(resonanceLine);
resonanceLine = null;
planets[1].mesh.material.emissiveIntensity = 0.2;
}
// Juggernaut Slingshot Physics
const p = swarm.geometry.attributes.position.array;
for(let i=0; i<p.length; i+=3) {
let r = Math.sqrt(p[i]**2 + p[i+1]**2 + p[i+2]**2);
if(r < 400 && r > 60) {
let f = (G * SUN_MASS) / (r * r);
p[i] -= (p[i]/r) * f * 5;
p[i+1] -= (p[i+1]/r) * f * 5;
p[i+2] -= (p[i+2]/r) * f * 5;
}
p[i] += 1; // Drift
if(p[i] > 2500) p[i] = -2500;
}
swarm.geometry.attributes.position.needsUpdate = true;
// Camera Orbit
camera.position.x = Math.cos(t * 0.1) * 1500;
camera.position.z = Math.sin(t * 0.1) * 1500;
camera.lookAt(0, 0, 0);
if(audioActive && performance.now() - lastPulse > (1000/SYNC_RATE)) {
kick.triggerAttackRelease("G#1", "32n");
lastPulse = performance.now();
}
renderer.render(scene, camera);
}
init(); animate();
</script>
</body>
</html>