whispering-circuit-echoes-6y84/exploration.html

73 lines
571 KiB
HTML
Raw Permalink Normal View History

2026-04-04 17:47:17 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Whispering Circuit Echoes — 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 = "# motd — milestone\n\n## what's built\n\nTerminal-aesthetic social platform. Everything happens in a terminal UI — no chrome, no nav bars. Commands in, text out.\n\n### the shell\n\n- Full terminal interface in the browser — dark background, monospace, command input at the bottom\n- Centered terminal layout, 800px default width\n- Drag-to-resize from left/right edges — invisible 8px hit zones, min 400px\n- `/terminal --width` — set width in px, %, or reset to default\n- Width persisted in localStorage\n- Mobile: 100% width, no resize\n- All visual settings (colors, font, prompt format, welcome message) driven by `config.json`\n- Client-side config system — localStorage overrides merged with server defaults\n- `/config export` — download config as JSON\n- `/config import` — load config from JSON file, validated\n- `/config reset` — restore server defaults\n- `/+` `/` — font size increase/decrease (8-32px, persisted)\n- Command history with up/down arrow keys\n- Tab completion for all commands\n- Full sidebar — motd.social branding, commands, doc links, footer\n- Right-click context menu on interactive elements (usernames, tags, posts, doc links, media)\n- `/clear` wipes the terminal\n- `/help` and `/menu` show available commands\n- Favicon: m> SVG, dynamically generated from accent color\n- Guest landing shows last 5 posts on page load\n- 5 posts shown after login/register\n\n### auth\n\n- `/register` — interactive prompts, password masked via CSS (no browser autofill interference)\n- `/login` — session stored in sessionStorage (gone when tab closes)\n- `/login-permanently` — session stored in localStorage (persists)\n- `/logout` — clears session from both storages\n- Session restored on page load if valid\n- Browser password save triggered after successful login/register\n- Prompt updates: `guest@motd >` becomes `username@motd >`\n- Passwords hashed with bcrypt, validated (3-20 char usernames, 8+ char passwords)\n- Username blacklist: `motd*` prefix regex + fixed list of reserved names\n- Rate limiting: auth (20/15min), posts (30/min), uploads (10/min)\n- Auth via Bearer token in Authorization header\n\n### profiles\n\n- `/profile` — view your own profile with ASCII avatar and stats\n- `/profile @user` — view another user's profile\n- `/avatar` — upload profile picture (PNG), processed to ASCII art for terminal display\n- `/settings` — update display name, bio, confirm_post preference\n- `/find <query>` — search users by username or display name\n- ASCII avatars: uploaded image converted to ASCII, or deterministic hash pattern as fallback\n\n### posts & feed\n\n- Dual-purpose input: text without `/` is a post, text with `/` is a command\n- `confirm_post` preference (default on) — shows \"Post this? (y/n)\" before posting\n- `/post <text>` — always posts immediately, skips confirmation\n- `/feed` — chronological feed, public (no login required). Authenticated users get kill-filtered results, guests get unfiltered\n- `/reply <id> <text>` — reply with grey quote block of parent post\n- `/re <text>` — reply to last displayed post (no ID needed)\n- `/goto <id>` — jump to a specific post\n- Tags use [brackets]: `[rust]`, `[music]`, `[coding]`\n- Tags stripped from displayed content, shown only as clickable links below\n- Tags auto-extracted from post content and auto-assigned to categories\n- Short alphanumeric IDs (6-8 chars) for posts and media\n\n### post lifecycle\n\n- Active: posts visible in feed for 30 days\n- Archived: moved to archive table, searchable for 90 more days\n- Purged: permanently deleted after 120 days total\n- Cron job runs daily — archives, purges, cleans dead filter references\n- `/find --archive` searches archived posts\n\n### discovery\n\n- `/find <query>` — search users and posts\n- `/find --archive <query>` — search archived posts\n- `/tree -cat` — browse categories and tags with clickable bracket links\n- `/link <target>` — universal navigation (user, tag, post, doc)\n- Categories: coding, creative, meta, general — wi
const passes = [{"t":0,"r":4,"c":59,"a":"hold","s":0.2587363391395649,"ps":9,"e":100.71989071311651,"pr":1.1},{"t":0,"r":154,"c":10,"a":"hold","s":0.25085663989213314,"ps":9,"e":100.65685311913707,"pr":1.1},{"t":0,"r":168,"c":9,"a":"hold","s":0.23383777274013953,"ps":9,"e":100.52070218192111,"pr":1.1},{"t":0,"r":43,"c":0,"a":"died","s":0,"ps":8,"e":100,"pr":1},{"t":0,"r":118,"c":11,"a":"extend","s":0.4247404058395362,"ps":9,"e":71.4335462727014,"pr":1.1},{"t":1,"r":4,"c":59,"a":"hold","s":0.282664370996317,"ps":9,"e":101.63120568108705,"pr":1.1},{"t":1,"r":154,"c":10,"a":"hold","s":0.2510538134336244,"ps":9,"e":101.31528362660606,"pr":1.1},{"t":1,"r":168,"c":9,"a":"hold","s":0.26979282738040616,"ps":8,"e":101.47904480096436,"pr":1.05},{"t":1,"r":118,"c":11,"a":"extend","s":0.39604890975700413,"ps":9,"e":51.2763562855302,"pr":1.1},{"t":1,"r":118,"c":10,"a":"hold","s":0.09121694726736754,"ps":5,"e":30.594112552153828,"pr":1.2000000000000002},{"t":1,"r":119,"c":11,"a":"hold","s":0.15114416653229776,"ps":5,"e":31.07353030627327,"pr":1.2000000000000002},{"t":2,"r":4,"c":59,"a":"retracted","s":0.2767630966498742,"ps":8,"e":102.64531045428605,"pr":1.05},{"t":2,"r":154,"c":10,"a":"retracted","s":0.2510538134336244,"ps":8,"e":102.12371413407506,"pr":1.05},{"t":2,"r":168,"c":9,"a":"retracted","s":0.22493957194753492,"ps":7,"e":102.22856137654463,"pr":1},{"t":2,"r":118,"c":11,"a":"extend","s":0.39604890975700413,"ps":8,"e":37.27132329451036,"pr":1.05},{"t":2,"r":118,"c":10,"a":"hold","s":0.051969894566391825,"ps":5,"e":30.259871708684962,"pr":1.2000000000000002},{"t":2,"r":119,"c":11,"a":"hold","s":0.3093149455430041,"ps":5,"e":32.798049870617305,"pr":1.2000000000000002},{"t":2,"r":118,"c":12,"a":"hold","s":0.16611576411912116,"ps":5,"e":22.5545073781802,"pr":1.2000000000000002},{"t":3,"r":118,"c":11,"a":"extend","s":0.4247404058395362,"ps":8,"e":27.628472578858656,"pr":1.05},{"t":3,"r":118,"c":10,"a":"retracted","s":0.051969894566391825,"ps":4,"e":30.075630865216098,"pr":1.1500000000000001},{"t":3,"r":119,"c":11,"a":"retracted","s":0.3093149455430041,"ps":4,"e":34.67256943496134,"pr":1.1500000000000001},{"t":3,"r":118,"c":12,"a":"hold","s":0.16568254770276034,"ps":4,"e":23.279967759802283,"pr":1.1500000000000001},{"t":4,"r":118,"c":11,"a":"extend","s":0.4247404058395362,"ps":7,"e":20.98347707790246,"pr":1},{"t":4,"r":118,"c":12,"a":"retracted","s":0.16611576411912116,"ps":4,"e":24.00889387275525,"pr":1.1},{"t":5,"r":118,"c":11,"a":"extend","s":0.42009908599531726,"ps":7,"e":16.305988836105495,"pr":1},{"t":5,"r":118,"c":10,"a":"hold","s":0.2540635124677253,"ps":5,"e":10.275426847414286,"pr":1.1},{"t":6,"r":118,"c":11,"a":"extend","s":0.42009908599531726,"ps":6,"e":13.136747066847622,"pr":0.95},{"t":6,"r":118,"c":10,"a":"hold","s":0.2347635297459396,"ps":5,"e":11.403535085381803,"pr":1.1},{"t":6,"r":119,"c":11,"a":"hold","s":0.1705976241215769,"ps":5,"e":7.603061922732113,"pr":1.1},{"t":6,"r":118,"c":12,"a":"hold","s":0.18373884998997142,"ps":5,"e":7.708191729679269,"pr":1.1},{"t":7,"r":118,"c":11,"a":"hold","s":0.38011279783246066,"ps":6,"e":15.277649449507308,"pr":0.95},{"t":7,"r":118,"c":10,"a":"retracted","s":0.2347635297459396,"ps":4,"e":12.68164332334932,"pr":1.05},{"t":7,"r":119,"c":11,"a":"hold","s":0.11891407791042173,"ps":5,"e":7.804374546015487,"pr":1.1},{"t":7,"r":118,"c":12,"a":"hold","s":0.182732110811882,"ps":5,"e":8.420048616174325,"pr":1.1},{"t":8,"r":118,"c":11,"a":"extend","s":0.38011279783246066,"ps":5,"e":12.297986282516893,"pr":0.8999999999999999},{"t":8,"r":119,"c":11,"a":"retracted","s":0.11891407791042173,"ps":4,"e":8.155687169298862,"pr":1.05},{"t":8,"r":118,"c":12,"a":"retracted","s":0.182732110811882,"ps":4,"e":9.281905502669382,"pr":1.05},{"t":9,"r":118,"c":11,"a":"hold","s":0.2641592484335583,"ps":6,"e":13.51126026998536,"pr":0.9999999999999999},{"t":9,"r":118,"c":10,"a":"hold","s":0.09178379670730744,"ps":5,"e":5.254835923308557,"pr":0.9999999999999999},{"t":10,"r":118,"c":11,"a":"extend","s":0.3557678831407319,"ps":6,"e":10.82018233457785,"pr":0.9999999999999999},{"t":10,"r":118,"c":10,"a":"hold","s"
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>