CoolFace
Apppublic

HirModel/wardenclyffe-technical-bridge-layer

sourceHugging Facecc-by-nc-sa-4.0updated 4mo agoView on Hugging Face
0likes
app.js48 linesDownload Raw Back to root
1 2const D = window.BRIDGE_DATA;3const $ = (id) => document.getElementById(id);4$('trk').textContent = D.receipt.trace_resonance_key;5 6function shortHash(h){ return h ? h.slice(0,12).toUpperCase() : 'MISSING'; }7 8$('sources').innerHTML = D.manifest.sources.map(s => `9  <div class="source">10    <b>${s.source_id}</b> — ${s.title || ''}11    <div class="muted">${s.source_class}</div>12    <div class="muted">Use: ${s.use_in_layer}</div>13    <div class="mono">SHA-256: ${shortHash(s.sha256)}…</div>14  </div>15`).join('');16 17const sourceFilters = ['ALL', ...new Set(D.atoms.map(a => a.source_id))];18let current = 'ALL';19function renderTabs(){20  $('tabs').innerHTML = sourceFilters.map(f => `<button class="tab ${f===current?'active':''}" data-filter="${f}">${f}</button>`).join('');21  document.querySelectorAll('.tab').forEach(b => b.onclick = () => { current = b.dataset.filter; renderTabs(); renderAtoms(); });22}23function renderAtoms(){24  const list = current==='ALL' ? D.atoms : D.atoms.filter(a => a.source_id===current);25  $('atoms').innerHTML = list.map(a => `26    <div class="atom">27      <div><span class="id">${a.atom_id}</span><span class="gate ${a.gate_status}">${a.gate_status}</span></div>28      <h3>${a.atom_type.replaceAll('_',' ')}</h3>29      <p>${a.derived_summary}</p>30      <p class="muted"><b>Source:</b> ${a.source_id} · ${a.source_location}</p>31      <p class="muted"><b>Coupling relevance:</b> ${a.coupling_relevance}</p>32      ${a.export_variable ? `<div class="mono">export: ${a.export_variable}</div>` : ''}33    </div>34  `).join('');35}36function renderGates(){37  const sum = D.receipt.gate_summary;38  const total = Object.values(sum).reduce((a,b)=>a+b,0) || 1;39  $('gates').innerHTML = Object.entries(sum).map(([k,v]) => `40    <p><b>${k}</b> <span class="muted">${v} atoms</span></p>41    <div class="bar"><span style="width:${Math.round((v/total)*100)}%"></span></div>42  `).join('');43}44$('blocked').innerHTML = D.simulatorExport.blocked_exports.map(x => `<li>${x.replaceAll('_',' ')}</li>`).join('');45$('edges').innerHTML = D.edgeRules.edge_types.map(e => `<li><b>${e.edge_type}</b><br><span class="muted">${e.description}</span></li>`).join('');46$('exports').innerHTML = D.simulatorExport.allowed_exports.map(x => `<li><code>${x}</code></li>`).join('');47renderTabs(); renderAtoms(); renderGates();48