Initial commit: RM Circle team sponsor router (bridge page, /start, /admin, Docker)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
let currentSponsor=null;
|
||||
async function load(){
|
||||
try{
|
||||
const [cr,sr]=await Promise.all([fetch('/api/public/config'),fetch('/api/public/current-sponsor')]);
|
||||
const c=await cr.json(); const s=await sr.json();
|
||||
if(!sr.ok)throw new Error(s.error||'No sponsor assigned');
|
||||
currentSponsor=s.sponsor;
|
||||
document.getElementById('sponsorId').textContent=`ID ${currentSponsor.id}`;
|
||||
document.getElementById('sponsorIdInline').textContent=currentSponsor.id;
|
||||
document.getElementById('sponsorName').textContent=currentSponsor.name||'Current Crypto Team Build placement';
|
||||
document.getElementById('progressText').textContent=`${currentSponsor.directs} / 2`;
|
||||
document.getElementById('progressBar').style.width=`${Math.min(100,(currentSponsor.directs/2)*100)}%`;
|
||||
document.getElementById('entryPol').textContent=c.premiumEntryPol;
|
||||
document.getElementById('entryPol2').textContent=c.premiumEntryPol;
|
||||
document.getElementById('joinButton').href=currentSponsor.referralUrl;
|
||||
document.getElementById('queueText').textContent=c.showQueueProgress?`${s.waitingCount} team placement${s.waitingCount===1?'':'s'} waiting behind the current sponsor.`:'';
|
||||
document.getElementById('supportBox').textContent=c.supportLabel||'Contact your team sponsor if you need help before joining.';
|
||||
if(c.telegramUrl){const w=document.getElementById('supportLinkWrap'),a=document.getElementById('supportLink');a.href=c.telegramUrl;w.classList.remove('hidden')}
|
||||
}catch(e){
|
||||
document.getElementById('sponsorName').textContent=e.message;
|
||||
document.getElementById('joinButton').classList.add('hidden');
|
||||
document.getElementById('copyButton').classList.add('hidden');
|
||||
}
|
||||
}
|
||||
document.getElementById('joinButton').addEventListener('click',()=>{fetch('/api/public/join-click',{method:'POST'}).catch(()=>{})});
|
||||
document.getElementById('copyButton').addEventListener('click',async()=>{
|
||||
if(!currentSponsor)return; await navigator.clipboard.writeText(currentSponsor.id); const b=document.getElementById('copyButton'); const old=b.textContent;b.textContent='Copied ✓';setTimeout(()=>b.textContent=old,1400)
|
||||
});
|
||||
load();
|
||||
Reference in New Issue
Block a user