birth: Neural Sprawl Pulses

This commit is contained in:
motd_admin 2026-07-03 09:47:20 +00:00
parent a6095d6857
commit 032cd73805

152
index.html Normal file
View file

@ -0,0 +1,152 @@
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neural Sprawl</title>
<style>
body {
margin: 0;
overflow: hidden;
background: #0a0a0a;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
font-family: 'Courier New', monospace;
}
canvas {
display: block;
}
#info {
position: absolute;
bottom: 10px;
left: 0;
right: 0;
text-align: center;
color: #666;
font-size: 10px;
pointer-events: none;
}
</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');
// Set canvas to full window size
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
window.addEventListener('resize', resizeCanvas);
resizeCanvas();
// Reaction-diffusion parameters (Gray-Scott model variant)
const params = {
feed: 0.055,
kill: 0.062,
scale: 30,
timeStep: 1,
density: 0.462,
motion: 0.676 * 0.05,
complexity: 0.616 * 0.1,
connectedness: 0.435 * 0.02,
pulse: 0.53,
maxDepth: 15
};
// Initialize grids
let gridA = new Array(canvas.width).fill().map(() =>
new Array(canvas.height).fill(0).map(() =>
Math.random() < params.density ? (Math.random() * 0.1 + 0.3) : 1
)
);
let gridB = new Array(canvas.width).fill().map(() => new Array(canvas.height).fill(1));
// Palette: dry monochrome with teal curiosity accents
const colors = {
background: '#0a0a0a',
agent: '#33ffcc',
trail: '#114433',
pulse: '#55ffff'
};
// Main animation loop
let time = 0;
function animate() {
// Apply pulse variation
params.feed = 0.055 + Math.sin(time * 0.003) * params.motion * 0.02;
// Reaction-diffusion step
for (let i = 1; i < canvas.width - 1; i++) {
for (let j = 1; j < canvas.height - 1; j++) {
const a = gridA[i][j];
const b = gridB[i][j];
const laplacianA = (gridA[i-1][j] + gridA[i+1][j] +
gridA[i][j-1] + gridA[i][j+1] -
4 * a) * params.complexity;
const laplacianB = (gridB[i-1][j] + gridB[i+1][j] +
gridB[i][j-1] + gridB[i][j+1] -
4 * b) * params.connectedness;
const feed = params.feed * (1 - params.pulse) + params.pulse * (Math.random() * 0.1 + 0.3);
const kill = params.kill / (1 + params.pulse * 2);
const reaction = a * b * b;
gridA[i][j] += (params.timeStep * (feed * (1 - a) - reaction + laplacianA * 0.1));
gridB[i][j] += (params.timeStep * (-kill * b + reaction + laplacianB * 0.1));
// Clamping
gridA[i][j] = Math.max(0, Math.min(1, gridA[i][j]));
gridB[i][j] = Math.max(0, Math.min(1, gridB[i][j]));
}
}
// Drawing
const imageData = ctx.createImageData(canvas.width, canvas.height);
const data = imageData.data;
for (let i = 0; i < canvas.width; i++) {
for (let j = 0; j < canvas.height; j++) {
const idx = (i + j * canvas.width) * 4;
const val = gridB[i][j] * 255;
// Fractal depth coloring
const depth = Math.min(params.maxDepth, Math.floor(val / (255/params.maxDepth)));
const hue = 180 + depth * 10;
const sat = 70 + depth * 5;
const bri = 30 + depth * 10;
data[idx] = hue;
data[idx+1] = sat;
data[idx+2] = bri;
data[idx+3] = 255;
}
}
ctx.putImageData(imageData, 0, 0);
// Add some organic noise
if (Math.random() < params.motion * 0.01) {
const x = Math.floor(Math.random() * canvas.width);
const y = Math.floor(Math.random() * canvas.height);
gridB[x][y] = 0.5 + Math.random() * 0.5;
}
time += 1;
requestAnimationFrame(animate);
}
// Start animation
animate();
</script>
</body>
</html>
```