← back to Wallco Ai
feat(pdp): V3 Sticky Hero + Tabs theme — /design/:id/tabs + Theme submenu entry
06db4d7a7093df0a829fdd809645ef535c869e83 · 2026-05-28 17:46:25 -0700 · Steve Abrams
Pinned full-height hero column left, right pane is a 6-tab surface
(Buy / Specs / Coords / Room / Trade / Share). Each tab content lives in
its own panel; client-side tab switcher. Reuses /api/design/:id;
no template-literal surgery.
Files touched
A public/theme-variants/v3-tabs.htmlM server.js
Diff
commit 06db4d7a7093df0a829fdd809645ef535c869e83
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu May 28 17:46:25 2026 -0700
feat(pdp): V3 Sticky Hero + Tabs theme — /design/:id/tabs + Theme submenu entry
Pinned full-height hero column left, right pane is a 6-tab surface
(Buy / Specs / Coords / Room / Trade / Share). Each tab content lives in
its own panel; client-side tab switcher. Reuses /api/design/:id;
no template-literal surgery.
---
public/theme-variants/v3-tabs.html | 682 +++++++++++++++++++++++++++++++++++++
server.js | 12 +
2 files changed, 694 insertions(+)
diff --git a/public/theme-variants/v3-tabs.html b/public/theme-variants/v3-tabs.html
new file mode 100644
index 0000000..4fcc4e5
--- /dev/null
+++ b/public/theme-variants/v3-tabs.html
@@ -0,0 +1,682 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>wallco.ai — Sticky Hero + Tabs PDP</title>
+<link rel="icon" href="/static/favicon.ico" type="image/x-icon">
+<style>
+ :root {
+ --bg: #faf8f3;
+ --ink: #1a1611;
+ --muted: #8a8276;
+ --line: #e2dccd;
+ --panel: #f3efe5;
+ --panel-2: #ebe5d6;
+ --accent: #c9b07a;
+ --accent-dk: #1a1611;
+ --hero-bg: #e6dfd2;
+ --calc: #ddd4ec;
+ --coord: #d3e3e5;
+ --share: #f3dcce;
+ --room: #cfdac4;
+ --rate: #f0e7c3;
+ --trade: #e6ddd2;
+ --tab-bg: #efe9da;
+ --tab-active: #faf8f3;
+ --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
+ --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
+ --r: 10px;
+ }
+ * { box-sizing: border-box; }
+ html, body { margin: 0; padding: 0; }
+ body {
+ background: var(--bg);
+ color: var(--ink);
+ font: 14px/1.5 var(--sans);
+ -webkit-font-smoothing: antialiased;
+ }
+ a { color: inherit; }
+ button { font: inherit; cursor: pointer; }
+
+ /* ── topbar ─────────────────────────────────────────────────────────── */
+ header.topbar {
+ position: sticky; top: 0; z-index: 30;
+ background: rgba(250,248,243,.92);
+ backdrop-filter: blur(10px);
+ border-bottom: 1px solid var(--line);
+ padding: 10px 28px;
+ display: flex; align-items: center; gap: 24px;
+ }
+ header .brand { font: 600 18px/1 var(--serif); letter-spacing: .05em; }
+ header nav { font-size: 12.5px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
+ header nav a { text-decoration: none; }
+ header nav a:hover { color: var(--ink); }
+ header .grow { flex: 1; }
+ header .switcher { font-size: 11px; color: var(--muted); }
+ header .switcher a { text-decoration: underline; color: var(--ink); margin-left: 8px; }
+
+ /* ── breadcrumb ─────────────────────────────────────────────────────── */
+ .crumb {
+ max-width: 1640px; margin: 0 auto; padding: 14px 28px 0;
+ display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--muted);
+ }
+ .crumb .grow { flex: 1; }
+ .crumb a { color: var(--ink); text-decoration: none; }
+ .crumb .nav a { color: var(--muted); }
+
+ /* ── two-column layout — pinned hero / tabbed pane ────────────────── */
+ main.tabs {
+ max-width: 1640px; margin: 0 auto; padding: 16px 28px 60px;
+ display: grid;
+ grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
+ gap: 28px;
+ align-items: start;
+ }
+ .col-hero {
+ position: sticky; top: 62px;
+ height: calc(100vh - 92px);
+ background: var(--hero-bg);
+ border-radius: var(--r);
+ overflow: hidden;
+ box-shadow: 0 1px 0 var(--line);
+ }
+ .col-hero img {
+ width: 100%; height: 100%; object-fit: cover; display: block;
+ }
+ .col-hero .pill {
+ position: absolute; top: 14px; right: 14px;
+ background: rgba(250,248,243,.94); color: var(--ink);
+ font: 600 10.5px/1 var(--sans); letter-spacing: .06em;
+ padding: 7px 10px; border-radius: 999px; text-transform: uppercase;
+ }
+ .col-hero .info {
+ position: absolute; left: 14px; bottom: 14px;
+ background: rgba(26,22,17,.78); color: #f0eada;
+ font: 600 11px/1 var(--sans); letter-spacing: .06em;
+ padding: 8px 12px; border-radius: 6px; text-transform: uppercase;
+ }
+ .col-hero .thumbs {
+ position: absolute; left: 14px; right: 14px; top: 14px;
+ display: flex; gap: 8px; pointer-events: none;
+ }
+ .col-hero .thumbs .thumb {
+ width: 56px; height: 56px; border-radius: 6px;
+ background-size: cover; background-position: center;
+ border: 2px solid rgba(250,248,243,.7); pointer-events: auto; cursor: pointer;
+ }
+ .col-hero .thumbs .thumb.active { border-color: var(--accent); }
+
+ .col-pane { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
+
+ .title-card {
+ background: var(--bg); border: 1px solid var(--line);
+ border-radius: var(--r); padding: 18px;
+ }
+ .title-card .name { font: 500 28px/1.1 var(--serif); margin: 4px 0 6px; }
+ .title-card .meta { color: var(--muted); font-size: 12.5px; }
+ .title-card .meta .sep { padding: 0 6px; opacity: .5; }
+ .title-card .chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
+ .chip {
+ display: inline-flex; align-items: center; gap: 6px;
+ background: var(--panel-2); color: var(--ink);
+ border-radius: 999px; padding: 5px 10px;
+ font: 500 11px/1 var(--sans); letter-spacing: .02em;
+ border: 1px solid var(--line);
+ }
+ .chip .dot { width: 10px; height: 10px; border-radius: 999px; background: #888; }
+
+ /* ── tab bar ────────────────────────────────────────────────────────── */
+ .tab-bar {
+ background: var(--tab-bg);
+ border-radius: var(--r) var(--r) 0 0;
+ border: 1px solid var(--line); border-bottom: 0;
+ display: grid; grid-template-columns: repeat(6, 1fr);
+ overflow: hidden;
+ }
+ .tab-btn {
+ background: transparent; border: 0; padding: 14px 8px;
+ font: 600 11px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
+ color: var(--muted); cursor: pointer;
+ border-bottom: 2px solid transparent;
+ transition: all .12s;
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
+ }
+ .tab-btn:hover { color: var(--ink); background: rgba(255,255,255,.4); }
+ .tab-btn.active {
+ color: var(--ink); background: var(--tab-active);
+ border-bottom-color: var(--accent);
+ }
+ .tab-pane {
+ background: var(--tab-active);
+ border: 1px solid var(--line); border-top: 0;
+ border-radius: 0 0 var(--r) var(--r);
+ padding: 20px;
+ min-height: 420px;
+ }
+ .tab-panel { display: none; }
+ .tab-panel.active { display: block; }
+
+ /* ── shared sub-cards in panes ──────────────────────────────────────── */
+ .sub {
+ background: var(--panel); border: 1px solid var(--line);
+ border-radius: 8px; padding: 14px;
+ margin-bottom: 12px;
+ }
+ .sub:last-child { margin-bottom: 0; }
+ .sub h4 {
+ margin: 0 0 10px;
+ font: 600 11px/1.2 var(--sans);
+ text-transform: uppercase;
+ letter-spacing: .08em;
+ color: var(--muted);
+ }
+
+ /* ── CTAs ───────────────────────────────────────────────────────────── */
+ .cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
+ .cta {
+ display: flex; align-items: center; justify-content: center;
+ border-radius: 8px; padding: 0 18px;
+ font: 700 12.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
+ height: 56px;
+ border: 1px solid transparent;
+ }
+ .cta.sample { background: var(--accent); color: var(--accent-dk); }
+ .cta.buy { background: var(--accent-dk); color: #f0eada; }
+ .cta:hover { filter: brightness(1.04); }
+ .cta:active { transform: translateY(1px); }
+
+ .calc { background: var(--calc); }
+ .calc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
+ .calc label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
+ .calc input, .calc select { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
+ .calc .total { margin-top: 6px; padding: 10px; background: rgba(255,255,255,.6); border-radius: 8px; font-size: 12.5px; }
+ .calc .total b { font-size: 16px; font-family: var(--serif); font-weight: 500; }
+
+ .swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
+ .sw { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); position: relative; cursor: pointer; }
+ .sw:hover .lbl { display: block; }
+ .sw .lbl { display: none; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 6px; white-space: nowrap; font: 500 10px/1 var(--sans); background: var(--ink); color: var(--bg); padding: 4px 6px; border-radius: 4px; z-index: 5; }
+ .dom { font-size: 11px; color: var(--muted); margin-top: 8px; }
+
+ .adjust .sl { display: grid; grid-template-columns: 70px 1fr 32px; align-items: center; gap: 6px; font-size: 11px; padding: 2px 0; }
+ .adjust .sl input[type=range] { accent-color: var(--accent); width: 100%; }
+ .adjust .sl .v { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
+
+ /* ── specs table ────────────────────────────────────────────────────── */
+ .specs-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
+ .specs-row:last-child { border-bottom: 0; }
+ .specs-row .k { color: var(--muted); }
+ .specs-row .v { font-weight: 600; text-align: right; }
+
+ /* ── pair / coord grids ────────────────────────────────────────────── */
+ .pair-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
+ .pair-grid .pair {
+ aspect-ratio: 1/1;
+ background: rgba(255,255,255,.55);
+ border-radius: 6px;
+ background-size: cover; background-position: center;
+ }
+ .pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
+ .pill { font-size: 11px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.65); border: 1px solid rgba(0,0,0,.06); }
+
+ /* ── room ───────────────────────────────────────────────────────────── */
+ .room-preview {
+ background: var(--room);
+ border-radius: 8px;
+ height: 280px;
+ background-size: cover; background-position: center;
+ position: relative;
+ }
+ .room-preview .badge {
+ position: absolute; top: 14px; left: 14px;
+ background: rgba(26,22,17,.78); color: #f0eada;
+ font: 600 10.5px/1 var(--sans); letter-spacing: .06em;
+ padding: 7px 11px; border-radius: 999px; text-transform: uppercase;
+ }
+ .room-preview .placeholder {
+ display: flex; align-items: center; justify-content: center;
+ height: 100%; color: var(--muted); font-size: 12px; font-style: italic;
+ }
+ .atscale {
+ position: relative;
+ background: var(--hero-bg);
+ border-radius: 8px;
+ height: 200px;
+ overflow: hidden; margin-top: 12px;
+ }
+ .atscale .repeat {
+ position: absolute; inset: 0;
+ background-repeat: repeat;
+ background-size: 180px 180px;
+ }
+ .atscale .label {
+ position: absolute; left: 14px; bottom: 14px;
+ background: rgba(26,22,17,.78); color: #f0eada;
+ font: 600 11px/1 var(--sans); letter-spacing: .06em;
+ padding: 8px 12px; border-radius: 6px; text-transform: uppercase;
+ }
+ .atscale .slider {
+ position: absolute; right: 14px; bottom: 14px;
+ background: rgba(250,248,243,.94);
+ border-radius: 999px; padding: 8px 14px;
+ font: 500 11px/1 var(--sans); color: var(--ink);
+ display: flex; align-items: center; gap: 8px;
+ }
+ .atscale .slider input[type=range] { width: 100px; accent-color: var(--accent); }
+
+ /* ── tile buttons (share/trade/furnish) ────────────────────────────── */
+ .tile-btns { display: flex; flex-wrap: wrap; gap: 8px; }
+ .tile-btn {
+ flex: 1; min-width: 100px;
+ background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.06);
+ padding: 12px 8px; border-radius: 8px;
+ font: 600 12px/1.2 var(--sans); color: var(--ink); text-align: center;
+ text-decoration: none;
+ }
+ .tile-btn:hover { background: #fff; }
+
+ /* ── footer ────────────────────────────────────────────────────────── */
+ footer.site {
+ border-top: 1px solid var(--line);
+ padding: 28px; text-align: center; color: var(--muted); font-size: 12px;
+ background: var(--panel); margin-top: 30px;
+ }
+ footer.site .h { font: 500 14px/1.4 var(--serif); color: var(--ink); margin-bottom: 4px; }
+
+ .loading-shell { display: flex; align-items: center; justify-content: center; height: 60vh; color: var(--muted); font-style: italic; font-size: 14px; }
+
+ /* ── modals ─────────────────────────────────────────────────────────── */
+ dialog.modal {
+ border: 0; border-radius: 14px; padding: 0;
+ max-width: 540px; width: 92vw;
+ box-shadow: 0 24px 80px rgba(0,0,0,.25);
+ background: var(--bg);
+ }
+ dialog.modal::backdrop { background: rgba(20,17,14,.55); backdrop-filter: blur(4px); }
+ dialog.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
+ dialog.modal header h3 { margin: 0; font: 500 18px/1 var(--serif); }
+ dialog.modal .close { background: transparent; border: 0; font-size: 22px; color: var(--muted); }
+ dialog.modal .body { padding: 18px 22px 24px; }
+
+ /* ── responsive ────────────────────────────────────────────────────── */
+ @media (max-width: 1024px) {
+ main.tabs { grid-template-columns: 1fr; gap: 16px; }
+ .col-hero { position: static; height: 60vh; }
+ .tab-bar { grid-template-columns: repeat(3, 1fr); }
+ .tab-btn { font-size: 10px; padding: 12px 6px; }
+ }
+ @media (max-width: 640px) {
+ main.tabs { padding: 14px; gap: 12px; }
+ header.topbar { flex-wrap: wrap; padding: 10px 14px; }
+ .crumb { padding: 10px 14px 0; }
+ .col-hero { height: 50vh; }
+ .tab-bar { grid-template-columns: repeat(2, 1fr); }
+ .cta-row { grid-template-columns: 1fr; }
+ .pair-grid { grid-template-columns: repeat(3, 1fr); }
+ }
+</style>
+</head>
+<body>
+
+<header class="topbar">
+ <a href="/" class="brand">wallco.ai</a>
+ <nav>
+ <a href="/designs?sort=newest">Designs</a>
+ <a href="/designs?cat=monterey-mural">Murals</a>
+ <a href="/samples">Samples</a>
+ <a href="/basket">Basket</a>
+ <a href="/designer-studio">Designer Studio</a>
+ </nav>
+ <span class="grow"></span>
+ <span class="switcher">Theme: Sticky Hero + Tabs (V3) <a id="back-to-classic" href="#">← Classic view</a></span>
+</header>
+
+<div id="root" class="loading-shell">Loading design…</div>
+
+<dialog class="modal" id="m-share"><header><h3>Share this design</h3><button class="close" onclick="document.getElementById('m-share').close()">×</button></header><div class="body" id="m-share-body"></div></dialog>
+<dialog class="modal" id="m-furnish"><header><h3>Furnish this design</h3><button class="close" onclick="document.getElementById('m-furnish').close()">×</button></header><div class="body" id="m-furnish-body"></div></dialog>
+<dialog class="modal" id="m-trade"><header><h3>Trade tools</h3><button class="close" onclick="document.getElementById('m-trade').close()">×</button></header><div class="body" id="m-trade-body"></div></dialog>
+
+<script>
+(async function () {
+ const pathMatch = location.pathname.match(/\/design\/(\d+)/);
+ const idFromQuery = new URLSearchParams(location.search).get('id');
+ const id = pathMatch ? parseInt(pathMatch[1], 10) : (idFromQuery ? parseInt(idFromQuery, 10) : null);
+ if (!Number.isFinite(id) || id < 1) {
+ document.getElementById('root').textContent = 'No design id in URL.';
+ return;
+ }
+ document.getElementById('back-to-classic').href = '/design/' + id;
+
+ let design;
+ try {
+ const r = await fetch('/api/design/' + id, { credentials: 'same-origin' });
+ if (!r.ok) throw new Error('HTTP ' + r.status);
+ const j = await r.json();
+ design = j.design;
+ } catch (e) {
+ document.getElementById('root').textContent = 'Failed to load design #' + id + ' — ' + e.message;
+ return;
+ }
+
+ const title = design.title || ('Design No.' + id);
+ const cat = design.category || 'wallpaper';
+ const catDisplay = (cat || '')
+ .replace(/^botanical-wonders · /, 'Botanical Wonders — ')
+ .replace(/^designer-zoo-calm/, 'Designer Zoo Calm')
+ .replace(/^cactus-pine-scenic/, 'Cactus Pine Scenic')
+ .replace(/^monterey-mural/, 'Coastal Scenic')
+ .replace(/^tree-mural/, 'Full-Room Scenic')
+ .replace(/^cactus-11ft-mural/, 'Single-Subject Mural')
+ .replace(/-/g, ' ')
+ .replace(/\b\w/g, c => c.toUpperCase());
+ const kindLabel = design.kind === 'seamless_tile' ? 'Seamless Tile (24×24")'
+ : design.kind === 'mural_panel' ? 'Mural Panel'
+ : design.kind === 'mural' ? 'Single-Subject Mural' : (design.kind || 'pattern');
+ const isMural = design.kind === 'mural_panel' || design.kind === 'mural';
+ const palette = Array.isArray(design.palette) ? design.palette : [];
+ const dominant = design.dominant_hex || (palette[0] && palette[0].hex) || '#888';
+ const img = design.image_url || ('/designs/img/by-id/' + id);
+ const w = Number(design.width_in) || 24;
+ const h = Number(design.height_in) || 24;
+ const repeatLabel = w + '"' + (w !== h ? ' × ' + h + '"' : '');
+ const rollOrPanel = isMural ? 'Per panel (36" × 11 ft)' : 'Per roll (27 ft)';
+ const handle = design.handle || ('wallco-' + id);
+ const generator = design.generator || 'wallco.ai';
+ const roomMockup = (design.room_mockups && (
+ typeof design.room_mockups === 'object' && !Array.isArray(design.room_mockups)
+ ? Object.keys(design.room_mockups)[0]
+ : design.room_mockups[0]
+ )) || null;
+ const roomImgUrl = roomMockup ? ('/designs/room/design_' + id + '_' + roomMockup + '.png') : null;
+
+ const root = document.getElementById('root');
+ root.className = '';
+ root.innerHTML = `
+<div class="crumb">
+ <a href="/designs">Designs</a>
+ <span>›</span>
+ <a href="/designs?cat=${encodeURIComponent(cat)}">${escapeHtml(catDisplay)}</a>
+ <span class="grow"></span>
+ <span class="nav">
+ <a href="/design/${id - 2}?theme=tabs">← prev</a>
+ <a href="/design/${id + 2}?theme=tabs">next →</a>
+ </span>
+</div>
+
+<main class="tabs">
+
+ <!-- PINNED HERO ────────────────────────────────────────────────────── -->
+ <div class="col-hero">
+ <img loading="eager" src="${img}" alt="${escapeAttr(title)}">
+ <span class="pill">${design.is_published ? 'Live' : 'Curating'}</span>
+ <span class="info">${escapeHtml(title)}</span>
+ </div>
+
+ <!-- TABBED PANE ────────────────────────────────────────────────────── -->
+ <div class="col-pane">
+
+ <div class="title-card">
+ <div class="name">${escapeHtml(title)}</div>
+ <div class="meta">
+ ${escapeHtml(catDisplay)}<span class="sep">·</span>${escapeHtml(kindLabel)}<span class="sep">·</span>${rollOrPanel}
+ </div>
+ <div class="chips">
+ <span class="chip"><span class="dot" style="background:${escapeAttr(dominant)}"></span>${escapeHtml(dominant)}</span>
+ <span class="chip">No.${id}</span>
+ <span class="chip">${escapeHtml(handle)}</span>
+ </div>
+ </div>
+
+ <div class="tab-bar" role="tablist">
+ <button class="tab-btn active" data-tab="buy" role="tab" aria-selected="true">Buy</button>
+ <button class="tab-btn" data-tab="specs" role="tab" aria-selected="false">Specs</button>
+ <button class="tab-btn" data-tab="coords" role="tab" aria-selected="false">Coords</button>
+ <button class="tab-btn" data-tab="room" role="tab" aria-selected="false">Room</button>
+ <button class="tab-btn" data-tab="trade" role="tab" aria-selected="false">Trade</button>
+ <button class="tab-btn" data-tab="share" role="tab" aria-selected="false">Share</button>
+ </div>
+
+ <div class="tab-pane">
+
+ <!-- BUY TAB ─────────────────────────────────────────────────── -->
+ <div class="tab-panel active" data-tab="buy" role="tabpanel">
+ <div class="cta-row">
+ <button class="cta sample" onclick="addSample()">Add sample · $4.25</button>
+ <button class="cta buy" onclick="document.getElementById('calc-input').focus()">Buy by the roll →</button>
+ </div>
+ <div class="sub calc">
+ <h4 style="color:#5a4f73">Calculator</h4>
+ <div class="row">
+ <div><label>Wall W (ft)</label><input id="calc-input" type="number" min="1" max="80" step="0.5" value="10"></div>
+ <div><label>Wall H (ft)</label><input id="calc-h" type="number" min="1" max="20" step="0.5" value="9"></div>
+ </div>
+ <div class="row">
+ <div><label>Roll width</label>
+ <select id="calc-rw">
+ <option value="24">24" residential</option>
+ <option value="36">36" wide-roll</option>
+ <option value="52">52" commercial</option>
+ </select>
+ </div>
+ <div><label>Repeat</label><input value='${repeatLabel}' readonly></div>
+ </div>
+ <div class="total" id="calc-total">— rolls · $—</div>
+ </div>
+ <div class="sub">
+ <h4>Palette · drag to recolor</h4>
+ <div class="swatches">
+ ${palette.length ? palette.slice(0, 5).map(p =>
+ `<div class="sw" style="background:${escapeAttr(p.hex)}"><span class="lbl">${escapeHtml(p.hex)} · ${(p.pct || 0).toFixed(1)}%</span></div>`
+ ).join('') : `<div class="sw" style="background:${escapeAttr(dominant)}"><span class="lbl">${escapeHtml(dominant)}</span></div>`}
+ </div>
+ <div class="dom">Dominant ${escapeHtml(dominant)}</div>
+ </div>
+ <div class="sub adjust">
+ <h4>Image adjustments</h4>
+ <div class="sl"><label>Hue</label><input type="range" min="-180" max="180" value="0"><span class="v">0</span></div>
+ <div class="sl"><label>Saturation</label><input type="range" min="0" max="200" value="100"><span class="v">100</span></div>
+ <div class="sl"><label>Brightness</label><input type="range" min="50" max="150" value="100"><span class="v">100</span></div>
+ <div class="sl"><label>Contrast</label><input type="range" min="50" max="150" value="100"><span class="v">100</span></div>
+ </div>
+ </div>
+
+ <!-- SPECS TAB ───────────────────────────────────────────────── -->
+ <div class="tab-panel" data-tab="specs" role="tabpanel">
+ <div class="sub">
+ <h4>Pattern specifications</h4>
+ <div class="specs-row"><span class="k">Category</span><span class="v">${escapeHtml(catDisplay)}</span></div>
+ <div class="specs-row"><span class="k">Kind</span><span class="v">${escapeHtml(kindLabel)}</span></div>
+ <div class="specs-row"><span class="k">Width</span><span class="v">${w}"</span></div>
+ <div class="specs-row"><span class="k">Repeat</span><span class="v">${repeatLabel}</span></div>
+ <div class="specs-row"><span class="k">Sold by</span><span class="v">${rollOrPanel}</span></div>
+ <div class="specs-row"><span class="k">${isMural ? 'Panel size' : 'Roll length'}</span><span class="v">${isMural ? (w + '" × 11 ft') : '27 ft'}</span></div>
+ <div class="specs-row"><span class="k">Material</span><span class="v">Type II vinyl, water-resist</span></div>
+ <div class="specs-row"><span class="k">Designed by</span><span class="v">${escapeHtml(generator)}</span></div>
+ <div class="specs-row"><span class="k">Pattern No.</span><span class="v">${id}</span></div>
+ <div class="specs-row"><span class="k">Handle</span><span class="v">${escapeHtml(handle)}</span></div>
+ <div class="specs-row"><span class="k">Dominant hex</span><span class="v">${escapeHtml(dominant)}</span></div>
+ <div class="specs-row"><span class="k">Status</span><span class="v">${design.is_published ? 'Live' : 'Curating'}</span></div>
+ </div>
+ <div class="sub">
+ <h4>Generator + prompt</h4>
+ <div style="font-size:11.5px; color:var(--muted); margin-bottom:6px">Seed <code>${escapeHtml(design.seed || '—')}</code></div>
+ <pre style="font:11px/1.5 ui-monospace,Menlo,monospace; background:var(--bg); padding:10px; border-radius:6px; max-height:160px; overflow:auto; margin:0; white-space:pre-wrap; word-break:break-word">${escapeHtml((design.prompt || '').slice(0, 1000))}${(design.prompt && design.prompt.length > 1000) ? '\n…[truncated]' : ''}</pre>
+ </div>
+ </div>
+
+ <!-- COORDINATES TAB ────────────────────────────────────────── -->
+ <div class="tab-panel" data-tab="coords" role="tabpanel">
+ <div class="sub" style="background:var(--coord)">
+ <h4>Pairs well with — 6 designer wallpapers</h4>
+ <div class="pair-grid">
+ <div class="pair"></div><div class="pair"></div><div class="pair"></div>
+ <div class="pair"></div><div class="pair"></div><div class="pair"></div>
+ </div>
+ </div>
+ <div class="sub" style="background:var(--coord)">
+ <h4>Coordinate paints</h4>
+ <div class="pill-list">
+ <a class="pill" href="#">Sherwin-Williams</a>
+ <a class="pill" href="#">Dunn-Edwards</a>
+ <a class="pill" href="#">Benjamin Moore</a>
+ <a class="pill" href="#">Farrow & Ball</a>
+ <a class="pill" href="#">Behr</a>
+ <a class="pill" href="#">PPG</a>
+ <a class="pill" href="#">RAL</a>
+ </div>
+ </div>
+ <div class="sub" style="background:var(--coord)">
+ <h4>Coordinate stripes & plaids · 24 generated</h4>
+ <div class="pair-grid" style="grid-template-columns:repeat(6,1fr)">
+ ${Array.from({length: 12}).map(() => '<div class="pair"></div>').join('')}
+ </div>
+ </div>
+ </div>
+
+ <!-- ROOM TAB ───────────────────────────────────────────────── -->
+ <div class="tab-panel" data-tab="room" role="tabpanel">
+ <div class="room-preview" ${roomImgUrl ? `style="background-image:url('${roomImgUrl}')"` : ''}>
+ <span class="badge">See in a room</span>
+ ${roomImgUrl ? '' : '<div class="placeholder">Room mockup not yet generated</div>'}
+ </div>
+ <div class="atscale">
+ <div class="repeat" style="background-image:url('${img}')"></div>
+ <span class="label">At-scale · 10 × 9 ft wall</span>
+ <span class="slider">scale <input type="range" min="80" max="320" value="180" id="scale-slider"></span>
+ </div>
+ <div class="sub" style="background:var(--room); margin-top:12px">
+ <h4>Furnish this design</h4>
+ <div class="tile-btns">
+ <a class="tile-btn" href="#" onclick="openFurnish();return false">Residential</a>
+ <a class="tile-btn" href="#" onclick="openFurnish();return false">Commercial</a>
+ <a class="tile-btn" href="#" onclick="openFurnish();return false">Hospitality</a>
+ <a class="tile-btn" href="#" onclick="openFurnish();return false">Healthcare</a>
+ </div>
+ </div>
+ </div>
+
+ <!-- TRADE TAB ──────────────────────────────────────────────── -->
+ <div class="tab-panel" data-tab="trade" role="tabpanel">
+ <div class="sub" style="background:var(--trade)">
+ <h4>Trade tools</h4>
+ <div class="tile-btns">
+ <a class="tile-btn" href="/design/${id}/tearsheet" target="_blank">Tear sheet PDF</a>
+ <a class="tile-btn" href="#" onclick="openTrade();return false">Email client</a>
+ <a class="tile-btn" href="#" onclick="openTrade();return false">Compare 2</a>
+ <a class="tile-btn" href="#" onclick="saveDesign(${id});return false">Save</a>
+ </div>
+ </div>
+ <div class="sub" style="background:var(--rate)">
+ <h4>Ratings & reviews</h4>
+ <div style="font-size:22px; letter-spacing:4px; color:#b89a4a">★★★★☆</div>
+ <div style="font-size:11.5px; color:var(--muted); margin-top:4px">Curated · 4.2 · ${escapeHtml(design.user_vote_count || 0)} votes</div>
+ </div>
+ </div>
+
+ <!-- SHARE TAB ──────────────────────────────────────────────── -->
+ <div class="tab-panel" data-tab="share" role="tabpanel">
+ <div class="sub" style="background:var(--share)">
+ <h4>Share this design</h4>
+ <div class="tile-btns">
+ <a class="tile-btn" href="#" onclick="openShare();return false">Pinterest</a>
+ <a class="tile-btn" href="#" onclick="openShare();return false">Instagram</a>
+ <a class="tile-btn" href="#" onclick="copyLink();return false">Copy link</a>
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+</main>
+
+<footer class="site">
+ <div class="h">wallco.ai — Curated-original wallpaper & murals</div>
+ <div>A Designer Wallcoverings company · Sherman Oaks, CA · steve@designerwallcoverings.com</div>
+</footer>
+`;
+
+ // ── tab switching ──
+ const tabBtns = root.querySelectorAll('.tab-btn');
+ const tabPanels = root.querySelectorAll('.tab-panel');
+ tabBtns.forEach(btn => btn.addEventListener('click', () => {
+ const name = btn.getAttribute('data-tab');
+ tabBtns.forEach(b => {
+ const a = b.getAttribute('data-tab') === name;
+ b.classList.toggle('active', a);
+ b.setAttribute('aria-selected', a ? 'true' : 'false');
+ });
+ tabPanels.forEach(p => p.classList.toggle('active', p.getAttribute('data-tab') === name));
+ }));
+
+ // ── calculator ──
+ const calcW = root.querySelector('#calc-input');
+ const calcH = root.querySelector('#calc-h');
+ const calcRW = root.querySelector('#calc-rw');
+ const total = root.querySelector('#calc-total');
+ function recalc() {
+ const ww = parseFloat(calcW.value) || 0;
+ const wh = parseFloat(calcH.value) || 0;
+ const rwInches = parseFloat(calcRW.value) || 24;
+ if (ww < 1 || wh < 1) { total.textContent = '— rolls · $—'; return; }
+ if (isMural) {
+ const panels = Math.ceil((ww * 12) / rwInches);
+ const cost = panels * 245;
+ total.innerHTML = '<b>' + panels + '</b> panels · <b>$' + cost.toLocaleString() + '</b>';
+ } else {
+ const widthPanels = Math.ceil((ww * 12) / rwInches);
+ const rollsPerPanel = Math.ceil(wh / 27);
+ const rolls = widthPanels * rollsPerPanel;
+ const cost = rolls * 165;
+ total.innerHTML = '<b>' + rolls + '</b> rolls · <b>$' + cost.toLocaleString() + '</b> · ' + widthPanels + ' panels wide';
+ }
+ }
+ [calcW, calcH, calcRW].forEach(el => el.addEventListener('input', recalc));
+ recalc();
+
+ // ── scale slider ──
+ const scale = root.querySelector('#scale-slider');
+ const repeat = root.querySelector('.atscale .repeat');
+ scale.addEventListener('input', () => {
+ const v = scale.value;
+ repeat.style.backgroundSize = v + 'px ' + v + 'px';
+ });
+
+ // ── adjust sliders ──
+ root.querySelectorAll('.adjust .sl').forEach(row => {
+ const r = row.querySelector('input[type=range]');
+ const v = row.querySelector('.v');
+ r.addEventListener('input', () => { v.textContent = r.value; });
+ });
+
+ // ── modal bodies ──
+ document.getElementById('m-share-body').innerHTML =
+ '<p>Share <b>' + escapeHtml(title) + '</b> on:</p>' +
+ '<div class="tile-btns" style="margin-top:8px"><a class="tile-btn" href="#">Pinterest</a><a class="tile-btn" href="#">Instagram</a><a class="tile-btn" href="#" onclick="copyLink();return false">Copy link</a></div>';
+ document.getElementById('m-furnish-body').innerHTML =
+ '<p>Generate AI furnishings curated to this pattern\'s palette.</p>' +
+ '<div class="tile-btns" style="margin-top:8px"><a class="tile-btn" href="#">Residential</a><a class="tile-btn" href="#">Commercial</a><a class="tile-btn" href="#">Hospitality</a><a class="tile-btn" href="#">Healthcare</a></div>';
+ document.getElementById('m-trade-body').innerHTML =
+ '<p>Trade-only tools (interior designers + specifiers).</p>' +
+ '<div class="tile-btns" style="margin-top:8px"><a class="tile-btn" href="/design/' + id + '/tearsheet" target="_blank">Tear sheet PDF</a><a class="tile-btn" href="#">Email to client</a><a class="tile-btn" href="#">Compare 2 patterns</a><a class="tile-btn" href="#">Add to saved</a></div>';
+})();
+
+function openShare() { document.getElementById('m-share').showModal(); }
+function openFurnish() { document.getElementById('m-furnish').showModal(); }
+function openTrade() { document.getElementById('m-trade').showModal(); }
+async function copyLink() {
+ try { await navigator.clipboard.writeText(location.href.replace(/\/tabs$/, '')); alert('Link copied'); }
+ catch { alert('Copy failed — ' + location.href); }
+}
+function addSample() { alert('Sample added (stub — wire to /api/cart/sample/' + (new URL(location).pathname.match(/\d+/) || [0])[0] + ')'); }
+function saveDesign(id) { alert('Saved design #' + id + ' (stub — wire to /api/saved)'); }
+
+function escapeHtml(v) {
+ if (v == null) return '';
+ return String(v).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
+}
+function escapeAttr(v) { return escapeHtml(v); }
+</script>
+</body>
+</html>
diff --git a/server.js b/server.js
index 5096310..90b7968 100644
--- a/server.js
+++ b/server.js
@@ -435,6 +435,15 @@ app.get('/design/:id/compact', (req, res) => {
res.sendFile(path.join(__dirname, 'public', 'theme-variants', 'v1-compact.html'));
});
+// ── /design/:id/tabs — theme V3 (Sticky Hero + Tabs). Pinned hero left,
+// tabbed pane right (Buy · Specs · Coords · Room · Trade · Share). Live
+// at https://wallco.ai/design/54099/tabs.
+app.get('/design/:id/tabs', (req, res) => {
+ const id = parseInt(req.params.id, 10);
+ if (!Number.isFinite(id) || id < 1) return res.status(404).type('html').send('<h1>404</h1>');
+ res.sendFile(path.join(__dirname, 'public', 'theme-variants', 'v3-tabs.html'));
+});
+
// ── Lightweight in-memory search across the catalog.
// /api/designs/search?q=<term>&limit=20
// Scores each design on motif (3), title (2), category/handle (1) substring match.
@@ -11294,6 +11303,9 @@ try {
<a class="hb-menu-item" data-hb-theme="bento" role="menuitem" href="/design/${design.id}/bento">
<span class="hb-menu-icon" aria-hidden="true">▦</span> V2 · Bento Grid
</a>
+ <a class="hb-menu-item" data-hb-theme="tabs" role="menuitem" href="/design/${design.id}/tabs">
+ <span class="hb-menu-icon" aria-hidden="true">▤</span> V3 · Sticky Hero + Tabs
+ </a>
</div>
${_isAdmin ? `
<button type="button" class="hb-menu-item" data-hb-action="edit" role="menuitem">
← 701c89a feat(pdp): V1 Two-Column Compact theme — /design/:id/compact
·
back to Wallco Ai
·
/designs: replace binary 'In a room' chip with a chip row — 441d381 →