d805a33608
Public /api/public/org-stats (from config.orgRootId, default 21) feeds a
prominent home-page band: share of the whole network, team size,
generations deep, and on-chain POL to the team — populated by bridge.js,
section hides itself if stats aren't ready. Paired with three mechanics
cards (spillover fills your matrix, depth pays as it climbs, the rotation
qualifies you) that make the "winning team" case honestly, plus the risk
caveat ("most participants may not profit") and a disclaimer link.
Live: 51.1% of members, 48 in the org, 10 generations, 25,423 POL.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
39 lines
2.4 KiB
JavaScript
39 lines
2.4 KiB
JavaScript
(async function(){
|
|
try{
|
|
const r=await fetch('/api/public/config');
|
|
if(!r.ok)return;
|
|
const c=await r.json();
|
|
document.title=`${c.siteName} | ${c.programName}`;
|
|
const bn=document.getElementById('brandName');if(bn&&c.siteName)bn.textContent=c.siteName;
|
|
const bp=document.getElementById('brandProgram');if(bp&&c.programName)bp.textContent=c.programName;
|
|
const sub=document.getElementById('bridgeSubheadline');
|
|
if(sub&&c.bridgeSubheadline)sub.textContent=c.bridgeSubheadline;
|
|
const h=document.getElementById('bridgeHeadline');
|
|
if(h&&c.bridgeHeadline)h.textContent=c.bridgeHeadline;
|
|
const qs=window.location.search; if(qs){document.querySelectorAll('a[href="/start"]').forEach(a=>a.href='/start'+qs)}
|
|
}catch(e){}
|
|
// team-by-the-numbers showcase — live org stats vs the whole network
|
|
try{
|
|
const grid=document.getElementById('teamStatGrid');
|
|
if(grid){
|
|
const os=await fetch('/api/public/org-stats').then(r=>r.ok?r.json():null).catch(()=>null);
|
|
if(os&&os.found){
|
|
const fmt=n=>Number(n||0).toLocaleString(undefined,{maximumFractionDigits:0});
|
|
grid.innerHTML=
|
|
`<div class="team-stat"><div class="num">${os.memberPct}%</div><small>of the entire network is on our team</small></div>`+
|
|
`<div class="team-stat"><div class="num teal">${fmt(os.orgMembers)}</div><small>members and growing</small></div>`+
|
|
`<div class="team-stat"><div class="num teal">${os.generations||0}</div><small>generations deep</small></div>`+
|
|
`<div class="team-stat"><div class="num ok">${fmt(os.orgPol)}</div><small>POL paid to our team, verifiable on-chain</small></div>`;
|
|
} else { const sec=grid.closest('section'); if(sec)sec.style.display='none'; }
|
|
}
|
|
}catch(e){ const g=document.getElementById('teamStatGrid'), sec=g&&g.closest('section'); if(sec)sec.style.display='none'; }
|
|
// fill each generation's crowd from data-n; cap the rendered icons so the
|
|
// deeper generations (up to 256) stay compact — the number label is the truth
|
|
const ICON_CAP=12;
|
|
document.querySelectorAll('.people[data-n]').forEach(node=>{
|
|
const n=parseInt(node.dataset.n,10)||0, show=Math.min(n,ICON_CAP);
|
|
for(let i=0;i<show;i++){const s=document.createElement('span');s.className='person';node.appendChild(s)}
|
|
if(n>ICON_CAP){const d=document.createElement('span');d.className='person-more';d.textContent='+';node.appendChild(d)}
|
|
});
|
|
})();
|