Pages: niche hero SETS (4 photographic heroes per niche served from /niches, thumbnail picker in the Look panel, design.hero index) + new Gaming niche

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-08 14:41:29 -05:00
parent f59b3d2771
commit 9f4c913ae6
33 changed files with 23 additions and 16 deletions
+13 -10
View File
@@ -32,26 +32,29 @@ const DESIGNS = {
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 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', 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' },
'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 nicheHero = n => (NICHES[n] ? NICHE_HERO_ORIGIN + NICHES[n].hero : '');
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: NICHE_HERO_ORIGIN + n.hero })),
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 ----
@@ -130,4 +133,4 @@ function visualHtml(offer, bullets, price) {
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, catalog, rgba, hotRamp, blazeHeadline, kitCss, visualCss, visualHtml, esc };
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 };