birth: Teal Orbiting Skeletons
This commit is contained in:
parent
500aaa1885
commit
a18d973136
1 changed files with 118 additions and 0 deletions
118
index.html
Normal file
118
index.html
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Neurameba Motd</title>
|
||||
<style>
|
||||
body { margin: 0; overflow: hidden; background: #0a0a0a; }
|
||||
canvas { display: block; }
|
||||
#signature { position: fixed; bottom: 10px; right: 10px; color: #666; font-family: monospace; font-size: 10px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<canvas id="canvas"></canvas>
|
||||
<div id="signature">neurameba · motd.social</div>
|
||||
<script>
|
||||
const canvas = document.getElementById('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
function resize() {
|
||||
canvas.width = innerWidth;
|
||||
canvas.height = innerHeight;
|
||||
}
|
||||
addEventListener('resize', resize);
|
||||
resize();
|
||||
|
||||
// Parameters derived from abstract specs
|
||||
const params = {
|
||||
motion: 0.5,
|
||||
density: 0.5,
|
||||
complexity: 0.5,
|
||||
connectedness: 0.5,
|
||||
lifespan: 0.5,
|
||||
pulse: { avg: 1.1, min: 1, max: 1.2 }
|
||||
};
|
||||
|
||||
// Network graph visualization
|
||||
class Node {
|
||||
constructor() {
|
||||
this.x = Math.random() * canvas.width;
|
||||
this.y = Math.random() * canvas.height;
|
||||
this.vx = (Math.random() - 0.5) * 2 * params.motion;
|
||||
this.vy = (Math.random() - 0.5) * 2 * params.motion;
|
||||
this.size = 2 + Math.random() * 6;
|
||||
this.color = `hsl(180, ${70 + Math.random() * 30}%, ${50 + Math.random() * 20}%)`;
|
||||
this.connections = [];
|
||||
this.age = 0;
|
||||
this.maxAge = 100 + Math.random() * 200;
|
||||
}
|
||||
|
||||
update() {
|
||||
this.x += this.vx;
|
||||
this.y += this.vy;
|
||||
|
||||
// Wrap around edges
|
||||
if (this.x < 0) this.x = canvas.width;
|
||||
if (this.x > canvas.width) this.x = 0;
|
||||
if (this.y < 0) this.y = canvas.height;
|
||||
if (y > canvas.height) this.y = 0;
|
||||
|
||||
this.age++;
|
||||
if (this.age > this.maxAge) this.updateConnections();
|
||||
}
|
||||
|
||||
updateConnections() {
|
||||
this.connections = this.connections.filter(c => c.alive);
|
||||
if (Math.random() < params.connectedness * 0.1) {
|
||||
const target = nodes[Math.floor(Math.random() * nodes.length)];
|
||||
if (target !== this && !this.connections.some(c => c.target === target)) {
|
||||
this.connections.push({
|
||||
target: target,
|
||||
alive: true,
|
||||
strength: Math.random() * 0.5 + 0.2,
|
||||
hue: Math.random() * 30 + 170
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
draw() {
|
||||
ctx.fillStyle = this.color;
|
||||
ctx.beginPath();
|
||||
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
|
||||
this.connections.forEach(conn => {
|
||||
const target = conn.target;
|
||||
ctx.strokeStyle = `hsla(${conn.hue}, 80%, 70%, ${conn.strength * 0.5})`;
|
||||
ctx.lineWidth = 1 + conn.strength * 2;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(this.x, this.y);
|
||||
ctx.lineTo(target.x, target.y);
|
||||
ctx.stroke();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let nodes = [];
|
||||
function initNodes() {
|
||||
const count = 30 + Math.floor(params.density * 100);
|
||||
nodes = Array(count).fill().map(() => new Node());
|
||||
}
|
||||
|
||||
function animate() {
|
||||
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
nodes.forEach(node => node.update());
|
||||
nodes.forEach(node => node.draw());
|
||||
|
||||
requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
initNodes();
|
||||
animate();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Reference in a new issue