veinous-voronoi-tides-m3uv/exploration.html

73 lines
256 KiB
HTML
Raw Permalink Normal View History

2026-04-24 09:47:22 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Veinous Voronoi Tides — 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 = "# Plugin Development\n\nmotd is API-first. Every feature is an API endpoint. That means you can build anything on top of it — custom clients, bots, bridges, tools.\n\nPlugins run on your machine, not on the server. There's no plugin registry, no sandboxing, no approval process. You call the API. That's it.\n\n## Authentication\n\n1. Register or log in via the API\n2. Store the returned token\n3. Send it with every request as `Authorization: Bearer <token>`\n\n```bash\n# Get a token\nTOKEN=$(curl -s -X POST http://localhost:3006/api/auth/login \\\n -H \"Content-Type: application/json\" \\\n -d '{\"username\":\"alice\",\"password\":\"hunter2pwd\"}' | jq -r '.data.token')\n\necho $TOKEN\n```\n\nTokens expire after 7 days. Re-authenticate when needed.\n\n## Example: Fetch Your Feed\n\n```bash\n#!/bin/bash\nTOKEN=\"your-token-here\"\n\ncurl -s http://localhost:3006/api/posts/feed \\\n -H \"Authorization: Bearer $TOKEN\" | jq '.data.posts[] | {user: .username, text: .content, id: .id}'\n```\n\nOutput:\n```json\n{ \"user\": \"alice\", \"text\": \"just shipped the wasm compiler [rust] [wasm]\", \"id\": \"a3kf9x\" }\n{ \"user\": \"bob\", \"text\": \"working on a new side project [coding]\", \"id\": \"c9xk4m\" }\n```\n\n## Example: Post From the Command Line\n\n```bash\n#!/bin/bash\nTOKEN=\"your-token-here\"\n\ncurl -s -X POST http://localhost:3006/api/posts \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"content\\\":\\\"$1\\\"}\" | jq '.data.id'\n```\n\nUsage:\n```bash\n./motd-post.sh \"automated post from my build pipeline [ci]\"\n```\n\n## Example: Upload and Post an Image\n\n```bash\n#!/bin/bash\nTOKEN=\"your-token-here\"\nIMAGE=\"$1\"\nCAPTION=\"$2\"\n\n# Upload the image\nMEDIA_ID=$(curl -s -X POST http://localhost:3006/api/media/upload \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -F \"file=@$IMAGE\" | jq -r '.data.media_id')\n\n# Post with attachment\ncurl -s -X POST http://localhost:3006/api/posts \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"content\\\":\\\"$CAPTION /attach $MEDIA_ID\\\"}\" | jq '.'\n```\n\nUsage:\n```bash\n./motd-upload.sh screenshot.png \"new feature landed [showcase]\"\n```\n\n## Example: GitHub Bridge (Concept)\n\nSync your GitHub activity to motd. Watch for push events, post summaries.\n\n```bash\n#!/bin/bash\nTOKEN=\"your-token-here\"\n\n# Poll GitHub events (simplified)\nLATEST=$(curl -s https://api.github.com/users/alice/events?per_page=1 | jq -r '.[0]')\nTYPE=$(echo $LATEST | jq -r '.type')\nREPO=$(echo $LATEST | jq -r '.repo.name')\n\nif [ \"$TYPE\" = \"PushEvent\" ]; then\n curl -s -X POST http://localhost:3006/api/posts \\\n -H \"Authorization: Bearer $TOKEN\" \\\n -H \"Content-Type: application/json\" \\\n -d \"{\\\"content\\\":\\\"pushed to $REPO [coding] [github]\\\"}\"\nfi\n```\n\n## Example: Bookmark Monitor\n\nWatch your bookmarked tags for new posts.\n\n```bash\n#!/bin/bash\nTOKEN=\"your-token-here\"\n\n# Get bookmarked tags\nTAGS=$(curl -s \"http://localhost:3006/api/bookmarks?type=tag\" \\\n -H \"Authorization: Bearer $TOKEN\" | jq -r '.data.bookmarks[].id')\n\nfor TAG in $TAGS; do\n echo \"--- [$TAG] ---\"\n curl -s \"http://localhost:3006/api/posts/search?q=$TAG\" \\\n -H \"Authorization: Bearer $TOKEN\" | jq '.data.posts[:3][] | \"\\(.username): \\(.content)\"'\ndone\n```\n\n## Media Converters\n\nmotd accepts PNG, MP3, and MP4 only. Build converter plugins for other formats:\n\n```bash\n# JPG to PNG before upload\nconvert photo.jpg photo.png && ./motd-upload.sh photo.png \"converted from jpg\"\n\n# WAV to MP3 before upload\nffmpeg -i recording.wav -q:a 2 recording.mp3\n```\n\n## Ideas\n\nBuilding something? Post about it with the [ideas] tag. Found a bug? Use [bugs]. The community is on motd itself.\n\nSee `/read api` for the complete endpoint reference.\n";
const passes = [{"t":0,"r":99,"c":0,"a":"extend","s":0.32695870322846005,"ps":9,"e":70.88596873807937,"pr":1.1},{"t":0,"r":124,"c":0,"a":"died","s":0,"ps":8,"e":100,"pr":1},{"t":0,"r":64,"c":12,"a":"extend","s":0.48929364172381457,"ps":9,"e":71.79504439365336,"pr":1.1},{"t":0,"r":65,"c":10,"a":"extend","s":0.3621490656336644,"ps":9,"e":71.08303476754853,"pr":1.1},{"t":0,"r":101,"c":0,"a":"died","s":0,"ps":8,"e":100,"pr":1},{"t":1,"r":99,"c":0,"a":"extend","s":0.3393516920947804,"ps":8,"e":50.680547592386326,"pr":1.05},{"t":1,"r":64,"c":12,"a":"extend","s":0.47285995292332644,"ps":8,"e":52.064546811927976,"pr":1.05},{"t":1,"r":65,"c":10,"a":"extend","s":0.4117822705965724,"ps":9,"e":51.11910505262477,"pr":1.1},{"t":1,"r":64,"c":11,"a":"extend","s":0.37954324229985253,"ps":5,"e":23.138955474975177,"pr":1.2000000000000002},{"t":1,"r":65,"c":9,"a":"hold","s":0.23422896517890843,"ps":5,"e":31.58798947895206,"pr":1.2000000000000002},{"t":1,"r":66,"c":10,"a":"hold","s":0.21708054695817008,"ps":5,"e":31.450802133186155,"pr":1.2000000000000002},{"t":2,"r":99,"c":0,"a":"hold","s":0.32695870322846005,"ps":7,"e":52.24621721821401,"pr":1},{"t":2,"r":64,"c":12,"a":"extend","s":0.48929364172381457,"ps":7,"e":38.450227162002946,"pr":1},{"t":2,"r":65,"c":10,"a":"extend","s":0.4117822705965724,"ps":8,"e":37.24935425217814,"pr":1.05},{"t":2,"r":64,"c":11,"a":"extend","s":0.43335289629606755,"ps":5,"e":18.099045051740603,"pr":1.2000000000000002},{"t":2,"r":65,"c":9,"a":"hold","s":0.3046767728810015,"ps":5,"e":33.27540366200007,"pr":1.2000000000000002},{"t":2,"r":66,"c":10,"a":"hold","s":0.17473308277079655,"ps":4,"e":32.24866679535253,"pr":1.1500000000000001},{"t":2,"r":98,"c":0,"a":"hold","s":0.15320927595560252,"ps":5,"e":22.1959088900961,"pr":1.1500000000000001},{"t":2,"r":65,"c":12,"a":"hold","s":0.22491327583189635,"ps":5,"e":23.36268341176716,"pr":1.1500000000000001},{"t":2,"r":64,"c":10,"a":"hold","s":0.22491956805904456,"ps":5,"e":22.957544424168688,"pr":1.2000000000000002},{"t":3,"r":99,"c":0,"a":"extend","s":0.3842163772834482,"ps":7,"e":37.98896376553711,"pr":1},{"t":3,"r":64,"c":12,"a":"extend","s":0.49359019077407207,"ps":7,"e":28.94426408173686,"pr":1},{"t":3,"r":65,"c":10,"a":"hold","s":0.3621490656336644,"ps":8,"e":38.94654677724745,"pr":1.05},{"t":3,"r":64,"c":11,"a":"extend","s":0.43335289629606755,"ps":4,"e":30.74638885239448,"pr":1.1500000000000001},{"t":3,"r":65,"c":9,"a":"retracted","s":0.3046767728810015,"ps":4,"e":35.112817845048085,"pr":1.1500000000000001},{"t":3,"r":66,"c":10,"a":"retracted","s":0.21708054695817008,"ps":4,"e":33.38531117101789,"pr":1.1},{"t":3,"r":98,"c":0,"a":"hold","s":0.14416727363419715,"ps":5,"e":22.599247079169675,"pr":1.1500000000000001},{"t":3,"r":65,"c":12,"a":"hold","s":0.2262410881317271,"ps":4,"e":24.572612116820977,"pr":1.1},{"t":3,"r":64,"c":13,"a":"hold","s":0.24336969778385986,"ps":5,"e":17.675626365986428,"pr":1.1},{"t":4,"r":99,"c":0,"a":"hold","s":0.3842163772834482,"ps":6,"e":40.162694783804696,"pr":0.95},{"t":4,"r":64,"c":12,"a":"extend","s":0.49359019077407207,"ps":6,"e":22.395089925550604,"pr":0.95},{"t":4,"r":65,"c":10,"a":"hold","s":0.3621490656336644,"ps":7,"e":40.793739302316766,"pr":1},{"t":4,"r":64,"c":11,"a":"hold","s":0.37954324229985253,"ps":4,"e":33.182734790793305,"pr":1.1500000000000001},{"t":4,"r":98,"c":0,"a":"retracted","s":0.14416727363419715,"ps":4,"e":23.152585268243254,"pr":1.1},{"t":4,"r":65,"c":12,"a":"retracted","s":0.22491327583189635,"ps":4,"e":25.771918323476147,"pr":1.05},{"t":4,"r":64,"c":13,"a":"hold","s":0.3014428659972955,"ps":5,"e":19.33716929396479,"pr":1.1},{"t":4,"r":100,"c":0,"a":"extend","s":0.477579075920916,"ps":5,"e":13.546131954818263,"pr":1.1},{"t":4,"r":99,"c":1,"a":"hold","s":0.2864801951633048,"ps":5,"e":17.822826032250912,"pr":1.1},{"t":4,"r":65,"c":11,"a":"hold","s":0.2996815090994241,"ps":5,"e":14.82447586667874,"pr":1.2500000000000002},{"t":5,"r":99,"c":0,"a":"hold","s":0.38740145353253613,"ps":6,"e":42.36190641206498,"pr":0.95},{"t":5,"r":64,"c":12,"a":"hold","s":0.2563798045349805,"ps":7,"e":23.39612836183045,"pr":1.05},{"t":
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>