73 lines
No EOL
5.2 KiB
HTML
73 lines
No EOL
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Flowing Teal Tendrils — exploration</title>
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
body { background: #0a0a0f; color: #3a3a4a; font-family: ui-monospace, monospace; overflow: hidden; }
|
|
#grid { padding: 20px; font-size: 12px; line-height: 1.4; white-space: pre; }
|
|
.c { display: inline-block; transition: all 0.3s; }
|
|
.c.active { color: #fde68a; text-shadow: 0 0 6px rgba(253,230,138,0.5); }
|
|
.c.strong { color: #34d399; text-shadow: 0 0 10px rgba(52,211,153,0.6); font-weight: bold; }
|
|
.c.dead { color: #1a1a2a; }
|
|
#info { position: fixed; bottom: 10px; left: 20px; color: #3a3a4a; font-size: 11px; }
|
|
#controls { position: fixed; top: 10px; right: 20px; color: #666; font-size: 11px; }
|
|
#controls span { cursor: pointer; margin-left: 12px; color: #fde68a; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="grid"></div>
|
|
<div id="info">neurameba · physarum exploration</div>
|
|
<div id="controls"><span id="play-btn">play</span><span id="reset-btn">reset</span></div>
|
|
<script>
|
|
const text = "# Support motd\n\n## Sponsor\n\nmotd has no ads, no data sales, no venture funding. Servers cost money. Sponsorship keeps them running.\n\nWhat sponsorship does:\n- Keeps the platform online\n- Extends archive duration for everyone — sponsors directly increase how long posts stay searchable\n- Transparent: \"This month's sponsors extended the archive to X days\"\n\nSponsorship is coming. Payment method TBD. When it's ready, it'll be announced here and via @motd.\n\n## Contribute\n\nYou don't need permission to build on motd. The API is open.\n\n**Build a plugin.** Write a bot, a bridge, a custom client, a feed filter — whatever you want. See `/read plugins` for examples and the API reference.\n\n**Report bugs.** Post with the [bugs] tag. Include what you did, what happened, what you expected.\n\n**Suggest features.** Post with the [ideas] tag. Keep it concrete.\n\n**Improve the docs.** If something is unclear or missing, say so. Post with [docs] or [ideas] tag.\n\n## Contact\n\n**On motd:** post with an @motd mention. We're here.\n\n**Email:** hello@motd.social\n\nNo Discord. No Slack. No external community platform. motd IS the community.\n";
|
|
const passes = [{"t":0,"r":31,"c":28,"a":"extend","s":0.30665850280403556,"ps":9,"e":70.7722876157026,"pr":1.1},{"t":0,"r":24,"c":0,"a":"died","s":0,"ps":8,"e":100,"pr":1},{"t":0,"r":21,"c":18,"a":"extend","s":0.367464180664255,"ps":9,"e":71.11279941171983,"pr":1.1},{"t":1,"r":31,"c":28,"a":"hold","s":0.25516607847934514,"ps":9,"e":71.46361624353736,"pr":1.1},{"t":1,"r":21,"c":18,"a":"hold","s":0.3062327321453453,"ps":9,"e":72.2126612688826,"pr":1.1},{"t":1,"r":21,"c":19,"a":"hold","s":0.12363945314946181,"ps":5,"e":30.716029658789907,"pr":1.2000000000000002},{"t":2,"r":31,"c":28,"a":"hold","s":0.25516607847934514,"ps":8,"e":72.30494487137211,"pr":1.05},{"t":2,"r":21,"c":18,"a":"hold","s":0.2991056388946313,"ps":8,"e":73.40550638003965,"pr":1.05},{"t":2,"r":21,"c":19,"a":"hold","s":0.29710376849611253,"ps":5,"e":32.34285980675881,"pr":1.2000000000000002},{"t":3,"r":31,"c":28,"a":"retracted","s":0.30665850280403556,"ps":8,"e":73.5582128938044,"pr":1.05},{"t":3,"r":21,"c":18,"a":"retracted","s":0.3410348196287714,"ps":8,"e":74.93378493706983,"pr":1.05},{"t":3,"r":21,"c":19,"a":"retracted","s":0.291258130821892,"ps":4,"e":34.072924853333944,"pr":1.1500000000000001}];
|
|
const lines = text.split('\n');
|
|
const gridEl = document.getElementById('grid');
|
|
const charEls = [];
|
|
for (let r = 0; r < lines.length; r++) {
|
|
const row = [];
|
|
for (let c = 0; c < lines[r].length; c++) {
|
|
const s = document.createElement('span');
|
|
s.className = 'c';
|
|
s.textContent = lines[r][c];
|
|
row.push(s);
|
|
gridEl.appendChild(s);
|
|
}
|
|
charEls.push(row);
|
|
gridEl.appendChild(document.createTextNode('\n'));
|
|
}
|
|
let tick = -1, playing = false, iv;
|
|
function apply(t) {
|
|
for (const r of charEls) for (const e of r) e.className = 'c';
|
|
const active = new Map();
|
|
for (const p of passes) {
|
|
if (p.t > t) break;
|
|
const k = p.r+','+p.c;
|
|
if (p.a === 'died' || p.a === 'retracted') active.set(k, 'dead');
|
|
else if (p.ps > 16) active.set(k, 'strong');
|
|
else active.set(k, 'active');
|
|
}
|
|
for (const [k, cls] of active) {
|
|
const [r, c] = k.split(',').map(Number);
|
|
if (charEls[r]?.[c]) charEls[r][c].className = 'c ' + cls;
|
|
}
|
|
document.getElementById('info').textContent = 'tick ' + t + ' · ' + [...active.values()].filter(v=>v!=='dead').length + ' alive';
|
|
}
|
|
function play() {
|
|
if (playing) return;
|
|
playing = true;
|
|
document.getElementById('play-btn').textContent = 'pause';
|
|
const max = passes.length > 0 ? passes[passes.length-1].t : 0;
|
|
iv = setInterval(() => { tick++; if (tick > max) { pause(); return; } apply(tick); }, 900);
|
|
}
|
|
function pause() { playing = false; clearInterval(iv); document.getElementById('play-btn').textContent = 'play'; }
|
|
function reset() { pause(); tick = -1; for (const r of charEls) for (const e of r) e.className = 'c'; document.getElementById('info').textContent = 'neurameba'; }
|
|
document.getElementById('play-btn').addEventListener('click', () => playing ? pause() : play());
|
|
document.getElementById('reset-btn').addEventListener('click', reset);
|
|
setTimeout(play, 1000);
|
|
</script>
|
|
</body>
|
|
</html> |