0x9c77…3bd2

All memos sent from and to 0x9c77…3bd2.

(function () { const DATA = window.T256 || {}; const PROJECT_INFO = { description: [ "TERMINAL256 explores the shift from static images to systems.", "256 fully on-chain terminals each carrying a signal.", "The artwork is not fixed. It is continuously resolved through interaction." ], homepage: "https://terminal256.xyz", creator: "filter8", x: "https://x.com/0xfilter8" }; const cover = document.getElementById("cover"); const coverArt = document.getElementById("coverArt"); const miniArt = document.getElementById("miniArt"); const terminal = document.getElementById("terminal"); const historyEl = document.getElementById("history"); const inputEl = document.getElementById("cmdinput"); const phaseLine = document.getElementById("phaseLine"); const actionsEl = document.getElementById("actions"); let isOpen = false; let asciiRequestId = 0; function safe(v, fallback) { return v === undefined || v === null || v === "" ? fallback : v; } function num(v, fallback) { const n = Number(v); return Number.isFinite(n) ? n : fallback; } function clamp(v, min, max) { return Math.max(min, Math.min(max, v)); } function clearHistory() { historyEl.innerHTML = ""; } function scrollBottom() { historyEl.scrollTop = historyEl.scrollHeight; } function appendParagraph(className, text) { const p = document.createElement("p"); p.className = className; p.textContent = text || "\u00A0"; historyEl.appendChild(p); scrollBottom(); } function line(text, tone) { appendParagraph("t256-line" + (tone ? " " + tone : ""), text); } function htmlLine(html) { const p = document.createElement("p"); p.className = "t256-linkrow"; p.innerHTML = html; historyEl.appendChild(p); scrollBottom(); } function preBlock(text, className) { const pre = document.createElement("pre"); pre.className = className; pre.textContent = text; historyEl.appendChild(pre); scrollBottom(); } function asciiBlock(text) { preBlock(text, "t256-line t256-ascii"); } function mapBlock(text) { preBlock(text, "t256-line t256-map"); } function commandLine(text) { line("> " + text); } function artSrc() { return ( DATA.imageData || DATA.image || DATA.imageUrl || DATA.imageURI || "" ); } function makeArtNode(src) { if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const wrap = document.createElement("div"); wrap.innerHTML = src; return wrap; } const img = document.createElement("img"); img.src = src; img.alt = safe(DATA.collectionName, "TERMINAL256"); return img; } function mountArt(target) { if (!target) return; target.innerHTML = ""; const node = makeArtNode(artSrc()); if (node) target.appendChild(node); } function boot() { clearHistory(); phaseLine.textContent = safe(DATA.phaseLabel, "TERMINAL ONLINE"); line("node: #" + safe(DATA.tokenId, "--"), "strong"); line("signal: " + safe(DATA.currentSignalName, "UNKNOWN")); line("terminal online", "muted"); line("tap a command or type /info", "muted"); } function normalizeCommand(value) { const v = String(value || "").trim().toLowerCase(); if (!v) return ""; return v[0] === "/" ? v.slice(1) : v; } function padRight(str, width) { const s = String(str); return s.length >= width ? s : s + " ".repeat(width - s.length); } function padLeft(str, width) { const s = String(str); return s.length >= width ? s : " ".repeat(width - s.length) + s; } function encodeSignalCount(value) { const n = Math.max(0, Math.round(num(value, 0))); if (n <= 0) return "·"; const ones = n % 10; const tens = Math.floor(n / 10) % 10; const hundreds = Math.floor(n / 100) % 10; const thousands = Math.floor(n / 1000); return ( "█".repeat(thousands) + "▓".repeat(hundreds) + "▒".repeat(tens) + "░".repeat(ones) ); } function deriveSignalPowerScore() { if (DATA.signalPowerScore !== undefined && DATA.signalPowerScore !== null) { return clamp(Math.round(num(DATA.signalPowerScore, 0)), 0, 100); } let score = 0; score += num(DATA.affectedTargetsCount, num(DATA.affectedTargets, 0)) * 2; score += num(DATA.executeCount, 0); score += num(DATA.sendCount, 0); score += num(DATA.syncCount, 0); score += num(DATA.impulseCount, 0); score += num(DATA.broadcastCount, 0) * 2; score -= num(DATA.receivedEffectsCount, 0); return clamp(Math.round(Math.max(0, score)), 0, 100); } function deriveExecuteCount() { if (DATA.executeCount !== undefined && DATA.executeCount !== null) { return Math.max(0, Math.round(num(DATA.executeCount, 0))); } if (DATA.stats && DATA.stats.executeCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.executeCount, 0))); } return 0; } function deriveAffectedTargets() { if (DATA.affectedTargetsCount !== undefined && DATA.affectedTargetsCount !== null) { return Math.max(0, Math.round(num(DATA.affectedTargetsCount, 0))); } if (DATA.affectedTargets !== undefined && DATA.affectedTargets !== null) { return Math.max(0, Math.round(num(DATA.affectedTargets, 0))); } if (DATA.stats && DATA.stats.affectedTargetsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.affectedTargetsCount, 0))); } return 0; } function deriveReceivedEffects() { if (DATA.receivedEffectsCount !== undefined && DATA.receivedEffectsCount !== null) { return Math.max(0, Math.round(num(DATA.receivedEffectsCount, 0))); } if (DATA.stats && DATA.stats.receivedEffectsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.receivedEffectsCount, 0))); } return 0; } function deriveManualActions() { if (DATA.manualActionCount !== undefined && DATA.manualActionCount !== null) { return Math.max(0, Math.round(num(DATA.manualActionCount, 0))); } if (DATA.stats && DATA.stats.manualActionCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.manualActionCount, 0))); } return 0; } function deriveControllerActions() { const direct = (DATA.controllerActionCount !== undefined && DATA.controllerActionCount !== null) ? Math.max(0, Math.round(num(DATA.controllerActionCount, 0))) : 0; const owner = (DATA.executorOwnerActionCount !== undefined && DATA.executorOwnerActionCount !== null) ? Math.max(0, Math.round(num(DATA.executorOwnerActionCount, 0))) : 0; if (DATA.stats) { const directStats = DATA.stats.controllerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.controllerActionCount, 0))) : direct; const ownerStats = DATA.stats.executorOwnerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.executorOwnerActionCount, 0))) : owner; return directStats + ownerStats; } return direct + owner; } function deriveLockCount() { if (DATA.lockCount !== undefined && DATA.lockCount !== null) { return Math.max(0, Math.round(num(DATA.lockCount, 0))); } if (DATA.stats && DATA.stats.lockCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.lockCount, 0))); } return 0; } function openExternal(url) { try { const win = window.open(url, "_blank", "noopener,noreferrer"); if (win) return; } catch (err) {} try { window.location.href = url; } catch (err) {} } function rotate(arr, n) { const offset = ((n % arr.length) + arr.length) % arr.length; return arr.slice(offset).concat(arr.slice(0, offset)); } function signalGlyphSet() { const family = String(safe(DATA.signalFamilyName, "")).toUpperCase(); const signal = String(safe(DATA.currentSignalName, "")).toUpperCase(); const power = String(safe(DATA.signalPowerName, "")).toUpperCase(); const bgBase = ["░", "▒", "▁", "▔", "▚", "▞"]; const fgBase = ["▓", "█", "▙", "▟", "▛", "▜"]; let familyOffset = 0; if (family === "BROADCAST") familyOffset = 1; else if (family === "SYNC") familyOffset = 2; else if (family === "JAM") familyOffset = 3; else if (family === "PORTAL") familyOffset = 4; else if (family === "IMPULSE") familyOffset = 5; let signalOffset = 0; if (signal.includes("MINT")) signalOffset += 2; if (signal.includes("VOID")) signalOffset += 4; if (signal.includes("ECHO")) signalOffset += 1; if (signal.includes("GATE")) signalOffset += 3; let powerOffset = 0; if (power === "LOW") powerOffset = 1; else if (power === "MEDIUM") powerOffset = 2; else if (power === "HIGH") powerOffset = 3; else if (power === "STRONG") powerOffset = 4; else if (power === "DOMINANT") powerOffset = 5; const bgOffset = (familyOffset + signalOffset) % bgBase.length; const fgOffset = (familyOffset + signalOffset + powerOffset) % fgBase.length; return { bg: rotate(bgBase, bgOffset), fg: rotate(fgBase, fgOffset) }; } function cmdHelp() { line("INFO SIGNAL MAP ASCII", "strong"); line("OPEN HELP CLEAR EXIT"); line("/info /signal /map /ascii"); line("/open /help /clear /exit"); } function cmdInfo() { line("INFO", "strong"); for (let i = 0; i < PROJECT_INFO.description.length; i++) { line(PROJECT_INFO.description[i]); } line("creator: " + PROJECT_INFO.creator); htmlLine( 'home: <a class="t256-openlink" href="' + PROJECT_INFO.homepage + '" target="_blank" rel="noopener noreferrer">terminal256.xyz</a>' ); htmlLine( 'x: <a class="t256-openlink" href="' + PROJECT_INFO.x + '" target="_blank" rel="noopener noreferrer">x.com/0xfilter8</a>' ); } function cmdSignal() { line("SIGNAL", "strong"); line("current: " + safe(DATA.currentSignalName, "UNKNOWN")); line("family: " + safe(DATA.signalFamilyName, "UNKNOWN")); line("power: " + safe(DATA.signalPowerName, "DORMANT")); line("cooldown: " + safe(DATA.effectiveCooldown, 0) + "s"); } function cmdOpen() { line("OPEN", "strong"); line("Due to browser security, onchain functions below are not available in embedded (iframe) mode.", "muted"); htmlLine( 'Right click this link and open terminal in new tab (fullscreen): ' + '<a class="t256-openlink" href="' + window.location.href + '" target="_blank" rel="noopener noreferrer">OPEN TERMINAL256</a>' ); } function cmdMap() { const power = deriveSignalPowerScore(); const executions = deriveExecuteCount(); const affected = deriveAffectedTargets(); const received = deriveReceivedEffects(); const manual = deriveManualActions(); const control = deriveControllerActions(); const lock = deriveLockCount(); const rows = [ ["POWER", power, encodeSignalCount(power)], ["EXECUTIONS", executions, encodeSignalCount(executions)], ["AFFECTED", affected, encodeSignalCount(affected)], ["RECEIVED", received, encodeSignalCount(received)], ["MANUAL", manual, encodeSignalCount(manual)], ["CONTROL", control, encodeSignalCount(control)], ["LOCK", lock, encodeSignalCount(lock)] ]; const labelWidth = 11; const valueWidth = 4; const output = rows.map(function (row) { return ( padRight(row[0], labelWidth) + " " + padLeft(row[1], valueWidth) + " " + row[2] ); }).join("\n"); line("MAP", "strong"); mapBlock(output); } function imageSourceForAscii() { const src = artSrc(); if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const blob = new Blob([src], { type: "image/svg+xml;charset=utf-8" }); return URL.createObjectURL(blob); } return src; } function loadImage(src) { return new Promise(function (resolve, reject) { const img = new Image(); img.decoding = "async"; img.onload = function () { resolve(img); }; img.onerror = function () { reject(new Error("Image failed to load")); }; img.src = src; }); } async function tokenImageToAscii() { const src = imageSourceForAscii(); if (!src) return "ASCII UNAVAILABLE"; let objectUrlToRevoke = null; if (typeof src === "string" && src.startsWith("blob:")) { objectUrlToRevoke = src; } try { const img = await loadImage(src); const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d", { willReadFrequently: true }); const width = 64; const height = 64; canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, width, height); ctx.drawImage(img, 0, 0, width, height); const data = ctx.getImageData(0, 0, width, height).data; const glyphs = signalGlyphSet(); const rows = []; for (let y = 0; y < height; y++) { let row = ""; for (let x = 0; x < width; x++) { const i = (y * width + x) * 4; const r = data[i]; const g = data[i + 1]; const b = data[i + 2]; const a = data[i + 3]; if (a < 10) { row += " "; continue; } const lum = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255; let char; if (lum >= 0.6) { const normalized = (lum - 0.6) / 0.4; const idx = Math.max( 0, Math.min(glyphs.fg.length - 1, Math.floor(normalized * glyphs.fg.length)) ); char = glyphs.fg[idx]; } else { const normalized = lum / 0.6; const idx = Math.max( 0, Math.min(glyphs.bg.length - 1, Math.floor(normalized * glyphs.bg.length)) ); char = glyphs.bg[idx]; } row += char + char; } rows.push(row); } return rows.join("\n"); } finally { if (objectUrlToRevoke) { try { URL.revokeObjectURL(objectUrlToRevoke); } catch (err) {} } } } async function cmdAscii() { const requestId = ++asciiRequestId; line("ASCII", "strong"); line("rendering token image...", "muted"); try { const art = await tokenImageToAscii(); if (requestId !== asciiRequestId) return; asciiBlock(art); } catch (err) { if (requestId !== asciiRequestId) return; line("ascii render unavailable", "muted"); } } function focusInput() { if (!inputEl) return; try { inputEl.focus(); inputEl.click(); inputEl.setSelectionRange(inputEl.value.length, inputEl.value.length); } catch (err) {} } function openTerminal() { if (isOpen) return; isOpen = true; cover.classList.add("is-hidden"); terminal.classList.add("is-open"); boot(); focusInput(); } function closeTerminal() { isOpen = false; terminal.classList.remove("is-open"); cover.classList.remove("is-hidden"); } async function run(raw, silentPrompt) { const value = String(raw || "").trim(); if (!value) return; if (!silentPrompt) { commandLine(value); } const cmd = normalizeCommand(value); if (cmd === "help") return cmdHelp(); if (cmd === "info") return cmdInfo(); if (cmd === "signal") return cmdSignal(); if (cmd === "map") return cmdMap(); if (cmd === "ascii") return cmdAscii(); if (cmd === "open") return cmdOpen(); if (cmd === "clear") { clearHistory(); return; } if (cmd === "exit") { closeTerminal(); return; } line("command not found", "muted"); line("try /help", "muted"); } mountArt(coverArt); mountArt(miniArt); if (cover) { cover.addEventListener("click", openTerminal); cover.addEventListener("touchstart", openTerminal, { passive: true }); } if (terminal) { terminal.addEventListener("click", function (e) { const tag = e.target && e.target.tagName ? e.target.tagName.toLowerCase() : ""; if (tag !== "button" && tag !== "a") { focusInput(); } }); } if (actionsEl) { actionsEl.addEventListener("click", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; run(cmd, true); focusInput(); }); actionsEl.addEventListener("touchstart", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; e.preventDefault(); run(cmd, true); focusInput(); }, { passive: false }); } if (inputEl) { inputEl.addEventListener("keydown", function (e) { if (e.key === "Enter") { e.preventDefault(); const v = inputEl.value.trim(); inputEl.value = ""; run(v || "/info"); } }); } document.addEventListener("keydown", function (e) { if (!isOpen && (e.key === "Enter" || e.key === " ")) { e.preventDefault(); openTerminal(); return; } if (!isOpen) return; if (document.activeElement !== inputEl) { if (e.key === "Enter") { e.preventDefault(); run("/info", true); focusInput(); return; } if (e.key.length === 1 || e.key === "/" || e.key === "Backspace") { focusInput(); } } }); window.t256Run = run; })();
<body> <div id="app"> <div class="t256-cover" id="cover" aria-label="Open terminal"> <div class="t256-cover-inner"> <div class="t256-cover-art" id="coverArt"></div> <div class="t256-signal"></div> </div> </div> <div class="t256-terminal" id="terminal"> <div class="t256-terminal-top"> <div class="t256-miniart" id="miniArt"></div> <div class="t256-headercopy"> <div class="t256-line strong">TERMINAL_256</div> <div class="t256-line muted" id="phaseLine">TERMINAL ONLINE</div> </div> </div> <div class="t256-history" id="history"></div> <div class="t256-actions" id="actions"> <button type="button" class="t256-chip" data-cmd="/info">INFO</button> <button type="button" class="t256-chip" data-cmd="/signal">SIGNAL</button> <button type="button" class="t256-chip" data-cmd="/map">MAP</button> <button type="button" class="t256-chip" data-cmd="/ascii">ASCII</button> <button type="button" class="t256-chip" data-cmd="/open">OPEN</button> <button type="button" class="t256-chip" data-cmd="/help">HELP</button> <button type="button" class="t256-chip" data-cmd="/clear">CLEAR</button> </div> <div class="t256-inputrow"> <span class="t256-prompt">&gt;</span> <input id="cmdinput" class="t256-input" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" placeholder="/info" /> </div> </div> </div>
<!doctype html> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/> <title>TERMINAL256</title> <style> :root{ --bg:#3f3f3f; --fg:#f2f2f2; --muted:#c7c7c7; --pulse:rgba(242,242,242,.32); --chip-bg:rgba(242,242,242,.06); --chip-border:rgba(242,242,242,.18); --chip-hover:rgba(242,242,242,.14); --link:#f2f2f2; } *{box-sizing:border-box} html,body{ margin:0; padding:0; width:100%; height:100%; background:var(--bg); color:var(--fg); overflow:hidden; font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; } body{ background:var(--bg); } button, input{ font:inherit; } #app{ position:relative; width:100%; height:100%; background:var(--bg); overflow:hidden; } /* COVER */ .t256-cover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; cursor:pointer; background:var(--bg); transition:opacity .22s ease; } .t256-cover.is-hidden{ opacity:0; pointer-events:none; } .t256-cover-inner{ position:relative; width:min(86vmin, 1080px); height:min(86vmin, 1080px); display:flex; align-items:center; justify-content:center; } .t256-cover-art{ position:relative; z-index:2; width:100%; height:100%; display:flex; align-items:center; justify-content:center; transition:transform .22s ease, filter .22s ease; } .t256-cover-art img, .t256-cover-art svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-signal{ position:absolute; inset:0; z-index:3; pointer-events:none; } .t256-signal::before, .t256-signal::after{ content:""; position:absolute; left:50%; top:50%; width:72%; height:72%; transform:translate(-50%,-50%) scale(.82); border:2px solid rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; animation:none; } .t256-cover:hover .t256-cover-art{ transform:scale(1.04); filter:brightness(1.12); } .t256-cover:hover .t256-signal::before{ animation:t256pulse 1.1s ease-out infinite; } .t256-cover:hover .t256-signal::after{ animation:t256pulse 1.1s ease-out infinite .35s; } @keyframes t256pulse{ 0%{ transform:translate(-50%,-50%) scale(.82); border-color:rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; } 20%{ border-color:var(--pulse); box-shadow:0 0 24px rgba(242,242,242,.18); opacity:1; } 100%{ transform:translate(-50%,-50%) scale(1.12); border-color:rgba(242,242,242,0); box-shadow:0 0 48px rgba(242,242,242,0); opacity:0; } } /* TERMINAL */ .t256-terminal{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:20px; opacity:0; pointer-events:none; transition:opacity .22s ease; background:var(--bg); } .t256-terminal.is-open{ opacity:1; pointer-events:auto; } .t256-terminal-top{ display:flex; align-items:flex-start; gap:14px; margin-bottom:14px; position:relative; z-index:2; } .t256-miniart{ width:50px; height:50px; flex:0 0 50px; display:flex; align-items:center; justify-content:center; } .t256-miniart img, .t256-miniart svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-headercopy{ display:flex; flex-direction:column; gap:2px; } .t256-history{ position:relative; z-index:2; width:100%; max-width:100%; padding-bottom:108px; overflow:auto; scrollbar-width:none; } .t256-history::-webkit-scrollbar{ display:none; } .t256-line{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-line.muted{ color:var(--muted); } .t256-line.strong{ font-weight:700; } .t256-linkrow{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-openlink{ color:var(--link); text-decoration:underline; cursor:pointer; } .t256-openlink:visited{ color:var(--link); } .t256-actions{ position:absolute; left:20px; right:20px; bottom:44px; display:flex; flex-wrap:wrap; gap:6px; z-index:2; } .t256-chip{ appearance:none; border:1px solid var(--chip-border); background:var(--chip-bg); color:var(--fg); padding:6px 8px; border-radius:0; font-size:11px; line-height:1; cursor:pointer; min-height:30px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); } .t256-chip:hover, .t256-chip:active{ background:var(--chip-hover); } .t256-inputrow{ position:absolute; left:20px; right:20px; bottom:20px; display:flex; align-items:center; gap:8px; z-index:3; } .t256-prompt{ font-size:14px; line-height:1; color:var(--fg); } .t256-input{ flex:1; min-width:0; border:none; background:transparent; color:var(--fg); font:inherit; font-size:12px; outline:none; } .t256-input::placeholder{ color:rgba(242,242,242,.42); } .t256-ascii{ font-size:clamp(5px, .62vw, 10px); line-height:1; letter-spacing:0; white-space:pre; overflow:visible; max-width:none; margin:0 0 8px 0; } .t256-map{ font-size:12px; line-height:1.3; white-space:pre; overflow:visible; max-width:none; margin:0 0 8px 0; } @media (max-width: 640px){ .t256-terminal{ padding:14px; } .t256-terminal-top{ gap:10px; margin-bottom:10px; } .t256-miniart{ width:42px; height:42px; flex-basis:42px; } .t256-history{ max-width:100%; padding-bottom:118px; } .t256-line, .t256-linkrow, .t256-map{ font-size:11px; } .t256-ascii{ font-size:5px; line-height:1; } .t256-actions{ left:14px; right:14px; bottom:40px; gap:5px; } .t256-chip{ font-size:10px; padding:6px 7px; min-height:28px; } .t256-inputrow{ left:14px; right:14px; bottom:14px; } } </style> </head>
(function () { const DATA = window.T256 || {}; const PROJECT_INFO = { description: [ "TERMINAL256 explores the shift from static images to systems.", "256 fully on-chain terminals each carrying a signal.", "The artwork is not fixed. It is continuously resolved through interaction." ], homepage: "https://terminal.xyz", creator: "filter8", x: "https://x.com/0xfilter8" }; const cover = document.getElementById("cover"); const coverArt = document.getElementById("coverArt"); const miniArt = document.getElementById("miniArt"); const terminal = document.getElementById("terminal"); const historyEl = document.getElementById("history"); const inputEl = document.getElementById("cmdinput"); const phaseLine = document.getElementById("phaseLine"); const actionsEl = document.getElementById("actions"); let isOpen = false; let asciiRequestId = 0; function safe(v, fallback) { return v === undefined || v === null || v === "" ? fallback : v; } function num(v, fallback) { const n = Number(v); return Number.isFinite(n) ? n : fallback; } function clamp(v, min, max) { return Math.max(min, Math.min(max, v)); } function clearHistory() { historyEl.innerHTML = ""; } function scrollBottom() { historyEl.scrollTop = historyEl.scrollHeight; } function appendParagraph(className, text) { const p = document.createElement("p"); p.className = className; p.textContent = text || "\u00A0"; historyEl.appendChild(p); scrollBottom(); } function line(text, tone) { appendParagraph("t256-line" + (tone ? " " + tone : ""), text); } function htmlLine(html) { const p = document.createElement("p"); p.className = "t256-linkrow"; p.innerHTML = html; historyEl.appendChild(p); scrollBottom(); } function preBlock(text, className) { const pre = document.createElement("pre"); pre.className = className; pre.textContent = text; historyEl.appendChild(pre); scrollBottom(); } function asciiBlock(text) { preBlock(text, "t256-line t256-ascii"); } function mapBlock(text) { preBlock(text, "t256-line t256-map"); } function commandLine(text) { line("> " + text); } function artSrc() { return ( DATA.imageData || DATA.image || DATA.imageUrl || DATA.imageURI || "" ); } function makeArtNode(src) { if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const wrap = document.createElement("div"); wrap.innerHTML = src; return wrap; } const img = document.createElement("img"); img.src = src; img.alt = safe(DATA.collectionName, "TERMINAL256"); return img; } function mountArt(target) { if (!target) return; target.innerHTML = ""; const node = makeArtNode(artSrc()); if (node) target.appendChild(node); } function boot() { clearHistory(); phaseLine.textContent = safe(DATA.phaseLabel, "TERMINAL ONLINE"); line("node: #" + safe(DATA.tokenId, "--"), "strong"); line("signal: " + safe(DATA.currentSignalName, "UNKNOWN")); line("terminal online", "muted"); line("tap a command or type /info", "muted"); } function normalizeCommand(value) { const v = String(value || "").trim().toLowerCase(); if (!v) return ""; return v[0] === "/" ? v.slice(1) : v; } function padRight(str, width) { const s = String(str); return s.length >= width ? s : s + " ".repeat(width - s.length); } function padLeft(str, width) { const s = String(str); return s.length >= width ? s : " ".repeat(width - s.length) + s; } function encodeSignalCount(value) { const n = Math.max(0, Math.round(num(value, 0))); if (n <= 0) return "·"; const ones = n % 10; const tens = Math.floor(n / 10) % 10; const hundreds = Math.floor(n / 100) % 10; const thousands = Math.floor(n / 1000); return ( "█".repeat(thousands) + "▓".repeat(hundreds) + "▒".repeat(tens) + "░".repeat(ones) ); } function deriveSignalPowerScore() { if (DATA.signalPowerScore !== undefined && DATA.signalPowerScore !== null) { return clamp(Math.round(num(DATA.signalPowerScore, 0)), 0, 100); } let score = 0; score += num(DATA.affectedTargetsCount, num(DATA.affectedTargets, 0)) * 2; score += num(DATA.executeCount, 0); score += num(DATA.sendCount, 0); score += num(DATA.syncCount, 0); score += num(DATA.impulseCount, 0); score += num(DATA.broadcastCount, 0) * 2; score -= num(DATA.receivedEffectsCount, 0); return clamp(Math.round(Math.max(0, score)), 0, 100); } function deriveExecuteCount() { if (DATA.executeCount !== undefined && DATA.executeCount !== null) { return Math.max(0, Math.round(num(DATA.executeCount, 0))); } if (DATA.stats && DATA.stats.executeCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.executeCount, 0))); } return 0; } function deriveAffectedTargets() { if (DATA.affectedTargetsCount !== undefined && DATA.affectedTargetsCount !== null) { return Math.max(0, Math.round(num(DATA.affectedTargetsCount, 0))); } if (DATA.affectedTargets !== undefined && DATA.affectedTargets !== null) { return Math.max(0, Math.round(num(DATA.affectedTargets, 0))); } if (DATA.stats && DATA.stats.affectedTargetsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.affectedTargetsCount, 0))); } return 0; } function deriveReceivedEffects() { if (DATA.receivedEffectsCount !== undefined && DATA.receivedEffectsCount !== null) { return Math.max(0, Math.round(num(DATA.receivedEffectsCount, 0))); } if (DATA.stats && DATA.stats.receivedEffectsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.receivedEffectsCount, 0))); } return 0; } function deriveManualActions() { if (DATA.manualActionCount !== undefined && DATA.manualActionCount !== null) { return Math.max(0, Math.round(num(DATA.manualActionCount, 0))); } if (DATA.stats && DATA.stats.manualActionCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.manualActionCount, 0))); } return 0; } function deriveControllerActions() { const direct = (DATA.controllerActionCount !== undefined && DATA.controllerActionCount !== null) ? Math.max(0, Math.round(num(DATA.controllerActionCount, 0))) : 0; const owner = (DATA.executorOwnerActionCount !== undefined && DATA.executorOwnerActionCount !== null) ? Math.max(0, Math.round(num(DATA.executorOwnerActionCount, 0))) : 0; if (DATA.stats) { const directStats = DATA.stats.controllerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.controllerActionCount, 0))) : direct; const ownerStats = DATA.stats.executorOwnerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.executorOwnerActionCount, 0))) : owner; return directStats + ownerStats; } return direct + owner; } function deriveLockCount() { if (DATA.lockCount !== undefined && DATA.lockCount !== null) { return Math.max(0, Math.round(num(DATA.lockCount, 0))); } if (DATA.stats && DATA.stats.lockCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.lockCount, 0))); } return 0; } function openExternal(url) { try { const win = window.open(url, "_blank", "noopener,noreferrer"); if (win) return; } catch (err) {} try { window.location.href = url; } catch (err) {} } function rotate(arr, n) { const offset = ((n % arr.length) + arr.length) % arr.length; return arr.slice(offset).concat(arr.slice(0, offset)); } function signalGlyphSet() { const family = String(safe(DATA.signalFamilyName, "")).toUpperCase(); const signal = String(safe(DATA.currentSignalName, "")).toUpperCase(); const power = String(safe(DATA.signalPowerName, "")).toUpperCase(); const bgBase = ["░", "▒", "▁", "▔", "▚", "▞"]; const fgBase = ["▓", "█", "▙", "▟", "▛", "▜"]; let familyOffset = 0; if (family === "BROADCAST") familyOffset = 1; else if (family === "SYNC") familyOffset = 2; else if (family === "JAM") familyOffset = 3; else if (family === "PORTAL") familyOffset = 4; else if (family === "IMPULSE") familyOffset = 5; let signalOffset = 0; if (signal.includes("MINT")) signalOffset += 2; if (signal.includes("VOID")) signalOffset += 4; if (signal.includes("ECHO")) signalOffset += 1; if (signal.includes("GATE")) signalOffset += 3; let powerOffset = 0; if (power === "LOW") powerOffset = 1; else if (power === "MEDIUM") powerOffset = 2; else if (power === "HIGH") powerOffset = 3; else if (power === "STRONG") powerOffset = 4; else if (power === "DOMINANT") powerOffset = 5; const bgOffset = (familyOffset + signalOffset) % bgBase.length; const fgOffset = (familyOffset + signalOffset + powerOffset) % fgBase.length; return { bg: rotate(bgBase, bgOffset), fg: rotate(fgBase, fgOffset) }; } function cmdHelp() { line("INFO SIGNAL MAP ASCII", "strong"); line("OPEN HELP CLEAR EXIT"); line("/info /signal /map /ascii"); line("/open /help /clear /exit"); } function cmdInfo() { line("INFO", "strong"); for (let i = 0; i < PROJECT_INFO.description.length; i++) { line(PROJECT_INFO.description[i]); } line("creator: " + PROJECT_INFO.creator); htmlLine( 'home: <a class="t256-openlink" href="' + PROJECT_INFO.homepage + '" target="_blank" rel="noopener noreferrer">terminal.xyz</a>' ); htmlLine( 'x: <a class="t256-openlink" href="' + PROJECT_INFO.x + '" target="_blank" rel="noopener noreferrer">x.com/0xfilter8</a>' ); } function cmdSignal() { line("SIGNAL", "strong"); line("current: " + safe(DATA.currentSignalName, "UNKNOWN")); line("family: " + safe(DATA.signalFamilyName, "UNKNOWN")); line("power: " + safe(DATA.signalPowerName, "DORMANT")); line("cooldown: " + safe(DATA.effectiveCooldown, 0) + "s"); } function cmdOpen() { line("OPEN", "strong"); line("opening external view...", "muted"); openExternal(window.location.href); } function cmdMap() { const power = deriveSignalPowerScore(); const executions = deriveExecuteCount(); const affected = deriveAffectedTargets(); const received = deriveReceivedEffects(); const manual = deriveManualActions(); const control = deriveControllerActions(); const lock = deriveLockCount(); const rows = [ ["POWER", power, encodeSignalCount(power)], ["EXECUTIONS", executions, encodeSignalCount(executions)], ["AFFECTED", affected, encodeSignalCount(affected)], ["RECEIVED", received, encodeSignalCount(received)], ["MANUAL", manual, encodeSignalCount(manual)], ["CONTROL", control, encodeSignalCount(control)], ["LOCK", lock, encodeSignalCount(lock)] ]; const labelWidth = 11; const valueWidth = 4; const output = rows.map(function (row) { return ( padRight(row[0], labelWidth) + " " + padLeft(row[1], valueWidth) + " " + row[2] ); }).join("\n"); line("MAP", "strong"); mapBlock(output); } function imageSourceForAscii() { const src = artSrc(); if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const blob = new Blob([src], { type: "image/svg+xml;charset=utf-8" }); return URL.createObjectURL(blob); } return src; } function loadImage(src) { return new Promise(function (resolve, reject) { const img = new Image(); img.decoding = "async"; img.onload = function () { resolve(img); }; img.onerror = function () { reject(new Error("Image failed to load")); }; img.src = src; }); } async function tokenImageToAscii() { const src = imageSourceForAscii(); if (!src) return "ASCII UNAVAILABLE"; let objectUrlToRevoke = null; if (typeof src === "string" && src.startsWith("blob:")) { objectUrlToRevoke = src; } try { const img = await loadImage(src); const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d", { willReadFrequently: true }); const width = 64; const height = 64; canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, width, height); ctx.drawImage(img, 0, 0, width, height); const data = ctx.getImageData(0, 0, width, height).data; const glyphs = signalGlyphSet(); const rows = []; for (let y = 0; y < height; y++) { let row = ""; for (let x = 0; x < width; x++) { const i = (y * width + x) * 4; const r = data[i]; const g = data[i + 1]; const b = data[i + 2]; const a = data[i + 3]; if (a < 10) { row += " "; continue; } const lum = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255; let char; if (lum >= 0.6) { const normalized = (lum - 0.6) / 0.4; const idx = Math.max( 0, Math.min(glyphs.fg.length - 1, Math.floor(normalized * glyphs.fg.length)) ); char = glyphs.fg[idx]; } else { const normalized = lum / 0.6; const idx = Math.max( 0, Math.min(glyphs.bg.length - 1, Math.floor(normalized * glyphs.bg.length)) ); char = glyphs.bg[idx]; } row += char + char; } rows.push(row); } return rows.join("\n"); } finally { if (objectUrlToRevoke) { try { URL.revokeObjectURL(objectUrlToRevoke); } catch (err) {} } } } async function cmdAscii() { const requestId = ++asciiRequestId; line("ASCII", "strong"); line("rendering token image...", "muted"); try { const art = await tokenImageToAscii(); if (requestId !== asciiRequestId) return; asciiBlock(art); } catch (err) { if (requestId !== asciiRequestId) return; line("ascii render unavailable", "muted"); } } function focusInput() { if (!inputEl) return; try { inputEl.focus(); inputEl.click(); inputEl.setSelectionRange(inputEl.value.length, inputEl.value.length); } catch (err) {} } function openTerminal() { if (isOpen) return; isOpen = true; cover.classList.add("is-hidden"); terminal.classList.add("is-open"); boot(); focusInput(); } function closeTerminal() { isOpen = false; terminal.classList.remove("is-open"); cover.classList.remove("is-hidden"); } async function run(raw, silentPrompt) { const value = String(raw || "").trim(); if (!value) return; if (!silentPrompt) { commandLine(value); } const cmd = normalizeCommand(value); if (cmd === "help") return cmdHelp(); if (cmd === "info") return cmdInfo(); if (cmd === "signal") return cmdSignal(); if (cmd === "map") return cmdMap(); if (cmd === "ascii") return cmdAscii(); if (cmd === "open") return cmdOpen(); if (cmd === "clear") { clearHistory(); return; } if (cmd === "exit") { closeTerminal(); return; } line("command not found", "muted"); line("try /help", "muted"); } mountArt(coverArt); mountArt(miniArt); if (cover) { cover.addEventListener("click", openTerminal); cover.addEventListener("touchstart", openTerminal, { passive: true }); } if (terminal) { terminal.addEventListener("click", function (e) { const tag = e.target && e.target.tagName ? e.target.tagName.toLowerCase() : ""; if (tag !== "button" && tag !== "a") { focusInput(); } }); } if (actionsEl) { actionsEl.addEventListener("click", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; run(cmd, true); focusInput(); }); actionsEl.addEventListener("touchstart", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; e.preventDefault(); run(cmd, true); focusInput(); }, { passive: false }); } if (inputEl) { inputEl.addEventListener("keydown", function (e) { if (e.key === "Enter") { e.preventDefault(); const v = inputEl.value.trim(); inputEl.value = ""; run(v || "/info"); } }); } document.addEventListener("keydown", function (e) { if (!isOpen && (e.key === "Enter" || e.key === " ")) { e.preventDefault(); openTerminal(); return; } if (!isOpen) return; if (document.activeElement !== inputEl) { if (e.key === "Enter") { e.preventDefault(); run("/info", true); focusInput(); return; } if (e.key.length === 1 || e.key === "/" || e.key === "Backspace") { focusInput(); } } }); window.t256Run = run; })();
<body> <div id="app"> <div class="t256-cover" id="cover" aria-label="Open terminal"> <div class="t256-cover-inner"> <div class="t256-cover-art" id="coverArt"></div> <div class="t256-signal"></div> </div> </div> <div class="t256-terminal" id="terminal"> <div class="t256-terminal-top"> <div class="t256-miniart" id="miniArt"></div> <div class="t256-headercopy"> <div class="t256-line strong">TERMINAL_256</div> <div class="t256-line muted" id="phaseLine">TERMINAL ONLINE</div> </div> </div> <div class="t256-history" id="history"></div> <div class="t256-actions" id="actions"> <button type="button" class="t256-chip" data-cmd="/info">INFO</button> <button type="button" class="t256-chip" data-cmd="/signal">SIGNAL</button> <button type="button" class="t256-chip" data-cmd="/map">MAP</button> <button type="button" class="t256-chip" data-cmd="/ascii">ASCII</button> <button type="button" class="t256-chip" data-cmd="/open">OPEN</button> <button type="button" class="t256-chip" data-cmd="/help">HELP</button> <button type="button" class="t256-chip" data-cmd="/clear">CLEAR</button> </div> <div class="t256-inputrow"> <span class="t256-prompt">&gt;</span> <input id="cmdinput" class="t256-input" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" placeholder="/info" /> </div> </div> </div>
<!doctype html> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/> <title>TERMINAL256</title> <style> :root{ --bg:#3f3f3f; --fg:#f2f2f2; --muted:#c7c7c7; --pulse:rgba(242,242,242,.32); --chip-bg:rgba(242,242,242,.06); --chip-border:rgba(242,242,242,.18); --chip-hover:rgba(242,242,242,.14); --link:#f2f2f2; } *{box-sizing:border-box} html,body{ margin:0; padding:0; width:100%; height:100%; background:var(--bg); color:var(--fg); overflow:hidden; font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; } body{ background:var(--bg); } button, input{ font:inherit; } #app{ position:relative; width:100%; height:100%; background:var(--bg); overflow:hidden; } /* COVER */ .t256-cover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; cursor:pointer; background:var(--bg); transition:opacity .22s ease; } .t256-cover.is-hidden{ opacity:0; pointer-events:none; } .t256-cover-inner{ position:relative; width:min(86vmin, 1080px); height:min(86vmin, 1080px); display:flex; align-items:center; justify-content:center; } .t256-cover-art{ position:relative; z-index:2; width:100%; height:100%; display:flex; align-items:center; justify-content:center; transition:transform .22s ease, filter .22s ease; } .t256-cover-art img, .t256-cover-art svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-signal{ position:absolute; inset:0; z-index:3; pointer-events:none; } .t256-signal::before, .t256-signal::after{ content:""; position:absolute; left:50%; top:50%; width:72%; height:72%; transform:translate(-50%,-50%) scale(.82); border:2px solid rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; animation:none; } .t256-cover:hover .t256-cover-art{ transform:scale(1.04); filter:brightness(1.12); } .t256-cover:hover .t256-signal::before{ animation:t256pulse 1.1s ease-out infinite; } .t256-cover:hover .t256-signal::after{ animation:t256pulse 1.1s ease-out infinite .35s; } @keyframes t256pulse{ 0%{ transform:translate(-50%,-50%) scale(.82); border-color:rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; } 20%{ border-color:var(--pulse); box-shadow:0 0 24px rgba(242,242,242,.18); opacity:1; } 100%{ transform:translate(-50%,-50%) scale(1.12); border-color:rgba(242,242,242,0); box-shadow:0 0 48px rgba(242,242,242,0); opacity:0; } } /* TERMINAL */ .t256-terminal{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:20px; opacity:0; pointer-events:none; transition:opacity .22s ease; background:var(--bg); } .t256-terminal.is-open{ opacity:1; pointer-events:auto; } .t256-terminal-top{ display:flex; align-items:flex-start; gap:14px; margin-bottom:14px; position:relative; z-index:2; } .t256-miniart{ width:50px; height:50px; flex:0 0 50px; display:flex; align-items:center; justify-content:center; } .t256-miniart img, .t256-miniart svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-headercopy{ display:flex; flex-direction:column; gap:2px; } .t256-history{ position:relative; z-index:2; width:100%; max-width:100%; padding-bottom:108px; overflow:auto; scrollbar-width:none; } .t256-history::-webkit-scrollbar{ display:none; } .t256-line{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-line.muted{ color:var(--muted); } .t256-line.strong{ font-weight:700; } .t256-linkrow{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-openlink{ color:var(--link); text-decoration:underline; cursor:pointer; } .t256-openlink:visited{ color:var(--link); } .t256-actions{ position:absolute; left:20px; right:20px; bottom:44px; display:flex; flex-wrap:wrap; gap:6px; z-index:2; } .t256-chip{ appearance:none; border:1px solid var(--chip-border); background:var(--chip-bg); color:var(--fg); padding:6px 8px; border-radius:0; font-size:11px; line-height:1; cursor:pointer; min-height:30px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); } .t256-chip:hover, .t256-chip:active{ background:var(--chip-hover); } .t256-inputrow{ position:absolute; left:20px; right:20px; bottom:20px; display:flex; align-items:center; gap:8px; z-index:3; } .t256-prompt{ font-size:14px; line-height:1; color:var(--fg); } .t256-input{ flex:1; min-width:0; border:none; background:transparent; color:var(--fg); font:inherit; font-size:12px; outline:none; } .t256-input::placeholder{ color:rgba(242,242,242,.42); } .t256-ascii{ font-size:clamp(3px, .42vw, 7px); line-height:1; letter-spacing:0; white-space:pre; overflow:visible; max-width:none; margin:0 0 8px 0; } .t256-map{ font-size:12px; line-height:1.3; white-space:pre; overflow:visible; max-width:none; margin:0 0 8px 0; } @media (max-width: 640px){ .t256-terminal{ padding:14px; } .t256-terminal-top{ gap:10px; margin-bottom:10px; } .t256-miniart{ width:42px; height:42px; flex-basis:42px; } .t256-history{ max-width:100%; padding-bottom:118px; } .t256-line, .t256-linkrow, .t256-map{ font-size:11px; } .t256-ascii{ font-size:3px; line-height:1; } .t256-actions{ left:14px; right:14px; bottom:40px; gap:5px; } .t256-chip{ font-size:10px; padding:6px 7px; min-height:28px; } .t256-inputrow{ left:14px; right:14px; bottom:14px; } } </style> </head>
(function () { const DATA = window.T256 || {}; const PROJECT_INFO = { description: [ "TERMINAL256 explores the shift from static images to systems.", "256 fully on-chain terminals each carrying a signal.", "The artwork is not fixed. It is continuously resolved through interaction." ], homepage: "https://terminal.xyz", creator: "filter8", x: "https://x.com/0xfilter8" }; const cover = document.getElementById("cover"); const coverArt = document.getElementById("coverArt"); const miniArt = document.getElementById("miniArt"); const terminal = document.getElementById("terminal"); const historyEl = document.getElementById("history"); const inputEl = document.getElementById("cmdinput"); const phaseLine = document.getElementById("phaseLine"); const actionsEl = document.getElementById("actions"); let isOpen = false; let asciiRequestId = 0; function safe(v, fallback) { return v === undefined || v === null || v === "" ? fallback : v; } function num(v, fallback) { const n = Number(v); return Number.isFinite(n) ? n : fallback; } function clamp(v, min, max) { return Math.max(min, Math.min(max, v)); } function clearHistory() { historyEl.innerHTML = ""; } function scrollBottom() { historyEl.scrollTop = historyEl.scrollHeight; } function appendParagraph(className, text) { const p = document.createElement("p"); p.className = className; p.textContent = text || "\u00A0"; historyEl.appendChild(p); scrollBottom(); } function line(text, tone) { appendParagraph("t256-line" + (tone ? " " + tone : ""), text); } function htmlLine(html) { const p = document.createElement("p"); p.className = "t256-linkrow"; p.innerHTML = html; historyEl.appendChild(p); scrollBottom(); } function preBlock(text, className) { const pre = document.createElement("pre"); pre.className = className; pre.textContent = text; historyEl.appendChild(pre); scrollBottom(); } function asciiBlock(text) { preBlock(text, "t256-line t256-ascii"); } function mapBlock(text) { preBlock(text, "t256-line t256-map"); } function commandLine(text) { line("> " + text); } function artSrc() { return ( DATA.imageData || DATA.image || DATA.imageUrl || DATA.imageURI || "" ); } function makeArtNode(src) { if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const wrap = document.createElement("div"); wrap.innerHTML = src; return wrap; } const img = document.createElement("img"); img.src = src; img.alt = safe(DATA.collectionName, "TERMINAL256"); return img; } function mountArt(target) { if (!target) return; target.innerHTML = ""; const node = makeArtNode(artSrc()); if (node) target.appendChild(node); } function boot() { clearHistory(); phaseLine.textContent = safe(DATA.phaseLabel, "TERMINAL ONLINE"); line("node: #" + safe(DATA.tokenId, "--"), "strong"); line("signal: " + safe(DATA.currentSignalName, "UNKNOWN")); line("terminal online", "muted"); line("tap a command or type /info", "muted"); } function normalizeCommand(value) { const v = String(value || "").trim().toLowerCase(); if (!v) return ""; return v[0] === "/" ? v.slice(1) : v; } function padRight(str, width) { const s = String(str); return s.length >= width ? s : s + " ".repeat(width - s.length); } function padLeft(str, width) { const s = String(str); return s.length >= width ? s : " ".repeat(width - s.length) + s; } function encodeSignalCount(value) { const n = Math.max(0, Math.round(num(value, 0))); if (n <= 0) return "·"; const ones = n % 10; const tens = Math.floor(n / 10) % 10; const hundreds = Math.floor(n / 100) % 10; const thousands = Math.floor(n / 1000); return ( "█".repeat(thousands) + "▓".repeat(hundreds) + "▒".repeat(tens) + "░".repeat(ones) ); } function deriveSignalPowerScore() { if (DATA.signalPowerScore !== undefined && DATA.signalPowerScore !== null) { return clamp(Math.round(num(DATA.signalPowerScore, 0)), 0, 100); } let score = 0; score += num(DATA.affectedTargetsCount, num(DATA.affectedTargets, 0)) * 2; score += num(DATA.executeCount, 0); score += num(DATA.sendCount, 0); score += num(DATA.syncCount, 0); score += num(DATA.impulseCount, 0); score += num(DATA.broadcastCount, 0) * 2; score -= num(DATA.receivedEffectsCount, 0); return clamp(Math.round(Math.max(0, score)), 0, 100); } function deriveExecuteCount() { if (DATA.executeCount !== undefined && DATA.executeCount !== null) { return Math.max(0, Math.round(num(DATA.executeCount, 0))); } if (DATA.stats && DATA.stats.executeCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.executeCount, 0))); } return 0; } function deriveAffectedTargets() { if (DATA.affectedTargetsCount !== undefined && DATA.affectedTargetsCount !== null) { return Math.max(0, Math.round(num(DATA.affectedTargetsCount, 0))); } if (DATA.affectedTargets !== undefined && DATA.affectedTargets !== null) { return Math.max(0, Math.round(num(DATA.affectedTargets, 0))); } if (DATA.stats && DATA.stats.affectedTargetsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.affectedTargetsCount, 0))); } return 0; } function deriveReceivedEffects() { if (DATA.receivedEffectsCount !== undefined && DATA.receivedEffectsCount !== null) { return Math.max(0, Math.round(num(DATA.receivedEffectsCount, 0))); } if (DATA.stats && DATA.stats.receivedEffectsCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.receivedEffectsCount, 0))); } return 0; } function deriveManualActions() { if (DATA.manualActionCount !== undefined && DATA.manualActionCount !== null) { return Math.max(0, Math.round(num(DATA.manualActionCount, 0))); } if (DATA.stats && DATA.stats.manualActionCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.manualActionCount, 0))); } return 0; } function deriveControllerActions() { const direct = (DATA.controllerActionCount !== undefined && DATA.controllerActionCount !== null) ? Math.max(0, Math.round(num(DATA.controllerActionCount, 0))) : 0; const owner = (DATA.executorOwnerActionCount !== undefined && DATA.executorOwnerActionCount !== null) ? Math.max(0, Math.round(num(DATA.executorOwnerActionCount, 0))) : 0; if (DATA.stats) { const directStats = DATA.stats.controllerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.controllerActionCount, 0))) : direct; const ownerStats = DATA.stats.executorOwnerActionCount !== undefined ? Math.max(0, Math.round(num(DATA.stats.executorOwnerActionCount, 0))) : owner; return directStats + ownerStats; } return direct + owner; } function deriveLockCount() { if (DATA.lockCount !== undefined && DATA.lockCount !== null) { return Math.max(0, Math.round(num(DATA.lockCount, 0))); } if (DATA.stats && DATA.stats.lockCount !== undefined) { return Math.max(0, Math.round(num(DATA.stats.lockCount, 0))); } return 0; } function openExternal(url) { try { const win = window.open(url, "_blank", "noopener,noreferrer"); if (win) return; } catch (err) {} try { window.location.href = url; } catch (err) {} } function rotate(arr, n) { const offset = ((n % arr.length) + arr.length) % arr.length; return arr.slice(offset).concat(arr.slice(0, offset)); } function signalGlyphSet() { const family = String(safe(DATA.signalFamilyName, "")).toUpperCase(); const signal = String(safe(DATA.currentSignalName, "")).toUpperCase(); const power = String(safe(DATA.signalPowerName, "")).toUpperCase(); const bgBase = ["░", "▒", "▁", "▔", "▚", "▞"]; const fgBase = ["▓", "█", "▙", "▟", "▛", "▜"]; let familyOffset = 0; if (family === "BROADCAST") familyOffset = 1; else if (family === "SYNC") familyOffset = 2; else if (family === "JAM") familyOffset = 3; else if (family === "PORTAL") familyOffset = 4; else if (family === "IMPULSE") familyOffset = 5; let signalOffset = 0; if (signal.includes("MINT")) signalOffset += 2; if (signal.includes("VOID")) signalOffset += 4; if (signal.includes("ECHO")) signalOffset += 1; if (signal.includes("GATE")) signalOffset += 3; let powerOffset = 0; if (power === "LOW") powerOffset = 1; else if (power === "MEDIUM") powerOffset = 2; else if (power === "HIGH") powerOffset = 3; else if (power === "STRONG") powerOffset = 4; else if (power === "DOMINANT") powerOffset = 5; const bgOffset = (familyOffset + signalOffset) % bgBase.length; const fgOffset = (familyOffset + signalOffset + powerOffset) % fgBase.length; return { bg: rotate(bgBase, bgOffset), fg: rotate(fgBase, fgOffset) }; } function cmdHelp() { line("INFO SIGNAL MAP ASCII", "strong"); line("/info /signal /map /ascii"); line("/help /clear /exit"); } function cmdInfo() { line("INFO", "strong"); for (let i = 0; i < PROJECT_INFO.description.length; i++) { line(PROJECT_INFO.description[i]); } line("creator: " + PROJECT_INFO.creator); htmlLine( 'home: <button type="button" class="t256-openlink" data-open-url="' + PROJECT_INFO.homepage + '">terminal.xyz</button>' ); htmlLine( 'x: <button type="button" class="t256-openlink" data-open-url="' + PROJECT_INFO.x + '">x.com/0xfilter8</button>' ); } function cmdSignal() { line("SIGNAL", "strong"); line("current: " + safe(DATA.currentSignalName, "UNKNOWN")); line("family: " + safe(DATA.signalFamilyName, "UNKNOWN")); line("power: " + safe(DATA.signalPowerName, "DORMANT")); line("cooldown: " + safe(DATA.effectiveCooldown, 0) + "s"); } function cmdMap() { const power = deriveSignalPowerScore(); const executions = deriveExecuteCount(); const affected = deriveAffectedTargets(); const received = deriveReceivedEffects(); const manual = deriveManualActions(); const control = deriveControllerActions(); const lock = deriveLockCount(); const rows = [ ["POWER", power, encodeSignalCount(power)], ["EXECUTIONS", executions, encodeSignalCount(executions)], ["AFFECTED", affected, encodeSignalCount(affected)], ["RECEIVED", received, encodeSignalCount(received)], ["MANUAL", manual, encodeSignalCount(manual)], ["CONTROL", control, encodeSignalCount(control)], ["LOCK", lock, encodeSignalCount(lock)] ]; const labelWidth = 11; const valueWidth = 4; const output = rows.map(function (row) { return ( padRight(row[0], labelWidth) + " " + padLeft(row[1], valueWidth) + " " + row[2] ); }).join("\n"); line("MAP", "strong"); mapBlock(output); } function imageSourceForAscii() { const src = artSrc(); if (!src) return null; if (typeof src === "string" && src.trim().startsWith("<svg")) { const blob = new Blob([src], { type: "image/svg+xml;charset=utf-8" }); return URL.createObjectURL(blob); } return src; } function loadImage(src) { return new Promise(function (resolve, reject) { const img = new Image(); img.decoding = "async"; img.onload = function () { resolve(img); }; img.onerror = function () { reject(new Error("Image failed to load")); }; img.src = src; }); } async function tokenImageToAscii() { const src = imageSourceForAscii(); if (!src) return "ASCII UNAVAILABLE"; let objectUrlToRevoke = null; if (typeof src === "string" && src.startsWith("blob:")) { objectUrlToRevoke = src; } try { const img = await loadImage(src); const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d", { willReadFrequently: true }); const width = 64; const height = 64; canvas.width = width; canvas.height = height; ctx.clearRect(0, 0, width, height); ctx.drawImage(img, 0, 0, width, height); const data = ctx.getImageData(0, 0, width, height).data; const glyphs = signalGlyphSet(); const rows = []; for (let y = 0; y < height; y++) { let row = ""; for (let x = 0; x < width; x++) { const i = (y * width + x) * 4; const r = data[i]; const g = data[i + 1]; const b = data[i + 2]; const a = data[i + 3]; if (a < 10) { row += " "; continue; } const lum = (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255; let char; if (lum >= 0.6) { const normalized = (lum - 0.6) / 0.4; const idx = Math.max( 0, Math.min(glyphs.fg.length - 1, Math.floor(normalized * glyphs.fg.length)) ); char = glyphs.fg[idx]; } else { const normalized = lum / 0.6; const idx = Math.max( 0, Math.min(glyphs.bg.length - 1, Math.floor(normalized * glyphs.bg.length)) ); char = glyphs.bg[idx]; } row += char + char; } rows.push(row); } return rows.join("\n"); } finally { if (objectUrlToRevoke) { try { URL.revokeObjectURL(objectUrlToRevoke); } catch (err) {} } } } async function cmdAscii() { const requestId = ++asciiRequestId; line("ASCII", "strong"); line("rendering token image...", "muted"); try { const art = await tokenImageToAscii(); if (requestId !== asciiRequestId) return; asciiBlock(art); } catch (err) { if (requestId !== asciiRequestId) return; line("ascii render unavailable", "muted"); } } function focusInput() { if (!inputEl) return; try { inputEl.focus(); inputEl.click(); inputEl.setSelectionRange(inputEl.value.length, inputEl.value.length); } catch (err) {} } function openTerminal() { if (isOpen) return; isOpen = true; cover.classList.add("is-hidden"); terminal.classList.add("is-open"); boot(); focusInput(); } function closeTerminal() { isOpen = false; terminal.classList.remove("is-open"); cover.classList.remove("is-hidden"); } async function run(raw, silentPrompt) { const value = String(raw || "").trim(); if (!value) return; if (!silentPrompt) { commandLine(value); } const cmd = normalizeCommand(value); if (cmd === "help") return cmdHelp(); if (cmd === "info") return cmdInfo(); if (cmd === "signal") return cmdSignal(); if (cmd === "map") return cmdMap(); if (cmd === "ascii") return cmdAscii(); if (cmd === "clear") { clearHistory(); return; } if (cmd === "exit") { closeTerminal(); return; } line("command not found", "muted"); line("try /help", "muted"); } mountArt(coverArt); mountArt(miniArt); if (cover) { cover.addEventListener("click", openTerminal); cover.addEventListener("touchstart", openTerminal, { passive: true }); } if (terminal) { terminal.addEventListener("click", function (e) { const tag = e.target && e.target.tagName ? e.target.tagName.toLowerCase() : ""; if (tag !== "button") { focusInput(); } }); } if (historyEl) { historyEl.addEventListener("click", function (e) { const btn = e.target.closest("[data-open-url]"); if (!btn) return; e.preventDefault(); const url = btn.getAttribute("data-open-url"); if (url) openExternal(url); }); historyEl.addEventListener("touchstart", function (e) { const btn = e.target.closest("[data-open-url]"); if (!btn) return; e.preventDefault(); const url = btn.getAttribute("data-open-url"); if (url) openExternal(url); }, { passive: false }); } if (actionsEl) { actionsEl.addEventListener("click", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; run(cmd, true); focusInput(); }); actionsEl.addEventListener("touchstart", function (e) { const btn = e.target.closest("[data-cmd]"); if (!btn) return; const cmd = btn.getAttribute("data-cmd"); if (!cmd) return; e.preventDefault(); run(cmd, true); focusInput(); }, { passive: false }); } if (inputEl) { inputEl.addEventListener("keydown", function (e) { if (e.key === "Enter") { e.preventDefault(); const v = inputEl.value.trim(); inputEl.value = ""; run(v || "/info"); } }); } document.addEventListener("keydown", function (e) { if (!isOpen && (e.key === "Enter" || e.key === " ")) { e.preventDefault(); openTerminal(); return; } if (!isOpen) return; if (document.activeElement !== inputEl) { if (e.key === "Enter") { e.preventDefault(); run("/info", true); focusInput(); return; } if (e.key.length === 1 || e.key === "/" || e.key === "Backspace") { focusInput(); } } }); window.t256Run = run; })();
<body> <div id="app"> <div class="t256-cover" id="cover" aria-label="Open terminal"> <div class="t256-cover-inner"> <div class="t256-cover-art" id="coverArt"></div> <div class="t256-signal"></div> </div> </div> <div class="t256-terminal" id="terminal"> <div class="t256-terminal-top"> <div class="t256-miniart" id="miniArt"></div> <div class="t256-headercopy"> <div class="t256-line strong">TERMINAL_256</div> <div class="t256-line muted" id="phaseLine">TERMINAL ONLINE</div> </div> </div> <div class="t256-history" id="history"></div> <div class="t256-actions" id="actions"> <button type="button" class="t256-chip" data-cmd="/info">INFO</button> <button type="button" class="t256-chip" data-cmd="/signal">SIGNAL</button> <button type="button" class="t256-chip" data-cmd="/map">MAP</button> <button type="button" class="t256-chip" data-cmd="/ascii">ASCII</button> <button type="button" class="t256-chip" data-cmd="/help">HELP</button> <button type="button" class="t256-chip" data-cmd="/clear">CLEAR</button> </div> <div class="t256-inputrow"> <span class="t256-prompt">&gt;</span> <input id="cmdinput" class="t256-input" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" placeholder="/info" /> </div> </div> </div>
<!doctype html> <html> <head> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/> <title>TERMINAL256</title> <style> :root{ --bg:#3f3f3f; --fg:#f2f2f2; --muted:#c7c7c7; --pulse:rgba(242,242,242,.32); --chip-bg:rgba(242,242,242,.06); --chip-border:rgba(242,242,242,.18); --chip-hover:rgba(242,242,242,.14); --link:#f2f2f2; } *{box-sizing:border-box} html,body{ margin:0; padding:0; width:100%; height:100%; background:var(--bg); color:var(--fg); overflow:hidden; font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace; } body{ background:var(--bg); } button, input{ font:inherit; } #app{ position:relative; width:100%; height:100%; background:var(--bg); overflow:hidden; } /* COVER */ .t256-cover{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; cursor:pointer; background:var(--bg); transition:opacity .22s ease; } .t256-cover.is-hidden{ opacity:0; pointer-events:none; } .t256-cover-inner{ position:relative; width:min(86vmin, 1080px); height:min(86vmin, 1080px); display:flex; align-items:center; justify-content:center; } .t256-cover-art{ position:relative; z-index:2; width:100%; height:100%; display:flex; align-items:center; justify-content:center; transition:transform .22s ease, filter .22s ease; } .t256-cover-art img, .t256-cover-art svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-signal{ position:absolute; inset:0; z-index:3; pointer-events:none; } .t256-signal::before, .t256-signal::after{ content:""; position:absolute; left:50%; top:50%; width:72%; height:72%; transform:translate(-50%,-50%) scale(.82); border:2px solid rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; animation:none; } .t256-cover:hover .t256-cover-art{ transform:scale(1.04); filter:brightness(1.12); } .t256-cover:hover .t256-signal::before{ animation:t256pulse 1.1s ease-out infinite; } .t256-cover:hover .t256-signal::after{ animation:t256pulse 1.1s ease-out infinite .35s; } @keyframes t256pulse{ 0%{ transform:translate(-50%,-50%) scale(.82); border-color:rgba(242,242,242,0); box-shadow:0 0 0 rgba(242,242,242,0); opacity:0; } 20%{ border-color:var(--pulse); box-shadow:0 0 24px rgba(242,242,242,.18); opacity:1; } 100%{ transform:translate(-50%,-50%) scale(1.12); border-color:rgba(242,242,242,0); box-shadow:0 0 48px rgba(242,242,242,0); opacity:0; } } /* TERMINAL */ .t256-terminal{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start; padding:20px; opacity:0; pointer-events:none; transition:opacity .22s ease; background:var(--bg); } .t256-terminal.is-open{ opacity:1; pointer-events:auto; } .t256-terminal-top{ display:flex; align-items:flex-start; gap:14px; margin-bottom:14px; position:relative; z-index:2; } .t256-miniart{ width:50px; height:50px; flex:0 0 50px; display:flex; align-items:center; justify-content:center; } .t256-miniart img, .t256-miniart svg{ width:100%; height:100%; object-fit:contain; image-rendering:pixelated; image-rendering:crisp-edges; display:block; } .t256-headercopy{ display:flex; flex-direction:column; gap:2px; } .t256-history{ position:relative; z-index:2; width:min(760px, 100%); max-width:min(760px, 76vw); padding-bottom:108px; overflow:auto; scrollbar-width:none; } .t256-history::-webkit-scrollbar{ display:none; } .t256-line{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-line.muted{ color:var(--muted); } .t256-line.strong{ font-weight:700; } .t256-linkrow{ margin:0 0 7px 0; font-size:12px; line-height:1.35; color:var(--fg); white-space:pre-wrap; word-break:break-word; } .t256-openlink{ appearance:none; border:none; background:transparent; color:var(--link); text-decoration:underline; padding:0; margin:0; cursor:pointer; font:inherit; } .t256-actions{ position:absolute; left:20px; right:20px; bottom:44px; display:flex; flex-wrap:wrap; gap:6px; z-index:2; } .t256-chip{ appearance:none; border:1px solid var(--chip-border); background:var(--chip-bg); color:var(--fg); padding:6px 8px; border-radius:0; font-size:11px; line-height:1; cursor:pointer; min-height:30px; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08); } .t256-chip:hover, .t256-chip:active{ background:var(--chip-hover); } .t256-inputrow{ position:absolute; left:20px; right:20px; bottom:20px; display:flex; align-items:center; gap:8px; z-index:3; } .t256-prompt{ font-size:14px; line-height:1; color:var(--fg); } .t256-input{ flex:1; min-width:0; border:none; background:transparent; color:var(--fg); font:inherit; font-size:12px; outline:none; } .t256-input::placeholder{ color:rgba(242,242,242,.42); } .t256-ascii{ font-size:9px; line-height:1.08; letter-spacing:0; white-space:pre; overflow:auto; max-width:100%; margin:0 0 8px 0; } .t256-map{ font-size:12px; line-height:1.3; white-space:pre; overflow:auto; max-width:100%; margin:0 0 8px 0; } @media (max-width: 640px){ .t256-terminal{ padding:14px; } .t256-terminal-top{ gap:10px; margin-bottom:10px; } .t256-miniart{ width:42px; height:42px; flex-basis:42px; } .t256-history{ max-width:100%; padding-bottom:118px; } .t256-line, .t256-linkrow, .t256-map{ font-size:11px; } .t256-ascii{ font-size:6px; line-height:1.06; } .t256-actions{ left:14px; right:14px; bottom:40px; gap:5px; } .t256-chip{ font-size:10px; padding:6px 7px; min-height:28px; } .t256-inputrow{ left:14px; right:14px; bottom:14px; } } </style> </head>