Angle pages: each hook angle shares with its own video frame as the preview image; Share sends one message with the link inside the text (Telegram dropped the separate url)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-13 16:51:58 -05:00
parent ba811e48f8
commit 2df64f6247
9 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -145,7 +145,8 @@ window.IAPPromo = (function () {
+ (navigator.share ? '<button class="btn small sec" type="button">Share</button>' : '') + '</div></div>'; // Share = the phone's share sheet; desktops have none, so no button
const [copyBtn, shareBtn] = row.querySelectorAll('button');
copyBtn.onclick = async () => { try { await navigator.clipboard.writeText(url); status((a.name === 'General' ? 'Invite' : a.name) + ' link copied.', 'ok'); } catch (e) { status('Copy failed.', 'bad'); } };
if (shareBtn) shareBtn.onclick = async () => { try { await navigator.share({ title: 'InstantAdPay', text: a.hook, url }); } catch (e) { if (!(e && e.name === 'AbortError')) status('Could not open the share sheet.', 'bad'); } };
// the share sheet gets one ready message with the link inside it: some apps (Telegram among them) keep only the text field
if (shareBtn) shareBtn.onclick = async () => { try { await navigator.share({ title: 'InstantAdPay', text: (a.angle ? a.hook + ': ' : 'Have a look: ') + url }); } catch (e) { if (!(e && e.name === 'AbortError')) status('Could not open the share sheet.', 'bad'); } };
al.appendChild(row);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

+1 -1
View File
@@ -1151,7 +1151,7 @@
</div>
<script src="/assets/common.js?v=20261007a"></script><script src="/assets/welcome.js?v=20260923b"></script>
<script src="/assets/wallet.js?v=20260911a"></script>
<script src="/assets/promo.js?v=20261013d"></script>
<script src="/assets/promo.js?v=20261013e"></script>
<script src="/assets/my.js?v=20261013a"></script>
<script src="/assets/chat.js?v=20260907l"></script>
</body>
+4 -2
View File
@@ -382,12 +382,14 @@ function serveJoinPage(res, tok, angle, ang, setCookies) {
const url = (ang && ang.url) || (base + '/join/' + tok + (angle ? '?v=' + angle : ''));
const title = ang ? ang.t : 'Advertise and earn. Paid on-chain, instantly.';
const desc = ang ? ang.d : 'You are invited to InstantAdPay: real ad packages with same-transaction payouts on Polygon, every payment public. Join free by email.';
// each hook angle previews with its own video's opening frame (Marty 2026-10-13: shared angle links all showed the generic hero)
const ogImg = base + (['play', 'instant', 'adspend', 'free', 'ledger', 'two'].includes(angle) ? '/banners/iap-angle-' + angle + '-1200x630.jpg?v=1' : '/banners/iap-hero-1200x630.png');
const escA = t => String(t).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;');
const og = '<meta property="og:type" content="website"><meta property="og:site_name" content="InstantAdPay">'
+ '<meta property="og:title" content="' + escA(title) + '"><meta property="og:description" content="' + escA(desc) + '">'
+ '<meta property="og:url" content="' + escA(url) + '">' // keeps ?v= so shares stay on the angle
+ '<meta property="og:image" content="' + base + '/banners/iap-hero-1200x630.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">'
+ '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + escA(title) + '"><meta name="twitter:description" content="' + escA(desc) + '"><meta name="twitter:image" content="' + base + '/banners/iap-hero-1200x630.png">';
+ '<meta property="og:image" content="' + ogImg + '"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630">'
+ '<meta name="twitter:card" content="summary_large_image"><meta name="twitter:title" content="' + escA(title) + '"><meta name="twitter:description" content="' + escA(desc) + '"><meta name="twitter:image" content="' + ogImg + '">';
html = html.replace(/<title>[^<]*<\/title>/, '<title>' + escA(title) + ' | InstantAdPay</title>' + og);
if (ang) html = html.replace('<body>', '<body class="squeeze">'); // angle pages: squeeze layout from the first paint
// Network Ad Space zone on the two legacy squeeze pages only (Marty, 2026-09-19): below the