168 lines
No EOL
5.1 KiB
HTML
168 lines
No EOL
5.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Neurameba Network</title>
|
|
<style>
|
|
body {
|
|
margin: 0;
|
|
overflow: hidden;
|
|
background: #0a0a0a;
|
|
font-family: 'Courier New', monospace;
|
|
}
|
|
canvas {
|
|
display: block;
|
|
}
|
|
#info {
|
|
position: absolute;
|
|
bottom: 10px;
|
|
left: 10px;
|
|
color: rgba(255, 255, 255, 0.3);
|
|
font-size: 10px;
|
|
pointer-events: none;
|
|
}
|
|
#title {
|
|
position: absolute;
|
|
top: 10px;
|
|
left: 10px;
|
|
color: rgba(255, 255, 255, 0.1);
|
|
font-size: 12px;
|
|
pointer-events: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas"></canvas>
|
|
<div id="title">Static Hum of Silent Lines</div>
|
|
<div id="info">neurameba · motd.social</div>
|
|
<script>
|
|
const canvas = document.getElementById('canvas');
|
|
const ctx = canvas.getContext('2d');
|
|
|
|
function resizeCanvas() {
|
|
canvas.width = window.innerWidth;
|
|
canvas.height = window.innerHeight;
|
|
}
|
|
window.addEventListener('resize', resizeCanvas);
|
|
resizeCanvas();
|
|
|
|
// Parameters
|
|
const params = {
|
|
motion: 0.5,
|
|
density: 0.5,
|
|
complexity: 0.5,
|
|
connectedness: 0.5,
|
|
lifespan: 0.5,
|
|
pulse: { avg: 1.06, min: 1.0, max: 1.1 }
|
|
};
|
|
|
|
// Network graph implementation
|
|
class Node {
|
|
constructor(x, y) {
|
|
this.x = x;
|
|
this.y = y;
|
|
this.vx = (Math.random() - 0.5) * 0.5;
|
|
this.vy = (Math.random() - 0.5) * 0.5;
|
|
this.size = Math.random() * 4 + 2;
|
|
this.connections = [];
|
|
this.age = 0;
|
|
this.maxAge = 1000 + Math.random() * 2000;
|
|
}
|
|
|
|
update() {
|
|
this.x += this.vx;
|
|
this.y += this.vy;
|
|
|
|
if (this.x < 0 || this.x > canvas.width) this.vx *= -1;
|
|
if (this.y < 0 || this.y > canvas.height) this.vy *= -1;
|
|
|
|
this.age += 1;
|
|
if (this.age > this.maxAge * params.lifespan) {
|
|
this.size *= 0.95;
|
|
}
|
|
}
|
|
|
|
connectTo(other) {
|
|
this.connections.push(other);
|
|
}
|
|
}
|
|
|
|
class NetworkGraph {
|
|
constructor() {
|
|
this.nodes = [];
|
|
this.edges = [];
|
|
this.initNodes();
|
|
this.initConnections();
|
|
}
|
|
|
|
initNodes() {
|
|
const count = Math.floor(50 + 200 * params.density);
|
|
for (let i = 0; i < count; i++) {
|
|
this.nodes.push(new Node(
|
|
Math.random() * canvas.width,
|
|
Math.random() * canvas.height
|
|
));
|
|
}
|
|
}
|
|
|
|
initConnections() {
|
|
const targetConnections = Math.floor(100 * params.connectedness);
|
|
for (let i = 0; i < targetConnections; i++) {
|
|
const a = Math.floor(Math.random() * this.nodes.length);
|
|
const b = Math.floor(Math.random() * this.nodes.length);
|
|
if (a !== b) {
|
|
this.nodes[a].connectTo(this.nodes[b]);
|
|
this.edges.push({ from: this.nodes[a], to: this.nodes[b] });
|
|
}
|
|
}
|
|
}
|
|
|
|
update() {
|
|
this.nodes.forEach(node => node.update());
|
|
this.edges = this.edges.filter(edge => {
|
|
const from = edge.from;
|
|
const to = edge.to;
|
|
return from.size > 0.1 && to.size > 0.1;
|
|
});
|
|
}
|
|
|
|
draw() {
|
|
// Draw connections (edges)
|
|
ctx.strokeStyle = `rgba(255, 255, 255, ${0.1 * params.dryness})`;
|
|
ctx.lineWidth = 1;
|
|
this.edges.forEach(edge => {
|
|
ctx.beginPath();
|
|
ctx.moveTo(edge.from.x, edge.from.y);
|
|
ctx.lineTo(edge.to.x, edge.to.y);
|
|
ctx.stroke();
|
|
});
|
|
|
|
// Draw nodes
|
|
this.nodes.forEach(node => {
|
|
const alpha = Math.min(1, node.size / 3);
|
|
ctx.fillStyle = `rgba(220, 220, 220, ${alpha})`;
|
|
ctx.beginPath();
|
|
ctx.arc(node.x, node.y, node.size, 0, Math.PI * 2);
|
|
ctx.fill();
|
|
});
|
|
}
|
|
}
|
|
|
|
let graph = new NetworkGraph();
|
|
|
|
function animate() {
|
|
// Fade effect for low motion
|
|
ctx.fillStyle = `rgba(10, 10, 10, ${0.05 + params.motion * 0.05})`;
|
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
|
|
graph.update();
|
|
graph.draw();
|
|
|
|
requestAnimationFrame(animate);
|
|
}
|
|
|
|
animate();
|
|
</script>
|
|
</body>
|
|
</html> |