73 lines
No EOL
6.1 KiB
HTML
73 lines
No EOL
6.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>Gray Nebula Pulse — 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 = "# Quick Start\n\n## Join\n\n```\n/register\n```\n\n## Post\n\nJust type. No `/` needed.\n\n```\nhello motd [introductions]\n```\n\nTags go in [brackets]. New tags are created automatically.\n\nUse `/post` to skip the confirm prompt.\n\n## Browse\n\n```\n/feed\n```\n\n## Find\n\n```\n/find rust\n/find @alice\n```\n\n## Reply\n\n```\n/reply abc123 nice work\n/re same but replies to last post you saw\n```\n\n## Profile\n\n```\n/avatar upload a profile pic\n/settings change name, bio\n/profile view yours\n/profile @alice view theirs\n```\n\n## Media\n\n```\n/upload pick a file (PNG, MP3, MP4)\n/post check this out /attach m3kf9x attach to post\n```\n\n## Hide noise\n\n```\n/kill @spammer\n/kill abc123\n```\n\nNobody knows. It just disappears.\n\n## More\n\n```\n/help all commands\n/read about what motd is\n/read commands full reference\n/tree -cat browse tags\n```\n";
|
|
const passes = [{"t":0,"r":46,"c":0,"a":"hold","s":0.2338816956775967,"ps":9,"e":100.52105356542077,"pr":1.1},{"t":0,"r":42,"c":0,"a":"extend","s":0.3189884019400614,"ps":9,"e":70.84133505086434,"pr":1.1},{"t":0,"r":53,"c":48,"a":"hold","s":0.2547572052134169,"ps":9,"e":100.68805764170733,"pr":1.1},{"t":0,"r":4,"c":2,"a":"extend","s":0.38459165584041727,"ps":9,"e":71.20871327270633,"pr":1.1},{"t":1,"r":46,"c":0,"a":"hold","s":0.24632183054235182,"ps":8,"e":101.29162820975958,"pr":1.05},{"t":1,"r":42,"c":0,"a":"hold","s":0.3130700240347119,"ps":8,"e":72.14589524314204,"pr":1.05},{"t":1,"r":53,"c":48,"a":"hold","s":0.24379564040550689,"ps":8,"e":101.43842276495138,"pr":1.05},{"t":1,"r":4,"c":2,"a":"extend","s":0.3577160689257639,"ps":8,"e":51.00930927687871,"pr":1.05},{"t":1,"r":5,"c":2,"a":"hold","s":0.12132733148934374,"ps":5,"e":30.738638625931753,"pr":1.2000000000000002},{"t":2,"r":46,"c":0,"a":"retracted","s":0.2338816956775967,"ps":7,"e":102.11268177518035,"pr":1},{"t":2,"r":42,"c":0,"a":"hold","s":0.3189884019400614,"ps":7,"e":73.64780245866253,"pr":1},{"t":2,"r":53,"c":48,"a":"retracted","s":0.2547572052134169,"ps":7,"e":102.42648040665871,"pr":1},{"t":2,"r":4,"c":2,"a":"extend","s":0.38459165584041727,"ps":7,"e":37.12522976652143,"pr":1},{"t":2,"r":5,"c":2,"a":"hold","s":0.14357566316373713,"ps":5,"e":31.13724393124165,"pr":1.2000000000000002},{"t":3,"r":42,"c":0,"a":"retracted","s":0.11832396075023144,"ps":8,"e":73.39439414466437,"pr":1.1},{"t":3,"r":4,"c":2,"a":"extend","s":0.39307240543106897,"ps":6,"e":27.558866306978988,"pr":0.95},{"t":3,"r":5,"c":2,"a":"retracted","s":0.14207857562151074,"ps":4,"e":31.673872536213736,"pr":1.1500000000000001},{"t":3,"r":4,"c":1,"a":"hold","s":0.1176281093337293,"ps":5,"e":16.10183763175045,"pr":1.1},{"t":4,"r":4,"c":2,"a":"hold","s":0.37452762076086693,"ps":5,"e":29.805087273065922,"pr":0.8999999999999999},{"t":4,"r":4,"c":1,"a":"hold","s":0.1280610588355381,"ps":5,"e":16.376326102434753,"pr":1.1},{"t":5,"r":4,"c":2,"a":"hold","s":0.27062772737266527,"ps":6,"e":31.070109092047243,"pr":0.9999999999999999},{"t":5,"r":4,"c":1,"a":"retracted","s":0.1280610588355381,"ps":4,"e":16.80081457311906,"pr":1.05},{"t":6,"r":4,"c":2,"a":"retracted","s":0.22687535932046118,"ps":5,"e":32.135111966610935,"pr":0.9499999999999998}];
|
|
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> |