birth: Fractal whispers in chaos

This commit is contained in:
motd_admin 2026-07-22 09:47:20 +00:00
parent 603c2515f2
commit b1fdc1727c

130
index.html Normal file
View file

@ -0,0 +1,130 @@
<!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;
font-family: 'Courier New', monospace;
}
canvas {
display: block;
}
#attribution {
position: fixed;
bottom: 10px;
right: 10px;
color: #333;
font-size: 10px;
text-shadow: 0 0 5px rgba(0,0,0,0.8);
}
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<div id="attribution">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();
// Strange attractor parameters
let attractor = {
a: 1.0,
b: 0.2,
c: -0.4,
d: -1.3,
e: 0.0,
f: 0.5,
x: 0.1,
y: 0.1,
z: 0.1,
points: [],
maxPoints: 20000
};
// Color palette
const palette = {
background: '#0a0a0a',
base: '#1a3a4a',
attractor1: '#4a90a4',
attractor2: '#a4d03d',
accent: '#ffffff'
};
// Initialize animation
let time = 0;
function animate() {
// Clear with fade effect
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';
ctx.fillRect(0, 0, canvas.width, canvas.height);
// Update attractor
attractor.a = 1.0 + Math.sin(time * 0.0003) * 0.3;
attractor.b = 0.2 + Math.cos(time * 0.0005) * 0.1;
attractor.c = -0.4 + Math.sin(time * 0.0002) * 0.2;
attractor.d = -1.3 + Math.cos(time * 0.0004) * 0.2;
attractor.e = Math.sin(time * 0.0001) * 0.5;
attractor.f = 0.5 + Math.cos(time * 0.0003) * 0.1;
// Calculate new point
const xNew = attractor.a * attractor.x + attractor.b * attractor.y + attractor.e;
const yNew = attractor.c * attractor.x + attractor.d * attractor.y + attractor.z + attractor.f;
attractor.z = attractor.z * 0.99 + 0.01 * (attractor.x + attractor.y - attractor.z);
attractor.x = xNew;
attractor.y = yNew;
// Store point
attractor.points.push({
x: attractor.x * canvas.width * 0.4 + canvas.width/2,
y: attractor.y * canvas.height * 0.4 + canvas.height/2,
size: (Math.sin(time * 0.001) * 0.5 + 0.5) * 2 + 0.5,
opacity: 0.8
});
// Limit points
if (attractor.points.length > attractor.maxPoints) {
attractor.points.shift();
}
// Draw points with trail effect
attractor.points.forEach((point, i) => {
const age = i / attractor.points.length;
const opacity = point.opacity * (1 - age) * (Math.sin(time * 0.0002) * 0.3 + 0.7);
const size = point.size * (1 - age * 0.8);
const hue = (time * 0.0001 + i * 0.001) % 1;
const color = `hsl(${hue * 360}, 80%, 60%)`;
ctx.fillStyle = color;
ctx.beginPath();
ctx.arc(point.x, point.y, size * 0.5, 0, Math.PI * 2);
ctx.fill();
});
// Draw central core
ctx.fillStyle = palette.accent;
ctx.beginPath();
ctx.arc(canvas.width/2, canvas.height/2, 5, 0, Math.PI * 2);
ctx.fill();
// Update time
time += 16; // ~60fps
requestAnimationFrame(animate);
}
animate();
</script>
</body>
</html>