CTB offer: on-page toast when the 30s visit is counted

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-23 08:36:14 -05:00
parent c5e2c30ff3
commit b950e378d1
+8 -1
View File
@@ -37,7 +37,14 @@
if(++seen<30)return;
clearInterval(t);
try{ sessionStorage.setItem('ctb.engaged',cid); }catch(e){}
fetch('/api/public/track',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({event:'engaged',source:getSource(),clickid:cid})}).catch(()=>{});
fetch('/api/public/track',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({event:'engaged',source:getSource(),clickid:cid})})
.then(function(){
const d=document.createElement('div');
d.style.cssText='position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:9999;background:linear-gradient(135deg,#f3be43,#d89b19);color:#0a1622;font-weight:800;font-size:15px;padding:12px 20px;border-radius:12px;box-shadow:0 8px 28px rgba(0,0,0,.4);max-width:92vw;text-align:center';
d.textContent='🎉 Visit counted! Your coins land in the CTB Rewards app — check the featured offer card. (Once per day.)';
document.body.appendChild(d);
setTimeout(function(){ d.remove(); },8000);
}).catch(()=>{});
},1000);
})();
})();