| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta name="viewport" content="width=device-width,initial-scale=1"> |
| <title>Hurrian Hymn h.6 — 71-Shard NFT Collection</title> |
| <style> |
| *{box-sizing:border-box;margin:0;padding:0} |
| body{font:14px/1.5 'SF Mono',monospace;background:#0d1117;color:#c9d1d9;padding:1rem} |
| h1{font-size:1.4rem;color:#f0f6fc;margin-bottom:.3rem} |
| .sub{color:#8b949e;font-size:.8rem;margin-bottom:1rem} |
| .stats{display:flex;gap:1.5rem;flex-wrap:wrap;margin-bottom:1rem;font-size:.85rem} |
| .stat{background:#161b22;border:1px solid #30363d;border-radius:6px;padding:.4rem .8rem} |
| .stat b{color:#58a6ff} |
| .filters{margin-bottom:1rem;display:flex;gap:.5rem;flex-wrap:wrap} |
| .filters button{background:#21262d;color:#c9d1d9;border:1px solid #30363d;border-radius:4px;padding:3px 10px;cursor:pointer;font-size:.75rem} |
| .filters button.active{background:#1f6feb;border-color:#1f6feb;color:#fff} |
| .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:6px;margin-bottom:1rem} |
| .tile{position:relative;cursor:pointer;border:2px solid #30363d;border-radius:4px;overflow:hidden;aspect-ratio:1;transition:transform .15s} |
| .tile:hover{transform:scale(1.05);z-index:1} |
| .tile.prime{border-color:#ffd700} |
| .tile.collected{opacity:1}.tile:not(.collected){opacity:.6} |
| .tile img{width:100%;height:100%;display:block} |
| .tile .label{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,.7);font-size:9px;padding:1px 3px;color:#c9d1d9;text-align:center} |
| .detail{position:fixed;top:0;right:-50%;width:50%;height:100%;background:#161b22;border-left:2px solid #30363d;overflow-y:auto;transition:right .3s;padding:1rem;z-index:10} |
| .detail.open{right:0} |
| .detail h2{font-size:1.1rem;color:#f0f6fc;margin-bottom:.5rem} |
| .close{position:absolute;top:.5rem;right:.5rem;background:none;border:none;color:#8b949e;font-size:1.5rem;cursor:pointer} |
| .layer-tabs{display:flex;gap:4px;margin:.5rem 0;flex-wrap:wrap} |
| .layer-tabs button{background:#21262d;color:#8b949e;border:1px solid #30363d;border-radius:4px;padding:2px 8px;cursor:pointer;font-size:.7rem} |
| .layer-tabs button.active{background:#238636;border-color:#238636;color:#fff} |
| .layer-content{background:#0d1117;border:1px solid #30363d;border-radius:4px;padding:.5rem;font-size:.75rem;max-height:300px;overflow:auto;white-space:pre-wrap;word-break:break-all;margin:.5rem 0} |
| .stego-canvas{border:1px solid #30363d;border-radius:4px;margin:.5rem 0} |
| .progress{background:#21262d;border-radius:4px;height:8px;margin:.5rem 0} |
| .progress-bar{background:linear-gradient(90deg,#238636,#ffd700);height:100%;border-radius:4px;transition:width .3s} |
| .hex{color:#7ee787}.cunei{color:#ffd700;font-size:1.2rem} |
| canvas{image-rendering:pixelated} |
| </style> |
| </head> |
| <body> |
| <h1>𒀸𒌑𒄴𒊑 Hurrian Hymn h.6 — 71-Shard NFT Collection</h1> |
| <p class="sub">Tablet RS 15.30 · ~1400 BC · Ugarit · West (1994) · DA51 CBOR · Groth16/BN254 · 6-Layer Stego</p> |
|
|
| <div class="stats"> |
| <div class="stat">Collected: <b id="count">0</b>/71</div> |
| <div class="stat">Decoded: <b id="decoded">0</b> B</div> |
| <div class="stat">Stego: <b id="stego-status">—</b></div> |
| <div class="stat">ZK: <b id="zk-status">pending</b></div> |
| </div> |
|
|
| <div class="progress"><div class="progress-bar" id="pbar" style="width:0%"></div></div> |
|
|
| <div class="filters" id="filters"></div> |
| <div class="grid" id="grid"></div> |
|
|
| <div class="detail" id="detail"> |
| <button class="close" onclick="closeDetail()">×</button> |
| <h2 id="detail-title"></h2> |
| <canvas id="tile-canvas" class="stego-canvas" width="512" height="512"></canvas> |
| <div class="layer-tabs" id="layer-tabs"></div> |
| <div class="layer-content" id="layer-content"></div> |
| </div> |
|
|
| <script> |
| const BASE = 'https://solana.solfunmeme.com/retro-sync'; |
| const TILES_URL = BASE + '/tiles'; |
| const SHARDS_URL = BASE + '/shards'; |
| |
| const CATEGORIES = ['generator','source','artifact','witness','eigenspace','metadata','reconstruction','reference','youtube','pipeline','reserved']; |
| const CAT_COLORS = {generator:'#ffd700',source:'#d2a8ff',artifact:'#7ee787',witness:'#e3b341',eigenspace:'#79c0ff',metadata:'#ff7b72',reconstruction:'#a5d6ff',reference:'#d29922',youtube:'#f778ba',pipeline:'#56d364',reserved:'#484f58'}; |
| const PRIMES = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71]; |
| |
| const STEGO_PLANES = [ |
| {name:'R bit 0 — CBOR shard', ch:0, bit:0, color:'#ff6b6b'}, |
| {name:'G bit 0 — Witness', ch:1, bit:0, color:'#51cf66'}, |
| {name:'B bit 0 — Eigenspace', ch:2, bit:0, color:'#339af0'}, |
| {name:'R bit 1 — Source', ch:0, bit:1, color:'#ff922b'}, |
| {name:'G bit 1 — Notation', ch:1, bit:1, color:'#20c997'}, |
| {name:'B bit 1 — Cuneiform', ch:2, bit:1, color:'#845ef7'}, |
| ]; |
| |
| let manifest = null; |
| let collected = new Set(); |
| let shardCache = {}; |
| let stegoCache = {}; |
| let activeFilter = 'all'; |
| |
| async function init() { |
| const r = await fetch(BASE + '/manifest.json'); |
| manifest = await r.json(); |
| renderFilters(); |
| renderGrid(); |
| } |
| |
| function renderFilters() { |
| const el = document.getElementById('filters'); |
| let html = '<button class="active" onclick="setFilter(\'all\',this)">all (71)</button>'; |
| for (const cat of CATEGORIES) { |
| const n = manifest.shards.filter(s => s.category === cat).length; |
| if (n > 0) html += `<button onclick="setFilter('${cat}',this)">${cat} (${n})</button>`; |
| } |
| el.innerHTML = html; |
| } |
| |
| function setFilter(cat, btn) { |
| activeFilter = cat; |
| document.querySelectorAll('.filters button').forEach(b => b.classList.remove('active')); |
| btn.classList.add('active'); |
| renderGrid(); |
| } |
| |
| function renderGrid() { |
| const shards = activeFilter === 'all' ? manifest.shards : manifest.shards.filter(s => s.category === activeFilter); |
| const el = document.getElementById('grid'); |
| el.innerHTML = shards.map(s => { |
| const prime = PRIMES.includes(s.index); |
| const cls = [prime ? 'prime' : '', collected.has(s.index) ? 'collected' : ''].join(' '); |
| return `<div class="tile ${cls}" onclick="collect(${s.index})" title="#${s.index} ${s.name} [${s.category}]"> |
| <img src="${TILES_URL}/${String(s.index).padStart(2,'0')}.png" loading="lazy" alt="Shard ${s.index}"> |
| <div class="label">${prime?'★':'·'}${s.index} ${s.category}</div> |
| </div>`; |
| }).join(''); |
| } |
| |
| async function collect(idx) { |
| collected.add(idx); |
| document.getElementById('count').textContent = collected.size; |
| document.getElementById('pbar').style.width = (collected.size/71*100)+'%'; |
| |
| |
| if (!shardCache[idx]) { |
| try { |
| const r = await fetch(`${SHARDS_URL}/${String(idx).padStart(2,'0')}.json`); |
| shardCache[idx] = await r.json(); |
| } catch(e) { shardCache[idx] = {error: e.message}; } |
| } |
| |
| |
| if (!stegoCache[idx]) { |
| stegoCache[idx] = await decodeStegoFromImage(idx); |
| } |
| |
| updateStats(); |
| showDetail(idx); |
| renderGrid(); |
| if (collected.size === 71) reconstructPayload(); |
| } |
| |
| async function decodeStegoFromImage(idx) { |
| return new Promise((resolve) => { |
| const img = new Image(); |
| img.crossOrigin = 'anonymous'; |
| img.onload = () => { |
| const c = document.createElement('canvas'); |
| c.width = 512; c.height = 512; |
| const ctx = c.getContext('2d'); |
| ctx.drawImage(img, 0, 0); |
| const pixels = ctx.getImageData(0, 0, 512, 512).data; |
| |
| |
| const layers = {}; |
| for (const plane of STEGO_PLANES) { |
| const bytes = []; |
| const npx = 512*512; |
| const bytesPerLayer = npx / 8; |
| for (let i = 0; i < bytesPerLayer; i++) { |
| let byte = 0; |
| for (let b = 0; b < 8; b++) { |
| const px = i * 8 + b; |
| if (px >= npx) break; |
| const rgbaIdx = px * 4 + plane.ch; |
| byte |= ((pixels[rgbaIdx] >> plane.bit) & 1) << b; |
| } |
| bytes.push(byte); |
| } |
| layers[plane.name] = new Uint8Array(bytes); |
| } |
| resolve(layers); |
| }; |
| img.onerror = () => resolve({}); |
| img.src = `${TILES_URL}/${String(idx).padStart(2,'0')}.png`; |
| }); |
| } |
| |
| function updateStats() { |
| let totalBytes = 0; |
| for (const idx of collected) { |
| if (stegoCache[idx]) { |
| for (const layer of Object.values(stegoCache[idx])) { |
| totalBytes += layer.length; |
| } |
| } |
| } |
| document.getElementById('decoded').textContent = totalBytes.toLocaleString(); |
| document.getElementById('stego-status').textContent = `${collected.size}×6 planes`; |
| } |
| |
| function showDetail(idx) { |
| const s = manifest.shards.find(x => x.index === idx); |
| const detail = document.getElementById('detail'); |
| detail.className = 'detail open'; |
| const prime = PRIMES.includes(idx); |
| document.getElementById('detail-title').textContent = `${prime?'★':''} Shard #${idx} — ${s.name} [${s.category}]`; |
| |
| |
| const canvas = document.getElementById('tile-canvas'); |
| const ctx = canvas.getContext('2d'); |
| const img = new Image(); |
| img.crossOrigin = 'anonymous'; |
| img.onload = () => ctx.drawImage(img, 0, 0, 512, 512); |
| img.src = `${TILES_URL}/${String(idx).padStart(2,'0')}.png`; |
| |
| |
| const tabs = document.getElementById('layer-tabs'); |
| const layers = [ |
| {id:'json', name:'JSON Shard', color:'#58a6ff'}, |
| {id:'data_layers', name:'Data Layers', color:'#79c0ff'}, |
| ...STEGO_PLANES.map((p,i) => ({id:'stego_'+i, name:p.name, color:p.color})), |
| {id:'hex', name:'Raw Hex', color:'#7ee787'}, |
| {id:'visual', name:'Stego Visual', color:'#d2a8ff'}, |
| ]; |
| tabs.innerHTML = layers.map((l,i) => |
| `<button style="border-color:${l.color}" onclick="showLayer(${idx},'${l.id}',this)">${l.name}</button>` |
| ).join(''); |
| |
| showLayer(idx, 'json', tabs.firstChild); |
| } |
| |
| function showLayer(idx, layerId, btn) { |
| document.querySelectorAll('#layer-tabs button').forEach(b => b.classList.remove('active')); |
| if (btn) btn.classList.add('active'); |
| const el = document.getElementById('layer-content'); |
| const shard = shardCache[idx]; |
| const stego = stegoCache[idx] || {}; |
| |
| if (layerId === 'json') { |
| el.innerHTML = `<pre>${JSON.stringify(shard, null, 2).slice(0, 4000)}</pre>`; |
| } else if (layerId === 'data_layers') { |
| if (shard && shard.data_layers) { |
| const dl = shard.data_layers; |
| el.innerHTML = Object.keys(dl).map(k => { |
| const l = dl[k]; |
| return `<b>${k}</b>: chunk ${l.chunk}/${l.of}, ${l.total_bytes.toLocaleString()} B total\n` + |
| ` data: ${l.data.slice(0,80)}${l.data.length>80?'...':''}`; |
| }).join('\n\n'); |
| } else { |
| el.textContent = 'No data_layers in shard'; |
| } |
| } else if (layerId === 'hex') { |
| const bytes = stego[STEGO_PLANES[0].name]; |
| if (bytes) { |
| const hex = Array.from(bytes.slice(0, 256)).map(b => b.toString(16).padStart(2,'0')).join(' '); |
| el.innerHTML = `<span class="hex">${hex}</span>\n\n... ${bytes.length} bytes in R bit 0 plane`; |
| } else { |
| el.textContent = 'Collect this shard to decode stego'; |
| } |
| } else if (layerId === 'visual') { |
| visualizeStegoPlanes(idx); |
| el.textContent = 'Stego bit planes rendered on canvas above.\nEach plane shown as a separate color channel.'; |
| } else if (layerId.startsWith('stego_')) { |
| const pi = parseInt(layerId.split('_')[1]); |
| const plane = STEGO_PLANES[pi]; |
| const bytes = stego[plane.name]; |
| if (bytes) { |
| |
| let text = ''; |
| try { text = new TextDecoder('utf-8', {fatal: false}).decode(bytes.slice(0, 512)); } catch(e) {} |
| const nonNull = bytes.filter(b => b !== 0).length; |
| const hex = Array.from(bytes.slice(0, 128)).map(b => b.toString(16).padStart(2,'0')).join(' '); |
| el.innerHTML = `<b>${plane.name}</b>\nBytes: ${bytes.length} (${nonNull} non-zero)\n\n` + |
| `<b>Text preview:</b>\n${text.replace(/\0/g,'·').slice(0,300)}\n\n` + |
| `<b>Hex:</b>\n<span class="hex">${hex}</span>...`; |
| } else { |
| el.textContent = 'Collect this shard to decode'; |
| } |
| } |
| } |
| |
| function visualizeStegoPlanes(idx) { |
| const canvas = document.getElementById('tile-canvas'); |
| const ctx = canvas.getContext('2d'); |
| const stego = stegoCache[idx]; |
| if (!stego) return; |
| |
| |
| const imgData = ctx.createImageData(512, 512); |
| for (const plane of STEGO_PLANES) { |
| const bytes = stego[plane.name]; |
| if (!bytes) continue; |
| const color = plane.color; |
| const r = parseInt(color.slice(1,3),16); |
| const g = parseInt(color.slice(3,5),16); |
| const b = parseInt(color.slice(5,7),16); |
| for (let i = 0; i < bytes.length; i++) { |
| for (let bit = 0; bit < 8; bit++) { |
| const px = i * 8 + bit; |
| if (px >= 512*512) break; |
| if ((bytes[i] >> bit) & 1) { |
| const off = px * 4; |
| imgData.data[off] = Math.min(255, imgData.data[off] + r/6); |
| imgData.data[off+1] = Math.min(255, imgData.data[off+1] + g/6); |
| imgData.data[off+2] = Math.min(255, imgData.data[off+2] + b/6); |
| imgData.data[off+3] = 255; |
| } |
| } |
| } |
| } |
| ctx.putImageData(imgData, 0, 0); |
| } |
| |
| async function reconstructPayload() { |
| document.getElementById('zk-status').textContent = 'reconstructing...'; |
| |
| const allBytes = []; |
| const CAP = 512*512*6/8; |
| |
| for (let idx = 1; idx <= 71; idx++) { |
| const stego = stegoCache[idx]; |
| if (!stego) { allBytes.push(...new Array(CAP).fill(0)); continue; } |
| |
| |
| const img = await loadImagePixels(idx); |
| if (!img) { allBytes.push(...new Array(CAP).fill(0)); continue; } |
| |
| for (let i = 0; i < CAP; i++) { |
| let byte = 0; |
| for (let b = 0; b < 8; b++) { |
| const bitIdx = i * 8 + b; |
| const px = Math.floor(bitIdx / 6); |
| const plane = bitIdx % 6; |
| if (px >= 512*512) break; |
| const ch = plane % 3; |
| const bitPos = Math.floor(plane / 3); |
| const val = (img[px * 4 + ch] >> bitPos) & 1; |
| byte |= val << b; |
| } |
| allBytes.push(byte); |
| } |
| } |
| |
| |
| const data = new Uint8Array(allBytes); |
| const magic = String.fromCharCode(data[0], data[1], data[2], data[3]); |
| if (magic === 'NFT7') { |
| const view = new DataView(data.buffer); |
| const segCount = view.getUint32(4, true); |
| let offset = 8; |
| const segments = []; |
| for (let s = 0; s < segCount && offset < data.length; s++) { |
| const nameLen = view.getUint32(offset, true); offset += 4; |
| const name = new TextDecoder().decode(data.slice(offset, offset + nameLen)); offset += nameLen; |
| const dataLen = view.getUint32(offset, true); offset += 4; |
| const segData = data.slice(offset, offset + dataLen); offset += dataLen; |
| segments.push({name, data: segData, size: dataLen}); |
| } |
| |
| document.getElementById('zk-status').innerHTML = `<span style="color:#238636">✓ NFT7 DECODED</span> — ${segments.length} segments`; |
| |
| |
| const wav = segments.find(s => s.name === 'wav'); |
| if (wav) { |
| const blob = new Blob([wav.data], {type: 'audio/wav'}); |
| const url = URL.createObjectURL(blob); |
| const info = document.getElementById('layer-content'); |
| info.innerHTML = `<b>🎵 Full payload reconstructed from 71 stego tiles!</b>\n\n` + |
| segments.map(s => `${s.name}: ${s.size.toLocaleString()} bytes`).join('\n') + |
| `\n\n<audio controls src="${url}" style="width:100%"></audio>\n` + |
| `<a href="${url}" download="h6_west.wav" style="color:#58a6ff">⬇ Download WAV</a>`; |
| } |
| } else { |
| document.getElementById('zk-status').textContent = 'reconstruction failed — collect all 71'; |
| } |
| } |
| |
| function loadImagePixels(idx) { |
| return new Promise(resolve => { |
| const img = new Image(); |
| img.crossOrigin = 'anonymous'; |
| img.onload = () => { |
| const c = document.createElement('canvas'); |
| c.width = 512; c.height = 512; |
| const ctx = c.getContext('2d'); |
| ctx.drawImage(img, 0, 0); |
| resolve(ctx.getImageData(0, 0, 512, 512).data); |
| }; |
| img.onerror = () => resolve(null); |
| img.src = `${TILES_URL}/${String(idx).padStart(2,'0')}.png`; |
| }); |
| } |
| |
| function closeDetail() { |
| document.getElementById('detail').className = 'detail'; |
| } |
| |
| init(); |
| </script> |
| </body> |
| </html> |
|
|