Files
rm-circle-team-router/public/tools.js
T
martbost 4dbbc6780c Add payments video to training + new Promo Tools page (/tools)
Training: new "Video 5 · Why you're not getting paid yet" card with the
payments teaching video (+ poster). Promo Tools page at /tools (noindex,
unlinked from public nav — a team resource): share-ready video clips
with copy-link buttons, a personal invite-link builder, and three
compliant email/message swipes; banners noted as generate-on-request.
Chatbot gains a promo-tools answer. Old scroll-only clip is superseded
by the combined cut (retire it).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 05:47:01 -05:00

18 lines
1.1 KiB
JavaScript

(function(){
function copy(text, btn){
if(!text) return;
navigator.clipboard.writeText(text).then(()=>{
const old=btn.dataset.label||btn.textContent; btn.dataset.label=old;
btn.textContent='Copied ✓'; btn.disabled=true;
setTimeout(()=>{btn.textContent=old; btn.disabled=false;},1500);
}).catch(()=>{ btn.textContent='Copy failed'; setTimeout(()=>{btn.textContent=btn.dataset.label||'Copy';},1500); });
}
document.querySelectorAll('.copy-btn').forEach(b=>b.addEventListener('click',()=>copy(b.getAttribute('data-copy'),b)));
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(); }
if(copyShare){ copyShare.addEventListener('click',()=>{ const u=url(); if(!u){ idIn.focus(); return; } copy(u,copyShare); }); }
})();