Files
viraladblitz/public/assets/member.js
T
martbost d611c4b251 Restyle ViralAdBlitz to the approved "daylight cyberpunk" look (Marty 2026-11-14)
Replaces the dark ink-green/amber newsroom look Marty rejected as too dark.
Look only: routes, ids, copy facts and the trust pack are unchanged.

- vab.css rewritten around CSS variables: #EAF0FF ground, white clipped
  cards, royal #0A1F6B bands/ticker, #0A2FA8 hero panels with network
  lines, red pill CTA, gold Boost/boosted, Barlow Condensed / Chakra Petch /
  Inter / JetBrains Mono. [hidden] now always wins over display rules.
- Front page: slanted hero, ribbon, green-check list, rising bars, three
  YOUR AD screens, gold chips; board tabs (verified clicks / on the wire /
  boosted, from data the page already has); Boost band; ledger chips.
- Member page: own ad as a hero panel, level rows with LEVEL chips, royal
  join bar. Rows are now labelled LEVEL 1 to LEVEL 5 in display order
  (Marty's decision); the real place is kept in the API as depth.
- My page becomes the dashboard: side menu, stat cards, my-ad card with
  LIVE/BOOSTED badges and a folded editor, line bars, Boost ring, recent
  activity, payouts. All figures from /api/my, nothing estimated.
- Boost, ledger, contract, promote, legal and admin pages restyled; 404 too.
- Default JOIN_URL is now https://instantadpay.com/join/{ref} (no ref
  falls back to the InstantAdPay home page).
- New mark, icon, OG image, 21 kit creatives and 3 proof cards
  (royal/daylight/navy) rendered by tools/art.mjs; asset tags bumped to v=4.
- smoke.mjs: new headline, level/depth and join URL checks, UI_FONTS=1.

Tests: qa/smoke.mjs 162/162, qa/chain.mjs 20/20 (local anvil).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 15:17:30 -06:00

28 lines
3.2 KiB
JavaScript

// A member's page (viraladblitz.com/<username>): their own ad, the ads of the first five people above them in the network sponsor
// line who have an ad here (labelled LEVEL 1 to LEVEL 5 in the order shown), Boosted places, and "join free under this member".
(async function () {
VAB.renderNav(''); VAB.renderFooter();
const $ = VAB.$, esc = VAB.esc;
const name = decodeURIComponent(location.pathname.replace(/^\/+|\/+$/g, ''));
const d = await VAB.wire('member', name).catch(() => ({}));
const pg = d.page;
if (!pg) { $('own').innerHTML = '<div class="card"><h2>No member by that name</h2><p>Check the link, or <a href="/">see the front page</a>.</p></div>'; $('levels').innerHTML = ''; return; }
document.title = '@' + pg.username + ' recommends | ViralAdBlitz';
$('who').textContent = '@' + pg.username.toUpperCase() + ' RECOMMENDS';
$('teamHead').textContent = 'Also recommended by @' + pg.username + '\'s team';
if (pg.ad) {
const a = pg.ad;
$('own').innerHTML = '<article class="paper big' + (a.boosted ? ' star' : '') + '">' + VAB.NETLINES + '<span class="tag mono">' + (a.boosted ? '★ BOOSTED · ' : '') + 'THIS MEMBER\'S OWN AD</span><h1>' + esc(a.headline) + '</h1><p>' + esc(a.line1) + (a.line2 ? ' ' + esc(a.line2) : '') + '</p>'
+ '<div class="row" style="margin-top:6px"><a class="pill-cta" data-go="' + a.id + '" data-p="own" target="_blank" rel="noopener sponsored" href="' + VAB.goHref(a.id, 'own') + '">Take a look<span class="chev" aria-hidden="true"> &raquo;</span></a><span class="host mono small">' + esc(a.host) + '</span></div></article>';
} else $('own').innerHTML = '<div class="card"><h2>@' + esc(pg.username) + ' has not posted an ad yet</h2><p>Their team\'s ads are below.</p></div>';
// LEVEL n = the nth row shown (Marty 2026-11-14), whatever the person's real place in the line
const rows = (pg.line || []).map((x, i) => '<div class="lvl' + (x.boosted ? ' star' : '') + '"><span class="no">LEVEL ' + (i + 1) + '</span><div class="txt"><b>' + esc(x.headline) + '</b><div>' + esc(x.line1) + (x.line2 ? ' ' + esc(x.line2) : '') + ' <span class="muted">' + esc(x.owner) + '</span>' + (x.boosted ? ' · <b class="mono" style="font-size:13px;color:var(--link)">★ BOOSTED</b>' : '') + '</div></div>'
+ '<a class="btn-line" data-go="' + x.id + '" data-p="level' + (i + 1) + '" target="_blank" rel="noopener sponsored" href="' + VAB.goHref(x.id, 'level' + (i + 1)) + '">Visit</a></div>');
for (let i = rows.length; i < 5; i++) rows.push('<div class="lvl open"><span class="no">OPEN</span><div class="txt"><b>An open place</b><div>' + (pg.hubOk === false && !i ? 'The network line is loading slowly. Try again in a minute.' : 'When more of this member\'s line posts an ad, it shows here.') + '</div></div></div>');
$('levels').innerHTML = rows.join('');
if ((pg.boosted || []).length) { $('boostedSec').hidden = false; $('boosted').innerHTML = pg.boosted.map(x => VAB.paper(x, '', 'boosted')).join(''); }
$('joinHead').textContent = 'Want your ad on pages like this one?';
$('joinText').textContent = 'Join free under @' + pg.username + '. Your ad goes on your own page and on every page you bring in, five levels down.';
$('joinBtn').href = pg.joinUrl; $('joinBtn').target = '_blank'; $('joinBtn').rel = 'noopener';
})();