Files
rm-circle-team-router/public/fast-start.js
T
martbost d936093c56 Add the printable 48-Hour Fast Start sheet
/fast-start: one-page checklist that personalizes with the member's
ID, invite link, and a scannable QR of /join/<id> when opened from
their dashboard (or with ?id=). Print stylesheet flips it to clean
black-on-white letter format; floating translate/chat widgets are
now excluded from printing on every page. Dashboard share card
links to it; chatbot + AI prompt synced.
2026-08-21 12:08:05 -05:00

26 lines
1.1 KiB
JavaScript

// Personalize the printable Fast Start sheet: member ID from ?id= or the
// dashboard's saved ID, invite link + high-res QR of /join/<id> (the moving
// link — scans route to the member's page and self-rotate like the share card).
(function(){
function getId(){
var q=new URLSearchParams(location.search).get('id');
if(q&&/^\d+$/.test(q))return q;
try{var s=localStorage.getItem('ctb.myId');if(s&&/^\d+$/.test(s))return s;}catch(e){}
return '';
}
var id=getId();
if(!id)return; // blank sheet still prints fine with fill-in-by-hand blanks
var link='rmcircle.team/join/'+id;
var el=document.getElementById('fsId'); if(el)el.textContent='#'+id;
el=document.getElementById('fsLink'); if(el)el.textContent=link;
var qr=document.getElementById('fsQr');
if(qr&&typeof qrcode==='function'){
try{
var q=qrcode(0,'M');q.addData('https://'+link);q.make();
qr.innerHTML=q.createSvgTag({cellSize:4,margin:2,scalable:true});
}catch(e){}
}
var btn=document.getElementById('fsPrintBtn');
if(btn)btn.addEventListener('click',function(){window.print();});
})();