From a6bfa1ba42fada34f42625fac7ae724aa7f7e48b Mon Sep 17 00:00:00 2001 From: martbost Date: Wed, 7 Oct 2026 16:40:21 -0500 Subject: [PATCH] Page designer on the Branded Voice design system: palette x design (dark/light/editorial/ignition) x layout (stacked/split hero) + six niche presets with house hero images, procedural split visual with price chip, Look panel in the editor; ad zones + banner campaigns gain 336x280, 250x250, 125x125, 120x600 with house banners Co-Authored-By: Claude Fable 5.1 --- ads.js | Bin 90350 -> 90485 bytes pagerender.js | 113 +++++++++++++++-------- pages.js | 14 ++- pagestyle.js | 133 ++++++++++++++++++++++++++++ public/assets/pages-screen.js | 17 ++-- public/banners/linkspin-120x600.svg | 1 + public/banners/linkspin-125x125.svg | 1 + public/banners/linkspin-250x250.svg | 1 + public/banners/linkspin-336x280.svg | 1 + public/pages.html | 16 +++- server.js | 2 +- zones.js | 4 +- 12 files changed, 254 insertions(+), 49 deletions(-) create mode 100644 pagestyle.js create mode 100644 public/banners/linkspin-120x600.svg create mode 100644 public/banners/linkspin-125x125.svg create mode 100644 public/banners/linkspin-250x250.svg create mode 100644 public/banners/linkspin-336x280.svg diff --git a/ads.js b/ads.js index c9d31063c56a3041d8f9cc1ccb930d9403a8e0cf..90d278e3e7a23b609604bc985ad5379dec451fb5 100644 GIT binary patch delta 146 zcmaENkoD^!)(zo&^~PouMivI@Itt}h3dY7}Itm$93P1rJg`C8s)Ep}Xb)Uqd^i+kS z)Z~)Hy!4z@kfOuWL0S}Qb+{B1sueO*fU1m44Jv>bVh)f2F$YA$%n2?mO)N@P0LlTi S164w_H~aH#_vd4r9|Qn$=qZ!{ delta 18 acmex*i1pn;)(zo&&G-1W-{WJP9s~ed5D0<* diff --git a/pagerender.js b/pagerender.js index 90a4dc8..0d8f69f 100644 --- a/pagerender.js +++ b/pagerender.js @@ -1,55 +1,94 @@ -// LinkSpin page renderer (2026-09-29): bridge, review and squeeze pages as standalone HTML. Everything the member -// typed is escaped; the only form on a page is either our own capture form or a provider form rebuilt by +// LinkSpin page renderer (2026-09-29, restyled 2026-10-07 on the Branded Voice design system: palette x design x +// layout + niche presets, see pagestyle.js). Bridge, review and squeeze pages as standalone HTML. Everything the +// member typed is escaped; the only form on a page is either our own capture form or a provider form rebuilt by // formrestyle (parse-or-refuse). No inline script: tracking lives in /assets/pt.js so the page can carry a real CSP. 'use strict'; const formrestyle = require('./formrestyle'); -const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c])); +const S = require('./pagestyle'); +const esc = S.esc; const href = u => { const s = String(u || '').trim(); return /^https?:\/\/[^\s"'<>]+$/i.test(s) && s.length <= 700 ? s : ''; }; -const PALETTES = { - graphite: { bg: '#0F1422', panel: '#161D31', ink: '#EEF2F8', muted: '#A7B4CB', line: '#27314A', accent: '#3B9DFF', accentInk: '#061225', font: "'Segoe UI',system-ui,-apple-system,Roboto,sans-serif", display: "Georgia,'Times New Roman',serif" }, - ink: { bg: '#F6F4EE', panel: '#FFFFFF', ink: '#17191C', muted: '#5F6670', line: '#D9D4C7', accent: '#B8410E', accentInk: '#FFFFFF', font: "'Segoe UI',system-ui,-apple-system,Roboto,sans-serif", display: "Georgia,'Times New Roman',serif" }, - ember: { bg: '#1A1210', panel: '#241A16', ink: '#F7EFE9', muted: '#C9B8AE', line: '#3A2B25', accent: '#FF8A3D', accentInk: '#1A0E08', font: "'Segoe UI',system-ui,-apple-system,Roboto,sans-serif", display: "Georgia,'Times New Roman',serif" }, -}; -const PALETTE_NAMES = Object.keys(PALETTES); -function css(P) { - return '*{box-sizing:border-box}body{margin:0;background:' + P.bg + ';color:' + P.ink + ';font-family:' + P.font + ';font-size:17px;line-height:1.55}a{color:' + P.accent + '}' - + '.wrap{max-width:720px;margin:0 auto;padding:28px 18px 60px}.panel{background:' + P.panel + ';border:1px solid ' + P.line + ';border-radius:12px;padding:22px}' - + 'h1{font-family:' + P.display + ';font-size:clamp(30px,5.6vw,44px);line-height:1.08;margin:0 0 12px;text-wrap:balance}h2{font-family:' + P.display + ';font-size:24px;margin:26px 0 8px}h3{font-size:18px;margin:18px 0 6px}' - + '.sub{font-size:19px;color:' + P.muted + ';margin:0 0 18px}.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;font-weight:700;color:' + P.accent + ';margin-bottom:10px}' - + 'ul.checks{list-style:none;padding:0;margin:14px 0;display:grid;gap:8px}ul.checks li{padding-left:28px;position:relative}ul.checks li::before{content:"";position:absolute;left:0;top:8px;width:16px;height:16px;border-radius:50%;background:' + P.accent + '}ul.checks li::after{content:"";position:absolute;left:5px;top:11px;width:6px;height:9px;border:solid ' + P.accentInk + ';border-width:0 2px 2px 0;transform:rotate(45deg)}' - + '.cta{display:inline-block;background:' + P.accent + ';color:' + P.accentInk + ';font-weight:800;font-size:18px;text-decoration:none;padding:15px 26px;border-radius:10px;border:0;cursor:pointer;font-family:inherit}.cta:hover{filter:brightness(1.08)}.ctawrap{margin:18px 0;text-align:center}' - + '.lsform{display:grid;gap:10px}.lsin{width:100%;padding:14px 16px;font:16px/1.4 inherit;border:1.5px solid ' + P.line + ';border-radius:10px;background:' + P.bg + ';color:' + P.ink + '}.lsin:focus{border-color:' + P.accent + ';outline:none}' - + '.privacy{font-size:12.5px;color:' + P.muted + ';margin:10px 0 0;text-align:center}.hero img{width:100%;height:auto;border-radius:12px;margin:0 0 18px}' - + '.pc{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.pc div{background:' + P.bg + ';border:1px solid ' + P.line + ';border-radius:10px;padding:14px}.pc h3{margin:0 0 8px}.pc ul{margin:0;padding-left:18px}@media(max-width:560px){.pc{grid-template-columns:1fr}}' - + '.rating{font-size:22px;letter-spacing:2px;color:' + P.accent + '}.verdict{border-left:4px solid ' + P.accent + ';padding:10px 14px;margin:16px 0;background:' + P.bg + ';border-radius:0 10px 10px 0}' - + '.foot{margin-top:34px;font-size:12.5px;color:' + P.muted + ';text-align:center}.foot a{color:' + P.muted + '}p{margin:0 0 14px}'; +const PALETTE_NAMES = Object.keys(S.PALETTES).concat(['ink', 'ember']); + +// the three knobs a page carries, with safe fallbacks for anything stored by older code +function knobs(page) { const d = page.design || {}; return { pk: S.paletteKey(d.palette), design: S.designKey(d.design), layout: S.layoutKey(d.layout), niche: S.nicheKey(d.niche) }; } + +function baseCss(k) { + const P = S.PALETTES[k.pk], C = P.c, dkGround = k.design === 'dark' || k.design === 'ignition'; + const ground = k.design === 'editorial' ? C.cream : k.design === 'ignition' ? '#060606' : k.design === 'light' ? '#fff' : C.inkGreen; + const bodyInk = k.design === 'editorial' ? C.body : k.design === 'ignition' ? S.rgba(C.cream, 0.85) : k.design === 'light' ? C.body : S.rgba(C.cream, 0.82); + const font = k.design === 'editorial' ? '18px/1.7 ' + S.SERIF : '17px/1.6 ' + S.FONT; + const heroSkin = k.design === 'light' ? 'background:radial-gradient(ellipse 800px 480px at 85% 0%,' + S.rgba(C.gold, 0.1) + ',transparent 60%),radial-gradient(ellipse 700px 500px at 0% 100%,' + S.rgba(C.green, 0.08) + ',transparent 60%),#fff;color:' + C.ink + : k.design === 'editorial' ? 'background:' + C.cream + ';color:' + C.ink + ';border-bottom:2px solid ' + C.ink + : k.design === 'ignition' ? 'background:transparent;color:' + C.cream + : 'background:radial-gradient(ellipse 900px 500px at 70% -10%,' + S.rgba(C.gold, 0.16) + ',transparent 60%),radial-gradient(ellipse 700px 480px at 12% 8%,' + S.rgba(C.green, 0.35) + ',transparent 65%),' + C.inkGreen + ';color:' + C.cream; + const heroInk = dkGround ? C.cream : C.ink, heroBody = dkGround ? S.rgba(C.cream, 0.72) : C.body; + const h1font = k.design === 'ignition' ? 'font-family:' + S.IGNITION_DISPLAY + ';font-weight:400;text-transform:uppercase;letter-spacing:.5px;line-height:.98;font-size:clamp(40px,7vw,72px)' : k.design === 'editorial' ? 'font-family:' + S.SERIF + ';font-weight:700;font-size:clamp(34px,5.6vw,54px);line-height:1.08;letter-spacing:-.01em' : 'font-weight:800;font-size:clamp(32px,5.6vw,52px);line-height:1.08;letter-spacing:-.028em'; + return '*{box-sizing:border-box}body{margin:0;background:' + ground + ';color:' + bodyInk + ';font:' + font + ';-webkit-font-smoothing:antialiased}a{color:' + (dkGround ? C.goldSoft : C.green) + '}p{margin:0 0 16px}' + + '.hero,main,.foot,.wrap{position:relative;z-index:1}' + + '.hero{' + heroSkin + ';padding:72px 24px 64px;text-align:center;overflow:hidden}.hero>*{position:relative;z-index:1}' + + '.hero h1{' + h1font + ';margin:0 auto 18px;max-width:840px;color:' + heroInk + ';text-wrap:balance}.hero .lead{font-size:19px;line-height:1.6;color:' + heroBody + ';max-width:660px;margin:0 auto 8px}.hero .media{max-width:760px;margin:34px auto 0}.hero .ctawrap{margin:28px 0 0}' + + '.hs-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:56px;align-items:center;max-width:1080px;margin:0 auto;text-align:left}.hero.split{text-align:left;padding:72px 32px 64px}.hero.split h1{margin:0 0 18px;text-align:left;max-width:none}.hero.split .lead{margin:0 0 8px;max-width:none}.hero.split .media{margin:0}' + + 'main{max-width:680px;margin:0 auto;padding:56px 24px 64px}main h2{font-size:' + (k.design === 'editorial' ? '28px;font-family:' + S.SERIF : '24px') + ';margin:28px 0 10px;color:' + (dkGround ? C.cream : C.ink) + '}main h3{font-size:18px;margin:18px 0 6px;color:' + (dkGround ? C.cream : C.ink) + '}' + + (k.design === 'editorial' ? 'main p:first-of-type::first-letter{float:left;font-size:58px;line-height:.9;padding:6px 10px 0 0;color:' + C.gold + ';font-weight:700}' : '') + // squeeze card + + '.wrap{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:32px 20px 0}' + + '.card{background:' + (k.design === 'ignition' ? 'rgba(8,8,8,.55)' : '#fff') + ';max-width:560px;width:100%;border-radius:12px;border-top:4px solid ' + C.gold + ';padding:44px 40px 40px;text-align:center;box-shadow:0 24px 80px rgba(0,0,0,' + (dkGround ? '.45' : '.12') + ');color:' + (k.design === 'ignition' ? S.rgba(C.cream, 0.85) : C.body) + (k.design === 'ignition' ? ';border:1px solid ' + S.rgba(S.hotRamp(k.pk).hot1, 0.3) + ';border-top:4px solid ' + S.hotRamp(k.pk).hot1 + ';backdrop-filter:blur(6px)' : '') + '}' + + '.card h1{' + h1font.replace(/clamp\([^)]*\)/, 'clamp(28px,5.5vw,38px)') + ';margin:0 0 16px;color:' + (k.design === 'ignition' ? '#fff' : C.ink) + '}.card .sub{font-size:18px;line-height:1.6;margin:0 0 24px}.card ul.checks{margin:0 auto 24px;max-width:26em}.card .hero-img{width:100%;height:auto;border-radius:12px;margin:0 0 20px}' + + '.sq-grid{display:grid;grid-template-columns:1fr .85fr;gap:56px;align-items:center;max-width:1060px;width:100%;margin:0 auto}.sq-grid .card{max-width:none;text-align:left}.sq-grid ul.checks{max-width:none;margin:0 0 24px}' + + '@media(max-width:820px){.hs-grid,.sq-grid{grid-template-columns:1fr;gap:36px}.hero.split{text-align:center}.hero.split h1{text-align:center}.sq-grid .card{text-align:center}.sq-grid .pv,.hs-grid .media{order:-1}}@media(max-width:480px){.card{padding:32px 20px 28px}.hero{padding:52px 18px 44px}}' + + S.kitCss(k.design, k.pk) + S.visualCss(k.pk) + + (dkGround ? '.pc div{background:rgba(255,255,255,.04);border-color:' + S.rgba(C.cream, 0.1) + ';color:' + S.rgba(C.cream, 0.85) + '}.verdict{background:rgba(255,255,255,.04);color:' + S.rgba(C.cream, 0.85) + '}.bonus{background:rgba(255,255,255,.04);border-color:' + S.rgba(C.cream, 0.12) + ';box-shadow:none;color:' + S.rgba(C.cream, 0.85) + '}.bonus .tag{background:' + S.rgba(C.gold, 0.16) + ';color:' + C.goldSoft + '}' : '') + + (k.design === 'editorial' ? '.foot{color:' + C.muted + '}' : dkGround ? '.foot{color:rgba(245,241,232,.5)}' : '.foot{color:' + C.muted + '}'); } + const paras = t => String(t || '').split(/\n\s*\n/).map(x => x.trim()).filter(Boolean).map(x => '

' + esc(x).replace(/\n/g, '
') + '

').join(''); -const bullets = arr => (arr || []).filter(Boolean).length ? '' : ''; +const checks = arr => (arr || []).filter(Boolean).length ? '' : ''; function stars(n) { const k = Math.max(0, Math.min(5, Math.round(Number(n) || 0))); return '
' + '★'.repeat(k) + '☆'.repeat(5 - k) + '
'; } -function ctaBtn(c, cls) { const u = href(c && c.url); const t = esc(c && c.text || 'Continue'); return u ? '' : ''; } +const eyebrow = t => t ? '
' + esc(t) + '
' : ''; +function ctaBtn(c, extra) { const u = href(c && c.url); const t = esc((c && c.text) || 'Continue'); return u ? '
' + '' + t + '' + (extra || '') + '
' : ''; } +const headline = (k, t) => (k.design === 'ignition' ? S.blazeHeadline(t) : esc(t || '')); +// the visual on the right of a split: the member's image, else the niche hero, else the procedural card +function sideVisual(k, c) { + const img = href(c.image) || S.nicheHero(k.niche); + if (img) return '
' + esc(c.imageAlt || '') + '
'; + return '
' + S.visualHtml(c.headline, c.bullets && c.bullets.length ? c.bullets : c.pros, c.price) + '
'; +} function formArea(page, opts) { const c = page.content || {}; - if (c.formEmbed) { const parsed = formrestyle.parse(c.formEmbed); if (parsed) return '
' + formrestyle.html(parsed, c.cta && c.cta.text || 'Send me the details') + '
'; } - // our own capture: the lead lands on the member's LinkSpin list, then the visitor continues to the CTA URL - return '
'; + if (c.formEmbed) { const parsed = formrestyle.parse(c.formEmbed); if (parsed) return '
' + formrestyle.html(parsed, (c.cta && c.cta.text) || 'Send me the details') + '
'; } + return '
' + + '
'; } + function render(page, opts) { - opts = opts || {}; const P = PALETTES[page.design && page.design.palette] || PALETTES.graphite; const c = page.content || {}; + opts = opts || {}; const k = knobs(page); const c = page.content || {}; const split = k.layout === 'split'; + const img = href(c.image) || S.nicheHero(k.niche); const head = '' + esc(c.headline || page.title || 'Page') + '' - + '' + (page.status !== 'published' ? '' : '') + (c.image ? '' : '') + ''; + + '' + (page.status !== 'published' ? '' : '') + + (img ? '' : '') + '' + + ''; let body = ''; - const hero = c.image && href(c.image) ? '
' + esc(c.imageAlt || '') + '
' : ''; if (page.type === 'squeeze') { - body = '
' + (c.eyebrow ? '
' + esc(c.eyebrow) + '
' : '') + '

' + esc(c.headline || '') + '

' + (c.sub ? '

' + esc(c.sub) + '

' : '') + hero + bullets(c.bullets) + formArea(page, opts) + '

' + esc(c.privacy || 'No spam, ever. Unsubscribe with one click.') + '

'; - } else if (page.type === 'review') { - body = '
' + (c.eyebrow ? '
' + esc(c.eyebrow) + '
' : '
Review
') + '

' + esc(c.headline || '') + '

' + (c.rating ? stars(c.rating) : '') + (c.sub ? '

' + esc(c.sub) + '

' : '') + hero + paras(c.body) - + ((c.pros && c.pros.length) || (c.cons && c.cons.length) ? '

What works

    ' + (c.pros || []).filter(Boolean).map(x => '
  • ' + esc(x) + '
  • ').join('') + '

What to know

    ' + (c.cons || []).filter(Boolean).map(x => '
  • ' + esc(x) + '
  • ').join('') + '
' : '') - + (c.verdict ? '
Verdict. ' + esc(c.verdict) + '
' : '') + ctaBtn(c.cta) + '
'; - } else { // bridge - body = '
' + (c.eyebrow ? '
' + esc(c.eyebrow) + '
' : '') + '

' + esc(c.headline || '') + '

' + (c.sub ? '

' + esc(c.sub) + '

' : '') + hero + paras(c.body) + bullets(c.bullets) + ctaBtn(c.cta) + (c.bonus ? '

' + esc(c.bonusTitle || 'Bonus when you join through this page') + '

' + paras(c.bonus) + '
' : '') + ctaBtn(c.cta) + '
'; + const card = '
' + eyebrow(c.eyebrow || 'Free · Instant access') + '

' + headline(k, c.headline) + '

' + (c.sub ? '

' + esc(c.sub) + '

' : '') + + (!split && img ? '' + esc(c.imageAlt || '') + '' : '') + checks(c.bullets) + formArea(page, opts) + + (c.privacy ? '

' + esc(c.privacy) + '

' : '

No spam. Unsubscribe any time.

') + '
'; + body = '
' + (split ? '
' + card + sideVisual(k, c) + '
' : card.replace('
', '
')) + '
'; + } else { + const isReview = page.type === 'review'; + const heroCopy = eyebrow(c.eyebrow || (isReview ? 'Review' : '')) + '

' + headline(k, c.headline) + '

' + (isReview && c.rating ? stars(c.rating) : '') + (c.sub ? '

' + esc(c.sub) + '

' : '') + ctaBtn(c.cta); + const media = img ? '
' + esc(c.imageAlt || '') + '
' : (split ? sideVisual(k, c) : ''); + const hero = split ? '
' + heroCopy + '
' + media + '
' : '
' + heroCopy + media + '
'; + let main = paras(c.body); + if (isReview) { + main += ((c.pros && c.pros.length) || (c.cons && c.cons.length) ? '

What works

    ' + (c.pros || []).filter(Boolean).map(x => '
  • ' + esc(x) + '
  • ').join('') + '

What to know

    ' + (c.cons || []).filter(Boolean).map(x => '
  • ' + esc(x) + '
  • ').join('') + '
' : '') + + (c.verdict ? '
Verdict. ' + esc(c.verdict) + '
' : ''); + } else { + main += checks(c.bullets) + (c.bonus ? '
' + esc(c.bonusTitle || 'Bonus when you join through this page') + '
' + paras(c.bonus) + '
' : ''); + } + main += ctaBtn(c.cta); + body = hero + '
' + main + '
'; } const foot = '
' + esc(c.disclaimer || 'Results depend on effort. Nothing here is a promise of income.') + (opts.footerLink ? ' · ' + esc(opts.footerText || 'Made with LinkSpin') + '' : '') + '
'; return head + body + foot + ''; } -module.exports = { render, PALETTE_NAMES }; +module.exports = { render, PALETTE_NAMES, knobs, catalog: S.catalog }; diff --git a/pages.js b/pages.js index f97fb0e..cb4a073 100644 --- a/pages.js +++ b/pages.js @@ -10,6 +10,7 @@ const http = require('http'); const dns = require('dns').promises; const net = require('net'); const render = require('./pagerender'); +const style = require('./pagestyle'); const formrestyle = require('./formrestyle'); let DATA_DIR = null, ownHosts = () => [], keyFn = () => ''; @@ -39,18 +40,27 @@ function sanitizeContent(c, type) { out.cta = { text: String(c.cta && c.cta.text || '').slice(0, 60), url: cleanUrl(c.cta && c.cta.url) }; out.image = cleanUrl(c.image); out.imageAlt = String(c.imageAlt || '').slice(0, 120); out.privacy = String(c.privacy || '').slice(0, 200); out.disclaimer = String(c.disclaimer || '').slice(0, 300); + out.price = String(c.price || '').slice(0, 24); // optional '$17' chip on the split visual if (type === 'review') { out.rating = Math.max(0, Math.min(5, Number(c.rating) || 0)); out.pros = strs(c.pros, 6, 140); out.cons = strs(c.cons, 6, 140); out.verdict = String(c.verdict || '').slice(0, 400); } if (type === 'bridge') { out.bonus = String(c.bonus || '').slice(0, 2000); out.bonusTitle = String(c.bonusTitle || '').slice(0, 100); } if (type === 'squeeze') { out.formEmbed = String(c.formEmbed || '').slice(0, formrestyle.EMBED_MAX_CHARS); } return out; } +// the three knobs + niche; a niche preset sets design + palette unless the body overrides them (a preset is a start, not a lock) +function designFrom(body, cur) { + cur = cur || {}; const niche = body.niche != null ? style.nicheKey(body.niche) : (cur.niche || ''); const preset = niche ? style.NICHES[niche] : null; + const palette = body.palette != null ? style.paletteKey(body.palette) : (body.niche != null && preset ? preset.palette : style.paletteKey(cur.palette)); + const design = body.design != null ? style.designKey(body.design) : (body.niche != null && preset ? preset.design : style.designKey(cur.design)); + const layout = body.layout != null ? style.layoutKey(body.layout) : style.layoutKey(cur.layout || (body.niche != null && preset ? 'split' : 'stack')); + return { palette, design, layout, niche }; +} async function create(owner, body) { if (J.db.pages.filter(p => p.owner === norm(owner)).length >= 200) return { error: 'That is a lot of pages. Remove some first.' }; const type = TYPES.includes(body.type) ? body.type : 'bridge'; const title = String(body.title || (body.content && body.content.headline) || 'Untitled page').trim().slice(0, 100); const content = sanitizeContent(body.content, type); if (type === 'squeeze' && content.formEmbed) { const why = formrestyle.problem(content.formEmbed); if (why) return { error: why }; } - const p = { id: crypto.randomBytes(5).toString('hex'), owner: norm(owner), slug: slugify(title), type, title, status: 'draft', design: { palette: render.PALETTE_NAMES.includes(body.palette) ? body.palette : 'graphite' }, content, scan: body.scan && typeof body.scan === 'object' ? { url: cleanUrl(body.scan.url), title: String(body.scan.title || '').slice(0, 200), description: String(body.scan.description || '').slice(0, 300), h1: String(body.scan.h1 || '').slice(0, 200), image: cleanUrl(body.scan.image), headings: strs(body.scan.headings, 8, 120), bullets: strs(body.scan.bullets, 8, 140) } : null, angle: String(body.angle || '').slice(0, 160), created: Date.now(), updated: Date.now() }; + const p = { id: crypto.randomBytes(5).toString('hex'), owner: norm(owner), slug: slugify(title), type, title, status: 'draft', design: designFrom(body, null), content, scan: body.scan && typeof body.scan === 'object' ? { url: cleanUrl(body.scan.url), title: String(body.scan.title || '').slice(0, 200), description: String(body.scan.description || '').slice(0, 300), h1: String(body.scan.h1 || '').slice(0, 200), image: cleanUrl(body.scan.image), headings: strs(body.scan.headings, 8, 120), bullets: strs(body.scan.bullets, 8, 140) } : null, angle: String(body.angle || '').slice(0, 160), created: Date.now(), updated: Date.now() }; J.db.pages.push(p); J.save(); return { ok: true, page: pub(p) }; } async function update(owner, id, body) { @@ -58,7 +68,7 @@ async function update(owner, id, body) { if (body.remove) { J.db.pages = J.db.pages.filter(x => x !== p); J.save(); return { ok: true, removed: true }; } if (body.title != null) p.title = String(body.title).trim().slice(0, 100) || p.title; if (body.type != null && TYPES.includes(body.type)) p.type = body.type; - if (body.palette != null && render.PALETTE_NAMES.includes(body.palette)) p.design.palette = body.palette; + if (body.palette != null || body.design != null || body.layout != null || body.niche != null) p.design = designFrom(body, p.design || {}); if (body.angle != null) p.angle = String(body.angle).slice(0, 160); if (body.content != null) { const c = sanitizeContent(Object.assign({}, p.content, body.content), p.type); if (p.type === 'squeeze' && c.formEmbed) { const why = formrestyle.problem(c.formEmbed); if (why) return { error: why }; } p.content = c; } if (body.status != null) { if (body.status === 'published') { if (!p.content.headline) return { error: 'Give the page a headline before publishing.' }; if (p.type !== 'squeeze' && !p.content.cta.url) return { error: 'Add the button link (where the page sends people) before publishing.' }; p.status = 'published'; } else p.status = 'draft'; } diff --git a/pagestyle.js b/pagestyle.js new file mode 100644 index 0000000..513c670 --- /dev/null +++ b/pagestyle.js @@ -0,0 +1,133 @@ +// 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 NICHE_HERO_ORIGIN = 'https://mybrandedvoice.com'; +const NICHES = { + 'health-wellness': { label: 'Health & Wellness', design: 'light', palette: 'ocean', hero: '/marketing/niches/health-wellness.jpg', blurb: 'Fresh and calm: teal & sand, clean light pages' }, + 'make-money-online': { label: 'Make Money Online', design: 'ignition', palette: 'heritage', hero: '/marketing/niches/make-money-online.jpg', blurb: 'Launch heat: black ground, inferno orange' }, + 'personal-finance': { label: 'Personal Finance', design: 'dark', palette: 'midnight', hero: '/marketing/niches/personal-finance.jpg', blurb: 'Trustworthy: navy & amber, dramatic dark' }, + 'coaching-consulting': { label: 'Coaching & Consulting', design: 'editorial', palette: 'plum', hero: '/marketing/niches/coaching-consulting.jpg', blurb: 'Premium: magazine layout, aubergine & honey' }, + 'self-improvement': { label: 'Self-Improvement', design: 'light', palette: 'heritage', hero: '/marketing/niches/self-improvement.jpg', blurb: 'Uplifting: green & gold on clean white' }, + relationships: { label: 'Relationships', design: 'light', palette: 'plum', hero: '/marketing/niches/relationships.jpg', blurb: 'Warm: aubergine & honey, soft light pages' }, +}; +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 nicheHero = n => (NICHES[n] ? NICHE_HERO_ORIGIN + NICHES[n].hero : ''); +// 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: NICHE_HERO_ORIGIN + n.hero })), +}); + +// ---- colour helpers ---- +const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[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)) + '' + esc(money[0]) + '' + esc(plain.slice(money.index + money[0].length)); + const w = plain.split(/\s+/); if (w.length < 4) return '' + esc(plain) + ''; + return esc(w.slice(0, -3).join(' ')) + ' ' + esc(w.slice(-3).join(' ')) + ''; +} + +// ---- 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}.k-imgframe img{display:block;width:100%;height:auto}.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 ? '
' + esc(price) + '
' : ''; + const ticks = arr => arr.slice(0, 3).map(b => '
✓' + esc(b) + '
').join(''); + if (motif === 'product') return '
' + chip + '

Instant access

' + esc(offer) + '

' + (bullets.length ? '
' + ticks(bullets) + '
' : '') + '
'; + if (motif === 'checklist') return '
' + chip + '

' + esc(offer) + '

' + ticks(bullets.length ? bullets : ['Everything included', 'Ready to use today', 'Yours to keep']) + '
'; + const many = offer.split(/\s+/).length > 2; + return '
' + chip + '
' + esc(many ? '100%' : offer) + '' + esc(many ? offer : 'complete system') + '
' + (bullets.length ? '
' + ticks(bullets) + '
' : '') + '
'; +} + +module.exports = { FONT, SERIF, IGNITION_DISPLAY, PALETTES, DESIGNS, LAYOUTS, NICHES, paletteKey, designKey, layoutKey, nicheKey, nicheHero, catalog, rgba, hotRamp, blazeHeadline, kitCss, visualCss, visualHtml, esc }; diff --git a/public/assets/pages-screen.js b/public/assets/pages-screen.js index d94fd4c..54a2011 100644 --- a/public/assets/pages-screen.js +++ b/public/assets/pages-screen.js @@ -2,12 +2,12 @@ (function () { const $ = id => document.getElementById(id); const esc = CR.esc, fmt = CR.fmt, api = CR.api, toast = CR.toast, dialog = CR.dialog; let PAGES = [], SEL = null, SCAN = null, TYPE = 'bridge', HOSTS = []; - const PAL = { graphite: '#3B9DFF', ink: '#B8410E', ember: '#FF8A3D' }; + let STYLES = { palettes: [], designs: [], layouts: [], niches: [] }; CR.mount({ active: 'pages', title: 'Pages', sub: 'loading', actions: '' }); const pageUrl = p => 'https://' + (HOSTS[0] || location.host) + '/p/' + p.slug; async function load(keepSel) { let r; try { r = await CR.get('/api/my/pages'); } catch (e) { CR.sub('could not load'); return; } - PAGES = r.pages || []; HOSTS = r.hosts || []; + PAGES = r.pages || []; HOSTS = r.hosts || []; if (r.styles) STYLES = r.styles; const pubd = PAGES.filter(p => p.status === 'published').length; CR.sub(PAGES.length + ' page' + (PAGES.length === 1 ? '' : 's') + ' · ' + pubd + ' live'); const views = PAGES.reduce((n, p) => n + p.views, 0), leads = PAGES.reduce((n, p) => n + p.leads, 0), clicks = PAGES.reduce((n, p) => n + p.clicks, 0); @@ -36,7 +36,7 @@ // editor const F = { bridge: [['eyebrow', 'Eyebrow'], ['headline', 'Headline'], ['sub', 'Subhead'], ['body', 'Body, blank line between paragraphs', 'ta'], ['bullets', 'Bullets, one per line', 'ta'], ['bonusTitle', 'Bonus title'], ['bonus', 'Bonus text', 'ta'], ['ctaText', 'Button text'], ['ctaUrl', 'Button link'], ['image', 'Hero image URL'], ['disclaimer', 'Footer line']], review: [['eyebrow', 'Eyebrow'], ['headline', 'Headline'], ['rating', 'Rating 1 to 5'], ['sub', 'Subhead'], ['body', 'Review body, blank line between paragraphs', 'ta'], ['pros', 'What works, one per line', 'ta'], ['cons', 'What to know, one per line', 'ta'], ['verdict', 'Verdict'], ['ctaText', 'Button text'], ['ctaUrl', 'Button link'], ['image', 'Hero image URL'], ['disclaimer', 'Footer line']], - squeeze: [['eyebrow', 'Eyebrow'], ['headline', 'Headline'], ['sub', 'Subhead'], ['bullets', 'What they get, one per line', 'ta'], ['ctaText', 'Button text'], ['ctaUrl', 'Where they go after the form'], ['image', 'Image URL'], ['privacy', 'Privacy line'], ['formEmbed', 'Your autoresponder form (optional, plain HTML form only, no JavaScript). Leave empty to capture leads on your LinkSpin list.', 'ta'], ['disclaimer', 'Footer line']] }; + squeeze: [['eyebrow', 'Eyebrow'], ['headline', 'Headline'], ['sub', 'Subhead'], ['bullets', 'What they get, one per line', 'ta'], ['ctaText', 'Button text'], ['ctaUrl', 'Where they go after the form'], ['image', 'Image URL'], ['price', 'Price chip on the split visual, like $17 (optional)'], ['privacy', 'Privacy line'], ['formEmbed', 'Your autoresponder form (optional, plain HTML form only, no JavaScript). Leave empty to capture leads on your LinkSpin list.', 'ta'], ['disclaimer', 'Footer line']] }; function openEditor(id, quiet) { const p = PAGES.find(x => x.id === id); if (!p) return; SEL = id; $('gal').querySelectorAll('.card').forEach(c => c.classList.toggle('on', c.dataset.id === id)); @@ -46,8 +46,15 @@ $('edUrl').hidden = p.status !== 'published'; $('edUrl').textContent = pageUrl(p); const c = p.content || {}; const v = k => k === 'ctaText' ? (c.cta && c.cta.text) || '' : k === 'ctaUrl' ? (c.cta && c.cta.url) || '' : Array.isArray(c[k]) ? c[k].join('\n') : (c[k] == null ? '' : c[k]); $('edFields').innerHTML = F[p.type].map(([k, label, ta]) => '').join(''); - $('pal').innerHTML = Object.entries(PAL).map(([k, col]) => '').join(''); - $('pal').querySelectorAll('button').forEach(b => b.addEventListener('click', async () => { try { await api('/api/my/pages/' + p.id, { palette: b.dataset.p }); load(true); } catch (e) { toast(e.message, true); } })); + // the Look panel: niche preset, design, colours, layout. Each change saves at once and the gallery/preview refresh. + const d = p.design || {}; const setLook = async patch => { try { await api('/api/my/pages/' + p.id, patch); load(true); } catch (e) { toast(e.message, true); } }; + const ns = $('niche'); ns.innerHTML = '' + STYLES.niches.map(n => '').join(''); ns.onchange = () => setLook({ niche: ns.value }); + $('designs').innerHTML = STYLES.designs.map(x => '').join(''); + $('designs').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ design: b.dataset.d }))); + $('pal').innerHTML = STYLES.palettes.map(x => '').join(''); + $('pal').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ palette: b.dataset.p }))); + $('layouts').innerHTML = STYLES.layouts.map(x => '').join(''); + $('layouts').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ layout: b.dataset.l }))); if (!quiet && window.matchMedia('(max-width:900px)').matches) $('side').scrollIntoView({ behavior: 'smooth' }); } function collect(p) { const g = k => { const el = $('f-' + k); return el ? el.value : undefined; }; const c = {}; for (const [k] of F[p.type]) { if (k === 'ctaText' || k === 'ctaUrl') continue; c[k] = g(k); } c.cta = { text: g('ctaText'), url: g('ctaUrl') }; for (const k of ['bullets', 'pros', 'cons']) if (c[k] != null) c[k] = c[k].split('\n'); return c; } diff --git a/public/banners/linkspin-120x600.svg b/public/banners/linkspin-120x600.svg new file mode 100644 index 0000000..b991e7e --- /dev/null +++ b/public/banners/linkspin-120x600.svg @@ -0,0 +1 @@ +LinkSpinOne link.Every pageyou promote,in turn.Bots filteredon the server.Click idspass through.Your ownshort domain.Start free \ No newline at end of file diff --git a/public/banners/linkspin-125x125.svg b/public/banners/linkspin-125x125.svg new file mode 100644 index 0000000..ac4732d --- /dev/null +++ b/public/banners/linkspin-125x125.svg @@ -0,0 +1 @@ +LinkSpinOne link,every page.Start free \ No newline at end of file diff --git a/public/banners/linkspin-250x250.svg b/public/banners/linkspin-250x250.svg new file mode 100644 index 0000000..7e88ba6 --- /dev/null +++ b/public/banners/linkspin-250x250.svg @@ -0,0 +1 @@ +LinkSpinOne link. Every pageyou promote, in turn.Bots filtered. Real numbers.Start free \ No newline at end of file diff --git a/public/banners/linkspin-336x280.svg b/public/banners/linkspin-336x280.svg new file mode 100644 index 0000000..91eb0fa --- /dev/null +++ b/public/banners/linkspin-336x280.svg @@ -0,0 +1 @@ +LinkSpinOne link. Every page you promote, in turn.Weights, hours, health checks, real numbers.Start free \ No newline at end of file diff --git a/public/pages.html b/public/pages.html index fc7575e..ad86c94 100644 --- a/public/pages.html +++ b/public/pages.html @@ -8,6 +8,10 @@