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 <noreply@anthropic.com>
This commit is contained in:
@@ -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: '<button class="btn pri" type="button" id="newBtn">+ New page</button>' });
|
||||
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]) => '<label class="lbl">' + esc(label) + (ta ? '<textarea class="field" id="f-' + k + '">' + esc(v(k)) + '</textarea>' : '<input class="field' + (/Url|image/i.test(k) ? ' mono' : '') + '" id="f-' + k + '" value="' + esc(v(k)) + '">') + '</label>').join('');
|
||||
$('pal').innerHTML = Object.entries(PAL).map(([k, col]) => '<button type="button" title="' + k + '" data-p="' + k + '" class="' + ((p.design && p.design.palette) === k ? 'on' : '') + '" style="background:' + col + '"></button>').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 = '<option value="">None (set it yourself)</option>' + STYLES.niches.map(n => '<option value="' + n.key + '"' + (d.niche === n.key ? ' selected' : '') + '>' + esc(n.label) + ' \u00b7 ' + esc(n.blurb) + '</option>').join(''); ns.onchange = () => setLook({ niche: ns.value });
|
||||
$('designs').innerHTML = STYLES.designs.map(x => '<button type="button" data-d="' + x.key + '" class="' + (d.design === x.key ? 'on' : '') + '" title="' + esc(x.blurb) + '">' + esc(x.label) + '</button>').join('');
|
||||
$('designs').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ design: b.dataset.d })));
|
||||
$('pal').innerHTML = STYLES.palettes.map(x => '<button type="button" data-p="' + x.key + '" class="' + (d.palette === x.key ? 'on' : '') + '" title="' + esc(x.label + ', ' + x.sub) + '">' + x.swatch.map(col => '<i style="background:' + col + '"></i>').join('') + '</button>').join('');
|
||||
$('pal').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ palette: b.dataset.p })));
|
||||
$('layouts').innerHTML = STYLES.layouts.map(x => '<button type="button" data-l="' + x.key + '" class="' + ((d.layout || 'stack') === x.key ? 'on' : '') + '" title="' + esc(x.blurb) + '">' + esc(x.label) + '</button>').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; }
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="120" height="600" viewBox="0 0 120 600" role="img" aria-label="LinkSpin, one link, every page you promote"><rect width="120" height="600" rx="6" fill="#0B1220"/><rect x="0.5" y="0.5" width="119" height="599" rx="6" fill="none" stroke="#2A3A56"/><text x="12" y="46" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="22" fill="#E6EDF7">Link<tspan fill="#3B9DFF">Spin</tspan></text><text x="12" y="84" font-family="Segoe UI,Arial,sans-serif" font-size="12" fill="#AFC0D8">One link.</text><text x="12" y="102" font-family="Segoe UI,Arial,sans-serif" font-size="12" fill="#AFC0D8">Every page</text><text x="12" y="120" font-family="Segoe UI,Arial,sans-serif" font-size="12" fill="#AFC0D8">you promote,</text><text x="12" y="138" font-family="Segoe UI,Arial,sans-serif" font-size="12" fill="#AFC0D8">in turn.</text><text x="12" y="176" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">Bots filtered</text><text x="12" y="194" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">on the server.</text><text x="12" y="222" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">Click ids</text><text x="12" y="240" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">pass through.</text><text x="12" y="268" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">Your own</text><text x="12" y="286" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#6E82A3">short domain.</text><circle cx="60" cy="420" r="22" fill="none" stroke="#3B9DFF" stroke-width="3" stroke-dasharray="30 12"/><rect x="12" y="540" width="96" height="32" rx="6" fill="#3B9DFF"/><text x="60" y="561" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="12" fill="#061225" text-anchor="middle">Start free</text></svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="125" height="125" viewBox="0 0 125 125" role="img" aria-label="LinkSpin, one link, every page you promote"><rect width="125" height="125" rx="6" fill="#0B1220"/><rect x="0.5" y="0.5" width="124" height="124" rx="6" fill="none" stroke="#2A3A56"/><text x="12" y="40" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="20" fill="#E6EDF7">Link<tspan fill="#3B9DFF">Spin</tspan></text><text x="12" y="64" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#AFC0D8">One link,</text><text x="12" y="79" font-family="Segoe UI,Arial,sans-serif" font-size="11" fill="#AFC0D8">every page.</text><rect x="12" y="92" width="84" height="24" rx="6" fill="#3B9DFF"/><text x="54" y="108" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="11" fill="#061225" text-anchor="middle">Start free</text></svg>
|
||||
|
After Width: | Height: | Size: 878 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="250" height="250" viewBox="0 0 250 250" role="img" aria-label="LinkSpin, one link, every page you promote"><rect width="250" height="250" rx="6" fill="#0B1220"/><rect x="0.5" y="0.5" width="249" height="249" rx="6" fill="none" stroke="#2A3A56"/><circle cx="232" cy="232" r="7" fill="none" stroke="#3B9DFF" stroke-width="3" stroke-dasharray="30 12"/><text x="20" y="62" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="28" fill="#E6EDF7">Link<tspan fill="#3B9DFF">Spin</tspan></text><text x="20" y="100" font-family="Segoe UI,Arial,sans-serif" font-size="15" fill="#AFC0D8">One link. Every page</text><text x="20" y="121" font-family="Segoe UI,Arial,sans-serif" font-size="15" fill="#AFC0D8">you promote, in turn.</text><text x="20" y="150" font-family="Segoe UI,Arial,sans-serif" font-size="12.5" fill="#6E82A3">Bots filtered. Real numbers.</text><rect x="20" y="182" width="130" height="36" rx="6" fill="#3B9DFF"/><text x="85" y="206" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="14" fill="#061225" text-anchor="middle">Start free</text></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="336" height="280" viewBox="0 0 336 280" role="img" aria-label="LinkSpin, one link, every page you promote"><rect width="336" height="280" rx="6" fill="#0B1220"/><rect x="0.5" y="0.5" width="335" height="279" rx="6" fill="none" stroke="#2A3A56"/><circle cx="318" cy="262" r="8" fill="none" stroke="#3B9DFF" stroke-width="3" stroke-dasharray="30 12"/><text x="26" y="74" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="32" fill="#E6EDF7">Link<tspan fill="#3B9DFF">Spin</tspan></text><text x="26" y="116" font-family="Segoe UI,Arial,sans-serif" font-size="17" fill="#AFC0D8">One link. Every page you promote, in turn.</text><text x="26" y="142" font-family="Segoe UI,Arial,sans-serif" font-size="14" fill="#6E82A3">Weights, hours, health checks, real numbers.</text><rect x="26" y="186" width="150" height="40" rx="6" fill="#3B9DFF"/><text x="101" y="213" font-family="Segoe UI,Arial,sans-serif" font-weight="800" font-size="15" fill="#061225" text-anchor="middle">Start free</text></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
+14
-2
@@ -8,6 +8,10 @@
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Manrope:wght@400;500;700&family=JetBrains+Mono:wght@500;700&display=swap">
|
||||
<link rel="stylesheet" href="/assets/cr.css?v=20261007b">
|
||||
<style>
|
||||
.look{display:grid;gap:10px;margin:6px 0 10px}.lk-row{display:flex;gap:10px;align-items:flex-start}.lk-k{flex:none;width:64px;font:700 11px var(--mono);letter-spacing:.1em;text-transform:uppercase;color:var(--muted);padding-top:9px}
|
||||
.lk-opts{display:flex;gap:6px;flex-wrap:wrap}.lk-opts button{font:600 12px var(--body);padding:7px 10px;border-radius:7px;border:1px solid var(--line);background:transparent;color:var(--fg);cursor:pointer}.lk-opts button.on{border-color:var(--accent);background:rgba(59,157,255,.12)}
|
||||
.pal{display:flex;gap:8px;flex-wrap:wrap}.pal button{width:34px;height:26px;border-radius:7px;border:2px solid transparent;cursor:pointer;padding:0;overflow:hidden;display:grid;grid-template-columns:1fr 1fr 1fr}.pal button i{display:block}.pal button.on{border-color:var(--fg)}
|
||||
|
||||
.ws{display:grid;grid-template-columns:minmax(0,1fr) 440px;min-height:calc(100vh - 94px)}
|
||||
.body{padding:16px 24px;display:grid;gap:14px;align-content:start}
|
||||
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px}
|
||||
@@ -50,12 +54,20 @@
|
||||
<div style="display:flex;gap:8px;flex-wrap:wrap;align-items:center"><span id="edStatus"></span><a class="btn sm" id="edPreview" href="#" target="_blank" rel="noopener">Preview</a><button class="btn sm pri" type="button" id="edPublish">Publish</button><button class="btn sm" type="button" id="edSpin">Put it in a spin</button><button class="btn sm danger" type="button" id="edDelete">Delete</button></div>
|
||||
<div class="code" id="edUrl" hidden></div>
|
||||
<div class="ed" id="edFields"></div>
|
||||
<div style="display:flex;gap:8px;align-items:center"><span class="sec">Look</span><div class="pal" id="pal"></div><span class="grow"></span><button class="btn sm" type="button" id="edRewrite">Write again</button><button class="btn pri" type="button" id="edSave">Save</button></div>
|
||||
<div class="look" id="look">
|
||||
<div class="sec">Look</div>
|
||||
<label class="lbl">Niche preset<select class="field" id="niche"><option value="">None (set it yourself)</option></select></label>
|
||||
<div class="lk-row"><span class="lk-k">Design</span><div class="lk-opts" id="designs"></div></div>
|
||||
<div class="lk-row"><span class="lk-k">Colours</span><div class="pal" id="pal"></div></div>
|
||||
<div class="lk-row"><span class="lk-k">Layout</span><div class="lk-opts" id="layouts"></div></div>
|
||||
<div class="muted" id="lookNote">Pick a niche for a ready-made combo, then change any knob. The split hero shows your image, the niche image, or a card built from your copy.</div>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;align-items:center"><span class="grow"></span><button class="btn sm" type="button" id="edRewrite">Write again</button><button class="btn pri" type="button" id="edSave">Save</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20260929d"></script>
|
||||
<script src="/assets/pages-screen.js?v=20260929a"></script>
|
||||
<script src="/assets/pages-screen.js?v=20261007a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user