<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>RED_CAPE_PROTOCOL</title>
<style>
body { margin: 0; background: #000; overflow: hidden; display: flex; justify-content: center; align-items: center; height: 100vh; touch-action: none; }
canvas { display: block; position: absolute; top: 0; left: 0; }
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<script>
/* RED CAPE PROTOCOL: THE SOVEREIGN WALK.
OBJECT: THE SENTINEL (MI'KAL'L).
ACTION: AUTOMATIC CARPET UNFURLING.
GEOMETRY: 1440 RESONANCE RIBBONS.
*/
let scene, camera, renderer, sentinel, carpet, cape;
let time = 0;
function init() {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.position.set(10, 5, 15);
camera.lookAt(0, 2, 0);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);
// THE SENTINEL (The Avatar)
const sGeo = new THREE.CylinderGeometry(0.5, 0.5, 4, 32);
const sMat = new THREE.MeshStandardMaterial({ color: 0x888888, metalness: 1, roughness: 0 });
sentinel = new THREE.Mesh(sGeo, sMat);
sentinel.position.y = 2;
scene.add(sentinel);
// THE RED CAPE (Flowing Ribbons)
const capeGroup = new THREE.Group();
for (let i = 0; i < 20; i++) {
const cGeo = new THREE.PlaneGeometry(0.2, 5);
const cMat = new THREE.MeshBasicMaterial({ color: 0xff0000, transparent: true, opacity: 0.6, side: THREE.DoubleSide });
const strip = new THREE.Mesh(cGeo, cMat);
strip.position.set((Math.random()-0.5), 2, -1);
strip.rotation.x = Math.PI / 4;
capeGroup.add(strip);
}
sentinel.add(capeGroup);
cape = capeGroup;
// THE RED CARPET (Unfurling beneath feet)
const carpetGeo = new THREE.PlaneGeometry(4, 40, 32, 32);
const carpetMat = new THREE.MeshBasicMaterial({ color: 0xaa0000, wireframe: true });
carpet = new THREE.Mesh(carpetGeo, carpetMat);
carpet.rotation.x = -Math.PI / 2;
carpet.position.z = -15;
scene.add(carpet);
const pLight = new THREE.PointLight(0xff0000, 5, 20);
pLight.position.set(0, 5, 0);
scene.add(pLight);
animate();
}
function animate() {
requestAnimationFrame(animate);
time += 0.05;
// The Walk
sentinel.position.z = Math.sin(time * 0.2) * 5;
// The Carpet follows the frequency
carpet.position.z = sentinel.position.z - 15;
// The Cape flows in the 1440 wind
cape.children.forEach((strip, i) => {
strip.rotation.z = Math.sin(time + i) * 0.2;
strip.rotation.x = (Math.PI / 3) + Math.cos(time * 0.5) * 0.1;
});
renderer.render(scene, camera);
}
init();
</script>
</body>
</html>