Files
martbost f562cc50be Rail shows Training, Pipeline, Profile; profile carry-over from InstantAdPay; hero frame + relative page images; the "how is this different from InstantAdPay" answer
- Control Room rail: Training, Pipeline and Profile are first-class entries (phone bar keeps them behind More)
- /api/partner/registry: rows may carry profile {avatarUrl, bio, socials}; fills only empty fields on this side, member edits win after that
- Pages: uploaded images are stored as /u/pages/... paths (any host, local recordings included); the split hero frame keeps a 3:2 shape with a tinted ground when an image fails to load (was a thin white bar)
- Home page section + chatbot canned answer + FACTS: InstantAdPay = marketplace, LinkSpin = tool side, same line and wallet
- asset tags bumped to 20261011a

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 06:41:25 -05:00

137 lines
19 KiB
JavaScript

// LinkSpin page styling (2026-10-07): the Branded Voice design system, ported. Three axes every page carries:
// palette — five curated colour sets with the SAME semantic keys (gold = the one bright CTA colour, inkGreen /
// inkGreenLight = the dark hero surface pair, green = the quiet accent, cream = text on dark)
// design — dark (glow hero, glass cards), light (white ground, SaaS-modern), editorial (serif magazine),
// ignition (black ground, ray burst, hot gradient headline: the launch look)
// layout — stack (centred) or split (copy left, a visual right: the member's image, the niche hero, or a
// procedural "product made tangible" card built from the copy itself)
// plus niche presets: one-click combos of design + palette + a house hero image (Branded Voice's own, served from
// mybrandedvoice.com). A preset is a starting point; every knob stays individually overridable.
// Pages stay self-contained: system font stacks, no webfonts, no inline script (the pages CSP forbids it), so the
// motion here is CSS-only and respects prefers-reduced-motion.
'use strict';
const FONT = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
const SERIF = 'Charter,Georgia,Cambria,"Times New Roman",serif';
const IGNITION_DISPLAY = 'Haettenschweiler,"Arial Narrow Bold",Impact,"Arial Black",sans-serif';
const NEUTRALS = { ink: '#1a1a1a', body: '#4a4a4a', muted: '#888', surfaceAlt: '#f8f9fa', frame: '#ececed', hairline: '#eceef0' };
const build = c => Object.assign({}, NEUTRALS, c);
const PALETTES = {
heritage: { label: 'Heritage', sub: 'green & gold', hue: 32, c: build({ gold: '#d9a23e', goldSoft: '#e3b45c', goldInk: '#231a08', inkGreen: '#141a16', inkGreenLight: '#2a3d31', green: '#33684b', greenTint: '#eaf1ec', cream: '#f5f1e8' }) },
midnight: { label: 'Midnight', sub: 'navy & amber', hue: 208, c: build({ gold: '#e0a53c', goldSoft: '#e8b65f', goldInk: '#241a06', inkGreen: '#111825', inkGreenLight: '#24344d', green: '#33567a', greenTint: '#e8eef5', cream: '#f1f4f8' }) },
ocean: { label: 'Ocean', sub: 'teal & sand', hue: 160, c: build({ gold: '#d5a850', goldSoft: '#dfb96e', goldInk: '#221a07', inkGreen: '#0e1f21', inkGreenLight: '#1e3f43', green: '#276b64', greenTint: '#e5f1ef', cream: '#eef4f2' }) },
plum: { label: 'Plum', sub: 'aubergine & honey', hue: 285, c: build({ gold: '#dca648', goldSoft: '#e4b768', goldInk: '#231a07', inkGreen: '#1d1220', inkGreenLight: '#38243e', green: '#68406b', greenTint: '#f1eaf2', cream: '#f4eff5' }) },
graphite: { label: 'Graphite', sub: 'charcoal & gold', hue: 12, c: build({ gold: '#d9a23e', goldSoft: '#e3b45c', goldInk: '#231a08', inkGreen: '#151719', inkGreenLight: '#2c2f33', green: '#4d5a63', greenTint: '#ebeef0', cream: '#f2f2f0' }) },
};
// older LinkSpin pages stored these names; they fold into the nearest curated palette
const LEGACY = { ink: 'heritage', ember: 'heritage' };
const DESIGNS = {
dark: { label: 'Dark', blurb: 'Glow hero, glass cards, cinematic' },
light: { label: 'Light', blurb: 'White ground, clean, SaaS-modern' },
editorial: { label: 'Editorial', blurb: 'Serif magazine article, pull quotes' },
ignition: { label: 'Ignition', blurb: 'Black ground, ray burst, hot headline' },
};
const LAYOUTS = { stack: { label: 'Stacked', blurb: 'Centred copy, image below the headline' }, split: { label: 'Split hero', blurb: 'Copy left, visual right' } };
const HERO_COUNT = { 'health-wellness': 4, 'make-money-online': 4, 'personal-finance': 4, 'coaching-consulting': 4, 'self-improvement': 4, relationships: 4, gaming: 4 }; // /niches/<key>-1..n.jpg (photographic, 1536x1024, textless)
const NICHES = {
'health-wellness': { label: 'Health & Wellness', design: 'light', palette: 'ocean', blurb: 'Fresh and calm: teal & sand, clean light pages' },
'make-money-online': { label: 'Make Money Online', design: 'ignition', palette: 'heritage', blurb: 'Launch heat: black ground, inferno orange' },
'personal-finance': { label: 'Personal Finance', design: 'dark', palette: 'midnight', blurb: 'Trustworthy: navy & amber, dramatic dark' },
'coaching-consulting': { label: 'Coaching & Consulting', design: 'editorial', palette: 'plum', blurb: 'Premium: magazine layout, aubergine & honey' },
'self-improvement': { label: 'Self-Improvement', design: 'light', palette: 'heritage', blurb: 'Uplifting: green & gold on clean white' },
relationships: { label: 'Relationships', design: 'light', palette: 'plum', blurb: 'Warm: aubergine & honey, soft light pages' },
gaming: { label: 'Gaming', design: 'dark', palette: 'midnight', blurb: 'Night mode: navy & amber, glow hero' },
};
const paletteKey = n => { n = String(n || '').toLowerCase(); return PALETTES[n] ? n : LEGACY[n] || 'graphite'; };
const designKey = n => (DESIGNS[String(n || '').toLowerCase()] ? String(n).toLowerCase() : 'dark');
const layoutKey = n => (LAYOUTS[String(n || '').toLowerCase()] ? String(n).toLowerCase() : 'stack');
const nicheKey = n => (NICHES[String(n || '').toLowerCase()] ? String(n).toLowerCase() : '');
const nicheHeroes = n => (NICHES[n] ? Array.from({ length: HERO_COUNT[n] || 1 }, (_, i) => '/niches/' + n + '-' + (i + 1) + '.jpg') : []);
const heroIndex = (n, i) => { const L = nicheHeroes(n).length; i = Number(i); return L && Number.isInteger(i) && i >= 0 && i < L ? i : 0; };
const nicheHero = (n, i) => { const h = nicheHeroes(n); return h.length ? h[heroIndex(n, i)] : ''; };
// what the editor shows: swatches, labels, blurbs
const catalog = () => ({
palettes: Object.entries(PALETTES).map(([k, p]) => ({ key: k, label: p.label, sub: p.sub, swatch: [p.c.inkGreen, p.c.gold, p.c.green] })),
designs: Object.entries(DESIGNS).map(([k, d]) => ({ key: k, label: d.label, blurb: d.blurb })),
layouts: Object.entries(LAYOUTS).map(([k, l]) => ({ key: k, label: l.label, blurb: l.blurb })),
niches: Object.entries(NICHES).map(([k, n]) => ({ key: k, label: n.label, blurb: n.blurb, design: n.design, palette: n.palette, hero: nicheHero(k, 0), heroes: nicheHeroes(k) })),
});
// ---- colour helpers ----
const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;' }[c]));
function rgba(hex, a) { const h = hex.replace('#', ''); const n = parseInt(h.length === 3 ? h.split('').map(x => x + x).join('') : h, 16); return 'rgba(' + ((n >> 16) & 255) + ',' + ((n >> 8) & 255) + ',' + (n & 255) + ',' + a + ')'; }
function hslToHex(h, s, l) {
const f = n => { const k = (n + h * 12) % 12; const a = s * Math.min(l, 1 - l); const c = l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1)); return Math.round(255 * c).toString(16).padStart(2, '0'); };
return '#' + f(0) + f(8) + f(4);
}
// Ignition carries each palette's identity hue at launch-page heat (not its gold, or every palette would be the same orange)
function hotRamp(pk) { const h = (PALETTES[pk] || PALETTES.graphite).hue / 360; return { hot1: hslToHex(h, 0.95, 0.55), hot2: hslToHex(h, 0.85, 0.74), hot3: hslToHex(h, 0.95, 0.32), ink: hslToHex(h, 0.7, 0.07) }; }
// the hottest phrase of a headline gets the gradient: money phrases win, else the last three words
function blazeHeadline(headline) {
const plain = String(headline || '').trim(); const money = plain.match(/\$[\d][\d,.]*(?:[ -]?(?:a|per)[ -]\w+)?/i);
if (money && money.index != null) return esc(plain.slice(0, money.index)) + '<span class="ig-blaze">' + esc(money[0]) + '</span>' + esc(plain.slice(money.index + money[0].length));
const w = plain.split(/\s+/); if (w.length < 4) return '<span class="ig-blaze">' + esc(plain) + '</span>';
return esc(w.slice(0, -3).join(' ')) + ' <span class="ig-blaze">' + esc(w.slice(-3).join(' ')) + '</span>';
}
// ---- the CSS kit: design-aware vocabulary shared by every page type ----
function kitCss(design, pk) {
const P = PALETTES[pk] || PALETTES.graphite, C = P.c, dk = C.inkGreen, cream = C.cream;
const shared = '.k-eyebrow{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;border-radius:99px;padding:6px 14px;margin:0 0 18px}.k-eyebrow .dot{width:6px;height:6px;border-radius:99px}'
+ 'ul.checks{list-style:none;padding:0;margin:0 0 24px;text-align:left}ul.checks li{padding:7px 0 7px 34px;position:relative}ul.checks li:before{content:"\\2713";position:absolute;left:0;top:7px;width:22px;height:22px;border-radius:50%;background:' + C.greenTint + ';color:' + C.green + ';font-weight:800;font-size:13px;display:flex;align-items:center;justify-content:center}'
+ '.k-imgframe{position:relative;border-radius:18px;overflow:hidden;box-shadow:0 12px 40px rgba(0,0,0,.18);border:6px solid #fff;aspect-ratio:3/2;background:linear-gradient(135deg,' + rgba(C.inkGreen, 0.35) + ',' + rgba(C.gold, 0.3) + ')}.k-imgframe img{display:block;width:100%;height:100%;object-fit:cover}.k-imgframe::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,' + rgba(C.inkGreen, 0.12) + ',' + rgba(C.gold, 0.1) + ');mix-blend-mode:multiply;pointer-events:none}'
+ '.k-mark{background:linear-gradient(180deg,transparent 52%,' + rgba(C.gold, 0.55) + ' 52%);padding:0 .12em;border-radius:2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}'
+ '.cta{display:inline-block;background:' + C.gold + ';color:' + C.goldInk + ';font-weight:800;font-size:18px;line-height:1.3;text-decoration:none;padding:16px 32px;border-radius:10px;border:0;cursor:pointer;font-family:' + FONT + ';box-shadow:0 8px 24px ' + rgba(C.gold, 0.35) + ';transition:transform .15s ease,filter .15s ease}.cta:hover{transform:translateY(-1px);filter:brightness(1.05)}'
+ '.pc{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}.pc div{border:1px solid ' + C.hairline + ';border-radius:12px;padding:16px 18px;background:#fff}.pc h3{margin:0 0 8px;font-size:16px}.pc ul{margin:0;padding-left:18px}@media(max-width:600px){.pc{grid-template-columns:1fr}}'
+ '.rating{font-size:22px;letter-spacing:2px;color:' + C.gold + ';margin:0 0 10px}.verdict{border-left:4px solid ' + C.gold + ';padding:12px 16px;margin:18px 0;background:' + C.surfaceAlt + ';border-radius:0 10px 10px 0}'
+ '.bonus{border:1px solid ' + C.hairline + ';border-radius:14px;overflow:hidden;margin:24px 0;box-shadow:0 6px 24px rgba(0,0,0,.06);background:#fff}.bonus .tag{background:' + C.ink + ';color:' + cream + ';font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;padding:10px 22px}.bonus .in{padding:20px 24px}'
+ '.ls-form{display:grid;gap:12px}.ls-in{width:100%;padding:14px 16px;font:16px/1.4 ' + FONT + ';color:' + C.ink + ';background:#fff;border:1.5px solid ' + C.hairline + ';border-radius:10px;outline:none}.ls-in:focus{border-color:' + C.gold + '}.ls-in::placeholder{color:' + C.muted + '}button.cta{width:100%;font-size:19px}'
+ '.privacy,.formnote{font-size:12.5px;color:' + C.muted + ';margin:12px 0 0;text-align:center}.foot{text-align:center;font-size:12.5px;padding:28px 18px 36px}.foot a{color:inherit}'
+ '@media (prefers-reduced-motion: no-preference){.reveal{animation:lsin .7s ease both}@keyframes lsin{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}}';
if (design === 'ignition') {
const R = hotRamp(pk);
return shared
+ 'body::before{content:"";position:fixed;inset:-45%;z-index:0;pointer-events:none;background:repeating-conic-gradient(from 0deg at 50% 40%,transparent 0deg 5deg,' + rgba(R.hot1, 0.5) + ' 5deg 5.9deg,transparent 5.9deg 10deg);opacity:.35;mask-image:radial-gradient(ellipse at 50% 40%,#000 0%,transparent 70%);-webkit-mask-image:radial-gradient(ellipse at 50% 40%,#000 0%,transparent 70%)}'
+ 'body::after{content:"";position:fixed;inset:0;z-index:0;pointer-events:none;background:radial-gradient(58% 42% at 50% 108%,' + rgba(R.hot1, 0.28) + ' 0%,transparent 70%)}'
+ '@media (prefers-reduced-motion: no-preference){body::before{animation:igspin 150s linear infinite}@keyframes igspin{to{transform:rotate(360deg)}}}'
+ '.ig-blaze{background:linear-gradient(180deg,' + R.hot2 + ' 8%,' + R.hot1 + ' 55%,' + R.hot3 + ' 100%);-webkit-background-clip:text;background-clip:text;color:transparent;filter:drop-shadow(0 0 18px ' + rgba(R.hot1, 0.45) + ')}'
+ '.cta{background:linear-gradient(180deg,' + R.hot2 + ' 0%,' + R.hot1 + ' 60%,' + R.hot3 + ' 130%);color:' + R.ink + ';text-transform:uppercase;letter-spacing:.5px;box-shadow:0 10px 34px ' + rgba(R.hot1, 0.42) + '}'
+ '@media (prefers-reduced-motion: no-preference){.cta{animation:igpulse 2.6s ease-in-out infinite}@keyframes igpulse{0%,100%{box-shadow:0 10px 34px ' + rgba(R.hot1, 0.38) + '}50%{box-shadow:0 14px 48px ' + rgba(R.hot1, 0.62) + '}}}'
+ '.k-eyebrow{color:' + R.hot2 + ';background:rgba(0,0,0,.45);border:1px solid ' + rgba(R.hot1, 0.55) + '}.k-eyebrow .dot{background:' + R.hot1 + ';box-shadow:0 0 10px ' + rgba(R.hot1, 0.8) + '}'
+ 'ul.checks li{color:' + rgba(cream, 0.88) + '}ul.checks li:before{background:' + rgba(R.hot1, 0.25) + ';color:' + R.hot2 + '}'
+ '.pc div,.bonus,.verdict{background:rgba(255,255,255,.04);border:1px solid ' + rgba(cream, 0.1) + ';color:' + rgba(cream, 0.85) + '}.bonus .tag{background:' + rgba(R.hot1, 0.18) + ';color:' + R.hot2 + '}.verdict{border-left-color:' + R.hot1 + '}.rating{color:' + R.hot1 + '}'
+ '.ls-in{background:rgba(0,0,0,.62);border-color:' + rgba(R.hot1, 0.45) + ';color:#fff}.ls-in:focus{border-color:' + R.hot2 + '}.ls-in::placeholder{color:rgba(245,241,232,.45)}.privacy,.formnote{color:rgba(245,241,232,.5)}'
+ '.k-imgframe{border-color:#000;box-shadow:0 0 0 1px ' + rgba(R.hot1, 0.4) + ',0 24px 70px rgba(0,0,0,.6)}';
}
if (design === 'editorial') return shared + '.k-eyebrow{border-top:2px solid ' + C.gold + ';border-radius:0;padding:12px 0 0;color:' + C.green + ';background:none}.k-eyebrow .dot{display:none}'
+ '.k-pull{margin:36px 0;padding:8px 0 8px 26px;border-left:3px solid ' + C.gold + ';font-size:23px;line-height:1.45;font-style:italic;color:' + C.ink + '}.bonus{border-radius:6px}';
if (design === 'light') return shared + '.k-eyebrow{color:' + C.green + ';background:' + C.greenTint + ';border:1px solid ' + rgba(C.green, 0.2) + '}.k-eyebrow .dot{background:' + C.green + ';box-shadow:0 0 8px ' + rgba(C.green, 0.5) + '}';
// dark
return shared + '.k-eyebrow{color:' + C.goldSoft + ';background:' + rgba(C.gold, 0.1) + ';border:1px solid ' + rgba(C.gold, 0.28) + '}.k-eyebrow .dot{background:' + C.green + ';box-shadow:0 0 10px ' + rgba(C.green, 0.8) + '}'
+ '.hero ul.checks li{color:' + rgba(cream, 0.85) + '}';
}
// ---- procedural visual (split layout without an image): the offer made tangible, deterministic per headline ----
function hash(s) { let h = 5381; for (let i = 0; i < s.length; i++) h = ((h << 5) + h + s.charCodeAt(i)) >>> 0; return h; }
function visualCss(pk) {
const C = (PALETTES[pk] || PALETTES.graphite).c;
return '.pv{position:relative;width:100%;max-width:420px;margin:0 auto}.pv .pv-card{background:#fff;border:6px solid #fff;border-radius:12px;box-shadow:0 0 0 1px rgba(255,255,255,.16),0 12px 40px rgba(0,0,0,.18);overflow:hidden}.pv .pv-under{position:absolute;inset:18px -14px -14px 14px;background:' + C.greenTint + ';border-radius:12px;z-index:-1}'
+ '.pv-cover{background:' + C.green + ';padding:44px 28px;text-align:left}.pv-cover .pv-kicker{font-size:11px;font-weight:800;letter-spacing:.22em;text-transform:uppercase;color:' + C.goldSoft + ';margin:0 0 14px}.pv-cover .pv-title{color:' + C.cream + ';font-size:26px;line-height:1.25;font-weight:800;letter-spacing:-.01em;margin:0}.pv-cover .pv-rule{width:44px;height:4px;background:' + C.gold + ';border-radius:2px;margin:18px 0 0}'
+ '.pv-body{padding:20px 24px 24px}.pv-row{display:flex;align-items:flex-start;gap:12px;padding:9px 0;font-size:14.5px;line-height:1.45;color:' + C.body + '}.pv-row+.pv-row{border-top:1px solid ' + C.hairline + '}.pv-tick{flex:none;width:22px;height:22px;border-radius:50%;background:' + C.greenTint + ';color:' + C.green + ';font-weight:800;font-size:13px;display:flex;align-items:center;justify-content:center}'
+ '.pv-chip{position:absolute;top:-12px;right:-10px;background:' + C.gold + ';color:' + C.goldInk + ';font-weight:800;font-size:16px;padding:10px 16px;border-radius:999px;box-shadow:0 8px 24px ' + rgba(C.gold, 0.35) + ';z-index:2}'
+ '.pv-bar{display:flex;align-items:center;gap:8px;padding:14px 20px;border-bottom:1px solid ' + C.hairline + '}.pv-dot{width:9px;height:9px;border-radius:50%;background:' + C.hairline + '}.pv-dot:first-child{background:' + C.gold + '}'
+ '.pv-stat{display:flex;align-items:baseline;gap:10px;padding:18px 24px 6px}.pv-stat .pv-num{font-size:38px;font-weight:800;letter-spacing:-.02em;color:' + C.ink + '}.pv-stat .pv-lbl{font-size:12.5px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:' + C.muted + '}.pv-meter{height:8px;border-radius:4px;background:' + C.greenTint + ';margin:10px 24px 14px;overflow:hidden}.pv-meter i{display:block;height:100%;width:72%;background:' + C.green + ';border-radius:4px}'
+ '@media(max-width:820px){.pv{max-width:360px}}';
}
function visualHtml(offer, bullets, price) {
offer = String(offer || '').trim() || 'Your Offer'; bullets = (bullets || []).map(b => String(b).trim()).filter(Boolean);
const motif = ['product', 'checklist', 'stat'][hash(offer.toLowerCase()) % 3]; const chip = price ? '<div class="pv-chip">' + esc(price) + '</div>' : '';
const ticks = arr => arr.slice(0, 3).map(b => '<div class="pv-row"><span class="pv-tick">✓</span><span>' + esc(b) + '</span></div>').join('');
if (motif === 'product') return '<div class="pv">' + chip + '<div class="pv-under"></div><div class="pv-card"><div class="pv-cover"><p class="pv-kicker">Instant access</p><h3 class="pv-title">' + esc(offer) + '</h3><div class="pv-rule"></div></div>' + (bullets.length ? '<div class="pv-body">' + ticks(bullets) + '</div>' : '') + '</div></div>';
if (motif === 'checklist') return '<div class="pv">' + chip + '<div class="pv-under"></div><div class="pv-card"><div class="pv-bar"><span class="pv-dot"></span><span class="pv-dot"></span><span class="pv-dot"></span></div><div class="pv-cover" style="padding:26px 24px"><h3 class="pv-title" style="font-size:21px">' + esc(offer) + '</h3></div><div class="pv-body">' + ticks(bullets.length ? bullets : ['Everything included', 'Ready to use today', 'Yours to keep']) + '</div></div></div>';
const many = offer.split(/\s+/).length > 2;
return '<div class="pv">' + chip + '<div class="pv-under"></div><div class="pv-card"><div class="pv-bar"><span class="pv-dot"></span><span class="pv-dot"></span><span class="pv-dot"></span></div><div class="pv-stat"><span class="pv-num">' + esc(many ? '100%' : offer) + '</span><span class="pv-lbl">' + esc(many ? offer : 'complete system') + '</span></div><div class="pv-meter"><i></i></div>' + (bullets.length ? '<div class="pv-body" style="padding-top:4px">' + ticks(bullets) + '</div>' : '') + '</div></div>';
}
module.exports = { FONT, SERIF, IGNITION_DISPLAY, PALETTES, DESIGNS, LAYOUTS, NICHES, paletteKey, designKey, layoutKey, nicheKey, nicheHero, nicheHeroes, heroIndex, catalog, rgba, hotRamp, blazeHeadline, kitCss, visualCss, visualHtml, esc };