Direct link option: opt out of moving-link rotation to build personal spillover (Team link default, Direct link alternate)
This commit is contained in:
+10
-4
@@ -10,6 +10,10 @@
|
||||
|
||||
function pathId(){const m=location.pathname.match(/^\/join\/(\d+)$/);return m?m[1]:''}
|
||||
const id=pathId();
|
||||
// Direct link (?direct=1): opt out of moving-link rotation — new joins land
|
||||
// directly under THIS position (spillover in their team), instead of routing
|
||||
// to the next-to-qualify member. Default (no flag) = the Team/moving link.
|
||||
const direct=new URLSearchParams(location.search).get('direct')==='1';
|
||||
let joinTargetId=id; // where the entry actually lands after moving-link routing
|
||||
|
||||
function setIds(idStr){
|
||||
@@ -53,10 +57,10 @@
|
||||
// Moving-link routing: the entry lands on whoever the smart link resolves to.
|
||||
// A qualified inviter's link routes to the next-to-qualify in their leg, so
|
||||
// the join builds the team down in order instead of spilling onto the inviter.
|
||||
const t=d.joinTarget||{id:d.id,referralUrl:d.referralUrl,reason:'self'};
|
||||
const t=direct?{id:id,reason:'direct'}:(d.joinTarget||{id:d.id,referralUrl:d.referralUrl,reason:'self'});
|
||||
joinTargetId=t.id;
|
||||
const jb=document.getElementById('joinBtn');
|
||||
jb.href='/join-now?ref='+id; jb.removeAttribute('target'); // self-enroll page, placed in this leg
|
||||
jb.href='/join-now?ref='+id+(direct?'&direct=1':''); jb.removeAttribute('target'); // self-enroll page, placed in this leg
|
||||
// the join CTA + "join under" header + dApp-sponsor mentions reflect the
|
||||
// ACTUAL sponsor the entry lands on, not the inviter (only the top
|
||||
// "invited by #X" line keeps the inviter's id)
|
||||
@@ -64,7 +68,9 @@
|
||||
document.getElementById('invIdJoin').textContent='#'+t.id;
|
||||
document.querySelectorAll('.inv-id-inline').forEach(el=>el.textContent='#'+t.id);
|
||||
const note=document.getElementById('invQualNote');
|
||||
if(t.reason==='leg'||t.reason==='global'){
|
||||
if(direct){
|
||||
note.innerHTML=`<div class="callout" style="margin-top:14px">You're joining <strong>directly under Member #${esc(id)}</strong> — a spillover placement in their team. Enter sponsor <strong>#${esc(id)}</strong> in the dApp.</div>`;
|
||||
}else if(t.reason==='leg'||t.reason==='global'){
|
||||
note.innerHTML=`<div class="callout" style="margin-top:14px">You were invited by <strong>Member #${esc(d.id)}</strong>, who's already <strong>qualified</strong>. So your entry goes to <strong>Member #${esc(t.id)}</strong> — the next spot in the team that needs its 2 — and you'll join directly under them. Same team, filling the next open position in order (no spillover). Enter sponsor <strong>#${esc(t.id)}</strong> in the dApp.</div>`;
|
||||
}else if(d.directCount>=2){
|
||||
note.innerHTML=`<div class="callout" style="margin-top:14px">This position is already <strong>qualified</strong> — joining here still works: your entry pays them and you're placed in their team leg as depth.</div>`;
|
||||
@@ -129,7 +135,7 @@
|
||||
s.innerHTML='<h1 style="margin-top:10px">'+a.h+'</h1>'+
|
||||
'<div class="video-card" style="max-width:860px;margin:22px auto 0">'+
|
||||
'<video id="hookPlayer" class="video-frame" style="display:block;width:100%;height:auto;aspect-ratio:16/9" controls preload="metadata" poster="'+a.p+'" src="'+a.v+'"></video></div>'+
|
||||
'<div class="hero-actions" style="margin-top:26px"><a id="hookCta" class="btn btn-primary" style="font-size:19px;padding:16px 34px;font-weight:800" href="'+location.pathname+'">Show me how it works →</a></div>'+
|
||||
'<div class="hero-actions" style="margin-top:26px"><a id="hookCta" class="btn btn-primary" style="font-size:19px;padding:16px 34px;font-weight:800" href="'+location.pathname+(new URLSearchParams(location.search).get('direct')==='1'?'?direct=1':'')+'">Show me how it works →</a></div>'+
|
||||
'<div class="micro" style="margin-top:14px">Independent team training resource • Participation involves risk • No income is guaranteed</div>';
|
||||
main.appendChild(s);
|
||||
var hp=document.getElementById('hookPlayer'),cta=document.getElementById('hookCta');
|
||||
|
||||
Reference in New Issue
Block a user