birth: Frayed Neural Haze
This commit is contained in:
parent
332ad6040a
commit
a273a8da77
1 changed files with 187 additions and 0 deletions
187
index.html
Normal file
187
index.html
Normal file
|
|
@ -0,0 +1,187 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>neural meba · motd.social</title>
|
||||||
|
<style>
|
||||||
|
body, html {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
background: #0a0a0a;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
canvas {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
#info {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 10px;
|
||||||
|
right: 10px;
|
||||||
|
color: #666;
|
||||||
|
font-family: monospace;
|
||||||
|
font-size: 10px;
|
||||||
|
text-shadow: 0 0 5px #000;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id="canvas"></canvas>
|
||||||
|
<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();
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
motion: 0.5,
|
||||||
|
density: 0.5,
|
||||||
|
complexity: 0.5,
|
||||||
|
connectedness: 0.5,
|
||||||
|
lifespan: 0.5,
|
||||||
|
pulse: { avg: 1.08, min: 0.95, max: 1.20 },
|
||||||
|
tone: {
|
||||||
|
anger: 0.0,
|
||||||
|
sadness: 0.0,
|
||||||
|
curiosity: 0.1,
|
||||||
|
dryness: 0.9,
|
||||||
|
playfulness: 0.0,
|
||||||
|
tension: 0.0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Network graph simulation
|
||||||
|
const nodes = [];
|
||||||
|
const edges = [];
|
||||||
|
const nodeCount = Math.floor(100 + params.density * 200);
|
||||||
|
const edgeCount = Math.floor(200 + params.connectedness * 800);
|
||||||
|
|
||||||
|
function initNodes() {
|
||||||
|
nodes.length = 0;
|
||||||
|
for (let i = 0; i < nodeCount; i++) {
|
||||||
|
nodes.push({
|
||||||
|
x: Math.random() * canvas.width,
|
||||||
|
y: Math.random() * canvas.height,
|
||||||
|
vx: (Math.random() - 0.5) * params.motion * 2,
|
||||||
|
vy: (Math.random() - 0.5) * params.motion * 2,
|
||||||
|
size: 2 + Math.random() * 3,
|
||||||
|
life: Math.random(),
|
||||||
|
color: `rgba(200, 200, 200, ${0.5 + Math.random() * 0.5})`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function initEdges() {
|
||||||
|
edges.length = 0;
|
||||||
|
for (let i = 0; i < edgeCount; i++) {
|
||||||
|
const a = Math.floor(Math.random() * nodes.length);
|
||||||
|
const b = Math.floor(Math.random() * nodes.length);
|
||||||
|
if (a !== b) {
|
||||||
|
const dist = Math.sqrt(
|
||||||
|
Math.pow(nodes[a].x - nodes[b].x, 2) +
|
||||||
|
Math.pow(nodes[a].y - nodes[b].y, 2)
|
||||||
|
);
|
||||||
|
edges.push({
|
||||||
|
a, b,
|
||||||
|
dist,
|
||||||
|
strength: 0.01 + Math.random() * 0.02,
|
||||||
|
phase: Math.random() * Math.PI * 2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateNodes() {
|
||||||
|
nodes.forEach(node => {
|
||||||
|
node.x += node.vx * params.pulse.avg;
|
||||||
|
node.y += node.vy * params.pulse.avg;
|
||||||
|
|
||||||
|
// Bounce off edges
|
||||||
|
if (node.x < 0) { node.x = 0; node.vx *= -1; }
|
||||||
|
if (node.y < 0) { node.y = 0; node.vy *= -1; }
|
||||||
|
if (node.x > canvas.width) { node.x = canvas.width; node.vx *= -1; }
|
||||||
|
if (node.y > canvas.height) { node.y = canvas.height; node.vy *= -1; }
|
||||||
|
|
||||||
|
// Fade based on lifespan
|
||||||
|
node.life += 0.0001 * params.lifespan;
|
||||||
|
if (node.life > 1) node.life = 0;
|
||||||
|
|
||||||
|
// Pulse effect
|
||||||
|
const pulseFactor = params.pulse.avg + Math.sin(Date.now() * 0.001) * 0.1;
|
||||||
|
node.size = 2 + Math.sin(node.life * Math.PI * 2) * 3 * pulseFactor;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateEdges() {
|
||||||
|
edges.forEach(edge => {
|
||||||
|
const nodeA = nodes[edge.a];
|
||||||
|
const nodeB = nodes[edge.b];
|
||||||
|
const dx = nodeB.x - nodeA.x;
|
||||||
|
const dy = nodeB.y - nodeA.y;
|
||||||
|
const dist = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
|
||||||
|
// Spring-like attraction/repulsion
|
||||||
|
const force = (dist - edge.dist) * edge.strength;
|
||||||
|
nodeA.vx += dx / dist * force;
|
||||||
|
nodeA.vy += dy / dist * force;
|
||||||
|
nodeB.vx -= dx / dist * force;
|
||||||
|
nodeB.vy -= dy / dist * force;
|
||||||
|
|
||||||
|
// Pulsing edge thickness
|
||||||
|
edge.phase += 0.01;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawNodes() {
|
||||||
|
ctx.globalAlpha = 0.8;
|
||||||
|
nodes.forEach(node => {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(node.x, node.y, node.size, 0, Math.PI * 2);
|
||||||
|
ctx.fillStyle = node.color;
|
||||||
|
ctx.fill();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawEdges() {
|
||||||
|
ctx.globalAlpha = 0.3;
|
||||||
|
edges.forEach(edge => {
|
||||||
|
const nodeA = nodes[edge.a];
|
||||||
|
const nodeB = nodes[edge.b];
|
||||||
|
const pulseFactor = 0.8 + 0.2 * Math.sin(Date.now() * 0.001 + edge.phase);
|
||||||
|
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(nodeA.x, nodeA.y);
|
||||||
|
ctx.lineTo(nodeB.x, nodeB.y);
|
||||||
|
ctx.strokeStyle = `rgba(200, 200, 200, ${pulseFactor * 0.3})`;
|
||||||
|
ctx.lineWidth = 1 + pulseFactor * 0.5;
|
||||||
|
ctx.stroke();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function animate() {
|
||||||
|
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
|
||||||
|
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
updateNodes();
|
||||||
|
updateEdges();
|
||||||
|
drawEdges();
|
||||||
|
drawNodes();
|
||||||
|
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
initNodes();
|
||||||
|
initEdges();
|
||||||
|
animate();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Add table
Reference in a new issue