Files
linkspin/public/assets/partners.js
T

22 lines
1.6 KiB
JavaScript

// Site-owner partner page: ?name=First greets the owner, ?promo=CODE rides along into the
// company placement link and the example builder link. Display only; placement and credits
// come from the join route and the promo code.
(function () {
const q = new URLSearchParams(location.search);
const name = String(q.get('name') || '').replace(/[^A-Za-zÀ-ɏ' -]/g, '').trim().slice(0, 30);
const promo = String(q.get('promo') || '').toUpperCase().replace(/[^A-Z0-9_-]/g, '').slice(0, 24);
const ref = String(q.get('ref') || '').toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20); // a member's own partner kit (Nexus): the deal lands under them
const hello = document.getElementById('pkHello');
if (hello && name) { hello.textContent = name + ', this page is for you. Your spot directly under the company at the top is reserved; activate with the $20 package to claim it.'; hello.style.display = 'block'; }
const cta = document.getElementById('pkCta');
if (cta) {
const p = new URLSearchParams(); if (name) p.set('name', name); if (promo) p.set('promo', promo);
cta.href = (ref ? '/join/' + ref : '/join/company') + (p.toString() ? '?' + p.toString() : '');
if (name) cta.textContent = 'Claim my spot, ' + name;
}
const ex = document.getElementById('pkExample');
if (ex && promo) ex.textContent = 'https://linkspin-test.saasy.top/join/yourname?promo=' + promo;
const sub = document.getElementById('pkCtaSub');
if (sub && promo) sub.textContent = 'Free account by email. No password, no wallet today. The link below places you directly under the company and applies your code ' + promo + ' as well.';
})();