[object Object]

← back to Wallco Ai

feat(pdp): V2 Bento Grid theme — /design/:id/bento + /api/design/:id

c00013059fbeb8e1a25640c14d9b6cbbb4e05212 · 2026-05-28 17:17:53 -0700 · Steve Abrams

Standalone client-side template fetches single-design JSON; 4-col bento with hero 2x2,
all PDP info preserved as labeled cells (calc, palette, specs, room, pairs, paints,
stripes, at-scale, adjust, share, furnish, trade, ratings) + 4 collapsed accordions.
Keeps server.js template literal untouched per backtick-gotcha rule.

Files touched

Diff

commit c00013059fbeb8e1a25640c14d9b6cbbb4e05212
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu May 28 17:17:53 2026 -0700

    feat(pdp): V2 Bento Grid theme — /design/:id/bento + /api/design/:id
    
    Standalone client-side template fetches single-design JSON; 4-col bento with hero 2x2,
    all PDP info preserved as labeled cells (calc, palette, specs, room, pairs, paints,
    stripes, at-scale, adjust, share, furnish, trade, ratings) + 4 collapsed accordions.
    Keeps server.js template literal untouched per backtick-gotcha rule.
---
 public/theme-variants/v2-bento.html | 652 ++++++++++++++++++++++++++++++++++++
 1 file changed, 652 insertions(+)

diff --git a/public/theme-variants/v2-bento.html b/public/theme-variants/v2-bento.html
new file mode 100644
index 0000000..540085c
--- /dev/null
+++ b/public/theme-variants/v2-bento.html
@@ -0,0 +1,652 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>wallco.ai — Bento 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;
+    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
+    --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
+    --gap: 16px;
+    --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 / prev-next strip ───────────────────────────────────── */
+  .crumb {
+    max-width: 1640px; margin: 0 auto; padding: 16px 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); }
+
+  /* ── bento grid ─────────────────────────────────────────────────────── */
+  main.bento {
+    max-width: 1640px; margin: 0 auto; padding: 20px 28px 80px;
+    display: grid;
+    grid-template-columns: repeat(4, 1fr);
+    grid-auto-rows: minmax(200px, auto);
+    gap: var(--gap);
+  }
+  .cell {
+    background: var(--panel);
+    border-radius: var(--r);
+    padding: 16px;
+    display: flex; flex-direction: column; min-width: 0;
+    border: 1px solid var(--line);
+    overflow: hidden;
+  }
+  .cell h3 {
+    margin: 0 0 8px;
+    font: 600 11px/1.2 var(--sans);
+    text-transform: uppercase;
+    letter-spacing: .08em;
+    color: var(--muted);
+  }
+  .cell .body { flex: 1; min-height: 0; }
+
+  /* ── bento cell sizes ───────────────────────────────────────────────── */
+  .c-hero       { grid-column: span 2; grid-row: span 2; background: var(--hero-bg); padding: 0; position: relative; }
+  .c-title      { grid-column: span 2; }
+  .c-cta-row    { grid-column: span 2; padding: 0; background: transparent; border: 0; flex-direction: row; gap: var(--gap); }
+  .c-calc       { background: var(--calc); }
+  .c-palette    { }
+  .c-specs      { grid-row: span 2; }
+  .c-room       { background: var(--room); }
+  .c-pairs      { background: var(--coord); }
+  .c-paints     { background: var(--coord); }
+  .c-stripes    { background: var(--coord); }
+  .c-atscale    { grid-column: span 2; background: var(--hero-bg); padding: 0; position: relative; min-height: 320px; }
+  .c-share      { background: var(--share); }
+  .c-furnish    { background: var(--share); }
+  .c-trade      { background: var(--trade); }
+  .c-rate       { background: var(--rate); }
+  .c-adjust     { }
+  .c-coords-mini{ grid-column: span 2; background: var(--coord); }
+
+  /* ── hero image ─────────────────────────────────────────────────────── */
+  .c-hero .hero-img {
+    position: absolute; inset: 0;
+    background-position: center; background-size: cover;
+    background-repeat: no-repeat;
+    background-color: var(--hero-bg);
+    border-radius: var(--r);
+  }
+  .c-hero .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;
+  }
+  .c-hero .hero-pill {
+    position: absolute; right: 14px; top: 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;
+  }
+
+  /* ── title cell ─────────────────────────────────────────────────────── */
+  .c-title { background: var(--bg); border-color: var(--line); }
+  .c-title .name { font: 500 28px/1.15 var(--serif); margin: 4px 0 6px; }
+  .c-title .meta { color: var(--muted); font-size: 12.5px; }
+  .c-title .meta .sep { padding: 0 6px; opacity: .5; }
+  .c-title .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; }
+
+  /* ── CTAs ───────────────────────────────────────────────────────────── */
+  .cta {
+    flex: 1; display: flex; align-items: center; justify-content: center;
+    border-radius: var(--r); padding: 0 18px;
+    font: 700 12.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase;
+    height: 64px;
+    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 cell ──────────────────────────────────────────────────────── */
+  .c-calc h3 { color: #5a4f73; }
+  .c-calc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
+  .c-calc label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 2px; }
+  .c-calc input { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; }
+  .c-calc .total { margin-top: 6px; padding: 10px; background: rgba(255,255,255,.6); border-radius: 8px; font-size: 12.5px; }
+  .c-calc .total b { font-size: 16px; font-family: var(--serif); font-weight: 500; }
+
+  /* ── palette cell ───────────────────────────────────────────────────── */
+  .c-palette .swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
+  .c-palette .sw { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); position: relative; cursor: pointer; }
+  .c-palette .sw:hover .lbl { display: block; }
+  .c-palette .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; }
+  .c-palette .dom { font-size: 11px; color: var(--muted); margin-top: 8px; }
+
+  /* ── adjust cell ────────────────────────────────────────────────────── */
+  .c-adjust .sl { display: grid; grid-template-columns: 70px 1fr 36px; align-items: center; gap: 6px; font-size: 11px; }
+  .c-adjust .sl input[type=range] { accent-color: var(--accent); width: 100%; }
+  .c-adjust .sl .v { font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
+
+  /* ── specs table ────────────────────────────────────────────────────── */
+  .c-specs .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
+  .c-specs .row:last-child { border-bottom: 0; }
+  .c-specs .row .k { color: var(--muted); }
+  .c-specs .row .v { font-weight: 600; text-align: right; }
+
+  /* ── room cell ──────────────────────────────────────────────────────── */
+  .c-room { background: var(--room); }
+  .c-room .body { background-position: center; background-size: cover; background-repeat: no-repeat; border-radius: 8px; min-height: 160px; background-color: rgba(255,255,255,.4); }
+  .c-room .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 12px; font-style: italic; }
+
+  /* ── pairs / coords ─────────────────────────────────────────────────── */
+  .pair-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
+  .pair-grid .pair { aspect-ratio: 1/1; background: rgba(255,255,255,.5); border-radius: 6px; background-size: cover; background-position: center; }
+
+  /* ── paints / stripes lists ─────────────────────────────────────────── */
+  .pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
+  .pill { font-size: 11px; padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.06); }
+
+  /* ── at-scale wallpaper interrupt ───────────────────────────────────── */
+  .c-atscale { overflow: hidden; }
+  .c-atscale .repeat {
+    position: absolute; inset: 0;
+    background-repeat: repeat;
+    background-size: 200px 200px;
+  }
+  .c-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;
+  }
+  .c-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;
+  }
+  .c-atscale .slider input[type=range] { width: 140px; accent-color: var(--accent); }
+
+  /* ── share/furnish/trade quick tiles ────────────────────────────────── */
+  .tile-btns { display: flex; flex-wrap: wrap; gap: 6px; }
+  .tile-btn {
+    flex: 1; min-width: 76px;
+    background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.06);
+    padding: 8px 6px; border-radius: 8px;
+    font: 600 11px/1.2 var(--sans); color: var(--ink); text-align: center;
+    text-decoration: none;
+  }
+  .tile-btn:hover { background: #fff; }
+
+  /* ── ratings ────────────────────────────────────────────────────────── */
+  .c-rate .stars { font-size: 22px; letter-spacing: 4px; color: #b89a4a; }
+  .c-rate .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
+
+  /* ── footer collapsibles ────────────────────────────────────────────── */
+  .footer-acc {
+    max-width: 1640px; margin: 0 auto; padding: 0 28px 40px;
+    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
+  }
+  details.acc {
+    background: #fff; border: 1px solid var(--line); border-radius: 8px;
+    padding: 10px 14px; font-size: 12.5px;
+  }
+  details.acc summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
+  details.acc summary::after { content: '▾'; color: var(--muted); transition: transform .2s; }
+  details.acc[open] summary::after { transform: rotate(180deg); }
+  details.acc .acc-body { margin-top: 10px; color: var(--muted); line-height: 1.6; font-size: 12px; }
+  details.acc pre { white-space: pre-wrap; word-break: break-word; font: 11px/1.5 ui-monospace, Menlo, monospace; background: var(--panel); padding: 10px; border-radius: 6px; max-height: 180px; overflow: auto; }
+
+  /* ── site footer ────────────────────────────────────────────────────── */
+  footer.site {
+    border-top: 1px solid var(--line);
+    padding: 28px; text-align: center; color: var(--muted); font-size: 12px;
+    background: var(--panel);
+  }
+  footer.site .h { font: 500 14px/1.4 var(--serif); color: var(--ink); margin-bottom: 4px; }
+
+  /* ── modal (used for share / trade / furnish drawer-style) ──────────── */
+  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; }
+
+  /* ── loading state ──────────────────────────────────────────────────── */
+  .loading-shell { display: flex; align-items: center; justify-content: center; height: 60vh; color: var(--muted); font-style: italic; font-size: 14px; }
+
+  /* ── responsive ────────────────────────────────────────────────────── */
+  @media (max-width: 1100px) {
+    main.bento { grid-template-columns: repeat(2, 1fr); }
+    .c-hero, .c-title, .c-cta-row, .c-atscale, .c-coords-mini { grid-column: span 2; }
+    .c-specs { grid-row: auto; }
+  }
+  @media (max-width: 640px) {
+    main.bento { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
+    .c-hero, .c-title, .c-cta-row, .c-atscale, .c-coords-mini, .c-specs, .c-pairs, .c-paints, .c-stripes, .c-share, .c-furnish, .c-trade, .c-rate, .c-room, .c-calc, .c-palette, .c-adjust { grid-column: span 1; grid-row: auto; }
+    .c-cta-row { flex-direction: column; }
+    .cta { width: 100%; }
+    header.topbar { flex-wrap: wrap; padding: 10px 14px; }
+    .crumb { padding: 12px 14px 0; }
+    .footer-acc { grid-template-columns: 1fr; padding: 0 14px 24px; }
+  }
+</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: Bento (V2) <a id="back-to-classic" href="#">← Classic view</a></span>
+</header>
+
+<div id="root" class="loading-shell">Loading design…</div>
+
+<!-- modals -->
+<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 () {
+  // Extract id from /design/:id/bento URL or ?id= query
+  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;
+
+  // Fetch design
+  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;
+  }
+
+  // ── derive display fields ──
+  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;
+
+  // ── render ──
+  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=bento">← prev</a>
+    <a href="/design/${id + 2}?theme=bento">next →</a>
+  </span>
+</div>
+
+<main class="bento">
+
+  <!-- HERO 2×2 -->
+  <div class="cell c-hero">
+    <div class="hero-img" style="background-image:url('${img}')"></div>
+    <span class="hero-pill">LIVE</span>
+    <span class="hero-info">${escapeHtml(title)}</span>
+  </div>
+
+  <!-- TITLE -->
+  <div class="cell c-title">
+    <h3>Pattern</h3>
+    <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>
+      <span class="chip">By ${escapeHtml(generator)}</span>
+      ${design.is_published ? '<span class="chip" style="background:#d6eedb;color:#1a5a30">Live</span>' : '<span class="chip" style="background:#f1e7c5;color:#7a5520">Curating</span>'}
+    </div>
+  </div>
+
+  <!-- CTAs -->
+  <div class="cell c-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>
+
+  <!-- CALCULATOR -->
+  <div class="cell c-calc">
+    <h3>Calculator</h3>
+    <div class="row">
+      <div><label>Wall width (ft)</label><input id="calc-input" type="number" min="1" max="80" step="0.5" value="10"></div>
+      <div><label>Wall height (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>
+
+  <!-- PALETTE -->
+  <div class="cell c-palette">
+    <h3>Palette · drag to recolor</h3>
+    <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>
+
+  <!-- SPECS (tall, span 2 rows) -->
+  <div class="cell c-specs">
+    <h3>Specs</h3>
+    <div class="body">
+      <div class="row"><span class="k">Category</span><span class="v">${escapeHtml(catDisplay)}</span></div>
+      <div class="row"><span class="k">Kind</span><span class="v">${escapeHtml(kindLabel)}</span></div>
+      <div class="row"><span class="k">Width</span><span class="v">${w}"</span></div>
+      <div class="row"><span class="k">Repeat</span><span class="v">${repeatLabel}</span></div>
+      <div class="row"><span class="k">Sold by</span><span class="v">${rollOrPanel}</span></div>
+      <div class="row"><span class="k">${isMural ? 'Panel size' : 'Roll length'}</span><span class="v">${isMural ? (w + '" × 11 ft') : '27 ft'}</span></div>
+      <div class="row"><span class="k">Material</span><span class="v">Type II vinyl</span></div>
+      <div class="row"><span class="k">Designed by</span><span class="v">${escapeHtml(generator)}</span></div>
+      <div class="row"><span class="k">Pattern No.</span><span class="v">${id}</span></div>
+      <div class="row"><span class="k">Handle</span><span class="v">${escapeHtml(handle)}</span></div>
+      <div class="row"><span class="k">Dominant hex</span><span class="v">${escapeHtml(dominant)}</span></div>
+      <div class="row"><span class="k">Status</span><span class="v">${design.is_published ? 'Live' : 'Curating'}</span></div>
+    </div>
+  </div>
+
+  <!-- ROOM -->
+  <div class="cell c-room">
+    <h3>See in a room</h3>
+    <div class="body" style="${roomImgUrl ? `background-image:url('${roomImgUrl}')` : ''}">
+      ${roomImgUrl ? '' : '<div class="placeholder">Room mockup not yet generated</div>'}
+    </div>
+  </div>
+
+  <!-- PAIRS WELL WITH -->
+  <div class="cell c-pairs">
+    <h3>Pairs well with</h3>
+    <div class="pair-grid" id="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>
+
+  <!-- COORD PAINTS -->
+  <div class="cell c-paints">
+    <h3>Coordinate paints</h3>
+    <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 &amp; Ball</a>
+      <a class="pill" href="#">Behr</a>
+      <a class="pill" href="#">PPG</a>
+      <a class="pill" href="#">RAL</a>
+    </div>
+  </div>
+
+  <!-- COORD STRIPES (mini grid spans 2) -->
+  <div class="cell c-coords-mini">
+    <h3>Coordinate stripes &amp; plaids · 24 generated</h3>
+    <div class="pair-grid" style="grid-template-columns:repeat(6,1fr); gap:6px;" id="stripe-grid">
+      ${Array.from({length: 12}).map(() => '<div class="pair"></div>').join('')}
+    </div>
+  </div>
+
+  <!-- AT SCALE (full bleed) -->
+  <div class="cell c-atscale">
+    <div class="repeat" style="background-image:url('${img}')"></div>
+    <span class="label">At-scale preview · 10 × 9 ft wall</span>
+    <span class="slider">scale <input type="range" min="80" max="320" value="200" id="scale-slider"></span>
+  </div>
+
+  <!-- ADJUST -->
+  <div class="cell c-adjust">
+    <h3>Image adjustments</h3>
+    <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>
+
+  <!-- SHARE / FURNISH / TRADE — fanned tiles -->
+  <div class="cell c-share">
+    <h3>Share</h3>
+    <div class="tile-btns">
+      <a class="tile-btn" href="#" onclick="openShare();return false">Pin</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 class="cell c-furnish">
+    <h3>Furnish</h3>
+    <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 class="cell c-trade">
+    <h3>Trade tools</h3>
+    <div class="tile-btns">
+      <a class="tile-btn" href="/design/${id}/tearsheet" target="_blank">Tear sheet</a>
+      <a class="tile-btn" href="#" onclick="openTrade();return false">Email client</a>
+      <a class="tile-btn" href="#" onclick="openTrade();return false">Compare</a>
+      <a class="tile-btn" href="#" onclick="saveDesign(${id});return false">Save</a>
+    </div>
+  </div>
+  <div class="cell c-rate">
+    <h3>Ratings</h3>
+    <div class="stars">★★★★☆</div>
+    <div class="meta">Curated · 4.2 · ${escapeHtml(design.user_vote_count || 0)} votes</div>
+  </div>
+
+</main>
+
+<!-- collapsed accordions for the rest -->
+<div class="footer-acc">
+  <details class="acc"><summary>Generator + prompt</summary><div class="acc-body">
+    <div>Generator: <b>${escapeHtml(generator)}</b> · seed <code>${escapeHtml(design.seed || '—')}</code></div>
+    <pre>${escapeHtml((design.prompt || '').slice(0, 1200))}${(design.prompt && design.prompt.length > 1200) ? '\n…[truncated]' : ''}</pre>
+  </div></details>
+  <details class="acc"><summary>Internal notes</summary><div class="acc-body">
+    <pre>${escapeHtml(design.notes || '(none)')}</pre>
+  </div></details>
+  <details class="acc"><summary>Tags</summary><div class="acc-body">
+    ${(Array.isArray(design.tags) ? design.tags : []).map(t => `<span class="pill">${escapeHtml(t)}</span>`).join(' ') || '<span class="muted">none</span>'}
+  </div></details>
+  <details class="acc"><summary>Motifs</summary><div class="acc-body">
+    ${(Array.isArray(design.motifs) ? design.motifs : []).map(m => `<span class="pill">${escapeHtml(m)}</span>`).join(' ') || '<span class="muted">none</span>'}
+  </div></details>
+</div>
+
+<footer class="site">
+  <div class="h">wallco.ai — Curated-original wallpaper &amp; murals</div>
+  <div>A Designer Wallcoverings company · Sherman Oaks, CA · steve@designerwallcoverings.com</div>
+</footer>
+`;
+
+  // ── wire up interactive bits ──
+  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) {
+      // Murals: panels by width × height
+      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);
+      // 27 ft roll = covers ~27 ft of wall height when in single-panel mode; we need wh per panel
+      const lengthPerPanel = wh;
+      const rollsPerPanel = Math.ceil(lengthPerPanel / 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();
+
+  // at-scale slider
+  const scale = root.querySelector('#scale-slider');
+  const repeat = root.querySelector('.c-atscale .repeat');
+  scale.addEventListener('input', () => {
+    const v = scale.value;
+    repeat.style.backgroundSize = v + 'px ' + v + 'px';
+  });
+
+  // adjust sliders mirror their value to .v
+  root.querySelectorAll('.c-adjust .sl').forEach(row => {
+    const r = row.querySelector('input[type=range]');
+    const v = row.querySelector('.v');
+    r.addEventListener('input', () => { v.textContent = r.value; });
+  });
+
+  // populate 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>';
+})();
+
+// ── shared helpers / window-scope handlers ────────────────────────────────
+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(/\/bento$/, '')); 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 => ({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
+}
+function escapeAttr(v) { return escapeHtml(v); }
+</script>
+</body>
+</html>

← 2229fb4 tests: 19 unit tests for shopify-bundle-webhook (HMAC verify  ·  back to Wallco Ai  ·  scripts: stamp-shopify-bundle-metafields.js — repeatable sta 2973b9e →