/my: default to pitch on link visits + big Join button above the fold

- default tab now: shared /my/<id> link -> Team Build pitch; form lookup /
  returning member on bare /my / #dash link -> dashboard (replaces the flaky
  "have you seen this ID before" heuristic that dumped returning prospects
  straight into the dashboard).
- added a big gold "Join the Team" CTA in the hero (right column), above the
  fold, so a sold visitor can join without scrolling past the video.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-17 08:39:52 -05:00
parent 45797bdf9a
commit 436306f4d0
3 changed files with 18 additions and 5 deletions
+10 -3
View File
@@ -3,6 +3,7 @@
const fmt=n=>Number(n||0).toLocaleString(undefined,{maximumFractionDigits:2});
const date=ts=>ts?new Date(ts*1000).toLocaleDateString(undefined,{year:'numeric',month:'short',day:'numeric'}):'—';
const prompt=document.getElementById('idPrompt'),dash=document.getElementById('dash');
let openDashTab=false; // which tab opens on load — set by the form/URL; default = pitch
// Two-purpose page: a "Team Build" pitch tab (for cold visitors who clicked a
// promoted link) and the "Position Dashboard" tab. Persistent — the pitch is
@@ -21,6 +22,7 @@
set('pTeam',(d.subtree&&d.subtree.downCount!=null)?String(d.subtree.downCount):'—');
set('pLevel',d.levelName||'—');
const jb=document.getElementById('pJoinBtn'); if(jb){jb.href='/join/'+d.id;jb.textContent='Join under #'+d.id+' →';}
const hj=document.getElementById('pHeroJoin'); if(hj)hj.href='/join/'+d.id;
const pp=document.getElementById('pPayouts');
if(pp){
const inc=(d.income||[]).slice(0,3);
@@ -84,10 +86,11 @@
});
function render(d){
prompt.classList.add('hidden');dash.classList.remove('hidden');
// default tab: a cold visitor (hasn't viewed this ID before) opens on the
// Team Build pitch; the member (their own saved ID) opens on their dashboard.
// default tab: shared /my/<id> link visits open on the Team Build pitch; a
// form lookup, a returning member on bare /my, or a #dash link opens the
// dashboard (openDashTab is set by those paths before load()).
renderPitch(d);
try{ setTab(d._priorId===String(d.id)?'dash':'pitch'); }catch(e){ setTab('pitch'); }
setTab(openDashTab?'dash':'pitch');
document.getElementById('dTitle').textContent='#'+d.id;
const qb=document.getElementById('dQualified');
if(qb)qb.outerHTML=d.directCount>=2
@@ -342,6 +345,7 @@
e.preventDefault();
const v=document.getElementById('memberId').value.trim();
if(!/^\d{1,15}$/.test(v)){document.getElementById('idError').textContent='Numbers only — the ID from the RM Circle dApp.';return}
openDashTab=true; // they actively looked up an ID — open the dashboard
load(v);
});
document.getElementById('switchId').addEventListener('click',()=>{
@@ -350,6 +354,9 @@
dash.classList.add('hidden');prompt.classList.remove('hidden');
document.getElementById('memberId').value='';
});
try{ if(location.hash==='#dash'||new URLSearchParams(location.search).get('tab')==='dash') openDashTab=true; }catch(e){}
const pathHasId=/^\/my\/\d+$/.test(location.pathname);
const id=pathId();
if(id&&!pathHasId)openDashTab=true; // bare /my resolved from storage = returning to your own page
if(id)load(id);
})();