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>
@@ -49,6 +49,7 @@
|
||||
// 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 });
|
||||
{ const nn = STYLES.niches.find(n => n.key === d.niche); const row = $('heroRow'); if (nn && nn.heroes && nn.heroes.length > 1 && row) { row.hidden = false; $('heroes').innerHTML = nn.heroes.map((u, i) => '<button type="button" data-h="' + i + '" class="' + ((Number(d.hero) || 0) === i ? 'on' : '') + '" title="Hero ' + (i + 1) + '"><img src="' + esc(u) + '" alt="" loading="lazy"></button>').join(''); $('heroes').querySelectorAll('button').forEach(b => b.addEventListener('click', () => setLook({ hero: Number(b.dataset.h) }))); } else if (row) row.hidden = true; }
|
||||
$('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('');
|
||||
|
||||
|
After Width: | Height: | Size: 209 KiB |
|
After Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 152 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 128 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 160 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 149 KiB |
|
After Width: | Height: | Size: 145 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 243 KiB |
|
After Width: | Height: | Size: 132 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 171 KiB |
|
After Width: | Height: | Size: 256 KiB |
|
After Width: | Height: | Size: 129 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 187 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 133 KiB |
|
After Width: | Height: | Size: 129 KiB |
@@ -10,6 +10,7 @@
|
||||
<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)}
|
||||
.heroes{display:flex;gap:6px;flex-wrap:wrap}.heroes button{width:72px;height:48px;border-radius:7px;border:2px solid var(--line);padding:0;overflow:hidden;cursor:pointer;background:#000}.heroes button img{width:100%;height:100%;object-fit:cover;display:block;opacity:.8}.heroes button.on{border-color:var(--accent)}.heroes button.on img{opacity:1}
|
||||
.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)}
|
||||
@@ -57,6 +58,7 @@
|
||||
<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" id="heroRow" hidden><span class="lk-k">Hero</span><div class="heroes" id="heroes"></div></div>
|
||||
<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>
|
||||
@@ -68,6 +70,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/cr-shell.js?v=20261008a"></script>
|
||||
<script src="/assets/pages-screen.js?v=20261007a"></script>
|
||||
<script src="/assets/pages-screen.js?v=20261008a"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||