diff --git a/public/my.js b/public/my.js index ead5220..285fac0 100644 --- a/public/my.js +++ b/public/my.js @@ -92,6 +92,8 @@ renderPitch(d); setTab(openDashTab?'dash':'pitch'); document.getElementById('dTitle').textContent='#'+d.id; + // hand the member's id to the tools page so every promo asset arrives pre-personalized + document.querySelectorAll('a[href="/tools"]').forEach(function(a){a.href='/tools?id='+d.id;}); const qb=document.getElementById('dQualified'); if(qb)qb.outerHTML=d.directCount>=2 ?'★ Qualified' diff --git a/public/tools.html b/public/tools.html index 16421d1..8af8279 100644 --- a/public/tools.html +++ b/public/tools.html @@ -18,7 +18,8 @@

🔗 Your invite link

Enter your RM Circle ID to build your personal invite page link — it shows a live preview when shared and points people to the current join steps.

-
→

Tip: always confirm the current sponsor on the Getting Started page before someone buys — placements rotate. Swap https://rmcircle.team for your personal link in any post below.

+
→

Tip: always confirm the current sponsor on the Getting Started page before someone buys — placements rotate.

+

📣 Social posts

Copy-paste ready for X/Twitter, Facebook, or anywhere. Tap Copy, tweak a word or two so it sounds like you, and post. Swap in your personal invite link where it fits.

diff --git a/public/tools.js b/public/tools.js index 9b5dc33..aafe5c3 100644 --- a/public/tools.js +++ b/public/tools.js @@ -12,6 +12,38 @@ const idIn=document.getElementById('toolId'), link=document.getElementById('shareLink'), copyShare=document.getElementById('copyShare'); function url(){ const id=(idIn.value||'').replace(/\D/g,'').slice(0,15); return id?`https://rmcircle.team/join/${id}`:''; } function render(){ link.textContent=url()||'https://rmcircle.team/join/…'; } - if(idIn){ idIn.addEventListener('input',render); render(); } + + // ---- personalization: every asset carries the member's own invite link ---- + // Replaces BARE https://rmcircle.team mentions (not /contract, /v/…, /banners/…) + // in both the copy payloads and the visible previews. ID comes from ?id= + // (dashboard hand-off), then localStorage, then the "Your link" box. + const BARE=/https:\/\/rmcircle\.team(?![\w./-])/g; + function personalize(){ + const id=(idIn&&idIn.value||'').replace(/\D/g,'').slice(0,15); + const mine=id?`https://rmcircle.team/join/${id}`:null; + document.querySelectorAll('.copy-btn').forEach(b=>{ + if(b.dataset.orig===undefined)b.dataset.orig=b.getAttribute('data-copy')||''; + b.setAttribute('data-copy', mine?b.dataset.orig.replace(BARE,mine):b.dataset.orig); + }); + document.querySelectorAll('pre.swipe').forEach(p=>{ + if(p.dataset.orig===undefined)p.dataset.orig=p.textContent; + p.textContent= mine?p.dataset.orig.replace(BARE,mine):p.dataset.orig; + }); + const note=document.getElementById('personalNote'); + if(note){ + if(mine){ note.style.display='block'; const s=note.querySelector('strong'); if(s)s.textContent='#'+id; const l=note.querySelector('.pnl'); if(l)l.textContent=mine; } + else note.style.display='none'; + } + if(id){ try{localStorage.setItem('rmc.toolsId',id);}catch(e){} } + } + (function initId(){ + if(!idIn)return; + const q=new URLSearchParams(location.search).get('id'); + let id=(q&&/^\d{1,15}$/.test(q))?q:''; + if(!id){ try{const s=localStorage.getItem('rmc.toolsId'); if(s&&/^\d{1,15}$/.test(s))id=s;}catch(e){} } + if(id&&!idIn.value)idIn.value=id; + })(); + if(idIn){ idIn.addEventListener('input',function(){render();personalize();}); render(); } if(copyShare){ copyShare.addEventListener('click',()=>{ const u=url(); if(!u){ idIn.focus(); return; } copy(u,copyShare); }); } + personalize(); })();