← back to Marketing Command Center

public/panels/calendars.html

175 lines

<!-- All Calendars — unified multi-layer calendar with a left-panel field-filter
     rail. All markup + styles scoped under #cwroot so nothing bleeds into (or
     inherits from) the MCC shell, whose style.css also defines .grid/.card/.chip. -->
<div id="cwroot">
<style>
#cwroot{
  --ground:#FAF8F3;--surface:#fff;--ink:#1F1B17;--muted:#8A8178;--faint:#C2BBAE;
  --hairline:#E7E1D6;--plum:#5E2B3C;--brass:#B0894F;--green:#3E7C5A;--acc:#B0894F;
  --cb-brass:#F4ECDD;--cb-plum:#F3E7EC;--cb-green:#E8F0EA;
  --cwchip:56px;--cwfs:1;
  color:var(--ink);
}
#cwroot *{box-sizing:border-box}
/* ── top toolbar ── */
#cwroot .cw-top{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:10px}
#cwroot .cw-month{display:flex;align-items:center;gap:6px}
#cwroot .cw-nav{background:none;border:none;color:var(--muted);font-size:22px;line-height:1;padding:2px 8px;border-radius:8px;cursor:pointer}
#cwroot .cw-nav:hover{color:var(--ink);background:var(--ground)}
#cwroot .cw-ml{font:600 22px/1 "Cormorant Garamond",Georgia,serif;min-width:180px;letter-spacing:.2px}
#cwroot .cw-today,#cwroot .cw-btn{background:var(--surface);border:1px solid var(--hairline);color:var(--ink);font-size:13px;font-weight:500;padding:7px 14px;border-radius:999px;cursor:pointer}
#cwroot .cw-today:hover,#cwroot .cw-btn:hover{border-color:var(--brass)}
#cwroot .cw-spacer{flex:1}
#cwroot .cw-count{font-size:12px;color:var(--muted)}
#cwroot .cw-ctl{display:flex;align-items:center;gap:7px;font-size:11px;color:var(--muted)}
#cwroot input[type=range]{accent-color:var(--brass)}
#cwroot .cw-live{font-size:11px;color:var(--muted)}
/* ── legend ── */
#cwroot .cw-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11px;color:var(--muted);margin-bottom:12px}
#cwroot .cw-legend .li{display:flex;align-items:center;gap:6px;cursor:pointer;user-select:none}
#cwroot .cw-legend .li.off{opacity:.38;text-decoration:line-through}
#cwroot .cw-legend .sw{width:11px;height:11px;border-radius:3px;display:inline-block}
/* ── layout: aside + calendar ── */
#cwroot .cw-layout{display:flex;align-items:flex-start;gap:16px}
#cwroot .cw-aside{position:sticky;top:8px;width:222px;min-width:222px;max-height:calc(100vh - 140px);overflow:auto;
  padding:2px 8px 24px 0;border-right:1px solid var(--hairline)}
#cwroot .cw-aside input[type=text]{width:100%;margin-bottom:7px;font:inherit;font-size:12.5px;padding:6px 9px;
  border:1px solid var(--hairline);border-radius:8px;background:var(--surface);color:var(--ink)}
#cwroot .cw-aside details{border-bottom:1px solid var(--hairline)}
#cwroot .cw-aside summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:6px;padding:8px 4px;
  font-size:10.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.6px;user-select:none}
#cwroot .cw-aside summary::-webkit-details-marker{display:none}
#cwroot .cw-aside summary::before{content:'▸';font-size:9px;color:var(--muted);transition:transform .12s}
#cwroot .cw-aside details[open] summary::before{transform:rotate(90deg)}
#cwroot .cw-aside summary:hover{color:var(--ink)}
#cwroot .cw-aside summary .cur{margin-left:auto;color:var(--brass);text-transform:none;letter-spacing:0;font-weight:600;
  max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#cwroot .cw-fbody{padding:2px 0 8px}
#cwroot .cw-frow{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:3px 8px;border-radius:6px;
  cursor:pointer;color:var(--muted);font-size:12.5px;user-select:none}
#cwroot .cw-frow:hover{background:var(--ground);color:var(--ink)}
#cwroot .cw-frow.active{background:var(--ground);color:var(--ink);outline:1px solid var(--brass);outline-offset:-1px}
#cwroot .cw-frow .cw-fl{display:inline-flex;align-items:center;gap:7px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#cwroot .cw-frow .n{font-variant-numeric:tabular-nums;font-size:11px;color:var(--muted);flex:none}
#cwroot .cw-frow .dot{width:10px;height:10px;border-radius:3px;border:1px solid #0002;display:inline-block;flex:none}
#cwroot .cw-frow input[type=checkbox]{accent-color:var(--brass);margin:0 2px 0 0}
#cwroot .cw-fmore{padding:3px 8px;font-size:11px;color:var(--muted);font-style:italic}
#cwroot .cw-clear{display:none;margin-top:12px;width:100%}
#cwroot .cw-main{flex:1;min-width:0}
/* ── calendar grid ── */
#cwroot .cw-cal{border:1px solid var(--hairline);border-radius:14px;overflow:hidden;background:var(--surface)}
#cwroot .cw-dow-row{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--hairline)}
#cwroot .cw-dow{height:38px;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:1.5px}
#cwroot .cw-grid{display:grid;grid-template-columns:repeat(7,1fr)}
#cwroot .cw-cell{min-height:118px;border-right:1px solid var(--hairline);border-bottom:1px solid var(--hairline);padding:7px 8px;display:flex;flex-direction:column;gap:5px;overflow:hidden}
#cwroot .cw-cell:nth-child(7n){border-right:none}
#cwroot .cw-grid .cw-cell:nth-last-child(-n+7){border-bottom:none}
#cwroot .cw-cell.out{background:var(--ground)}
#cwroot .cw-cell.out .cw-dn{color:var(--faint)}
#cwroot .cw-dh{display:flex;align-items:center;justify-content:space-between}
#cwroot .cw-dn{font-size:13px;font-weight:500;color:var(--ink);width:26px;height:26px;display:flex;align-items:center;justify-content:center}
#cwroot .cw-cell.today .cw-dn{background:var(--plum);color:#fff;border-radius:50%}
#cwroot .cw-cnt{font-size:10px;font-weight:600;color:var(--brass)}
#cwroot .cw-cell.drop-target{outline:2px dashed var(--brass);outline-offset:-3px;background:var(--cb-brass)}
/* overlay bars (marketing / campaign / google) */
#cwroot .cw-bar{display:block;width:100%;text-align:left;border:none;border-radius:6px;padding:3px 7px;font-size:10.5px;
  line-height:1.3;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;color:inherit}
#cwroot .cw-bar.marketing{background:var(--cb-brass);color:#7A571C}
#cwroot .cw-bar.campaign{background:var(--cb-plum);color:#6E2A40;cursor:grab}
#cwroot .cw-bar.google{background:var(--cb-green);color:#2F5C43}
#cwroot .cw-bar:hover{filter:brightness(.97)}
/* activation image chips */
#cwroot .cw-chips{display:flex;flex-wrap:wrap;gap:5px;align-content:flex-start;max-height:calc(var(--cwchip)*3 + 12px);overflow:hidden}
#cwroot .cw-cell.expanded .cw-chips{max-height:none;overflow:visible}
#cwroot .cw-chip{position:relative;display:block;border-radius:6px;overflow:hidden;background:var(--ground);border:1px solid var(--hairline);
  width:var(--cwchip);height:var(--cwchip);flex:0 0 auto;padding:0;cursor:grab}
#cwroot .cw-chip:active{cursor:grabbing}
#cwroot .cw-chip.dragging{opacity:.4}
#cwroot .cw-chip:hover{border-color:var(--brass);box-shadow:0 0 0 1px var(--brass)}
#cwroot .cw-chip img{width:100%;height:100%;object-fit:cover;display:block}
#cwroot .cw-chip .cw-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:calc(9px*var(--cwfs));font-weight:700;color:#fff}
#cwroot .cw-chip .cw-vn{position:absolute;left:0;right:0;bottom:0;font-size:7px;line-height:1.15;background:rgba(31,27,23,.72);color:#f3ead7;padding:2px 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:.2px}
#cwroot .cw-chip .cw-fx{position:absolute;top:2px;left:2px;width:6px;height:6px;border-radius:50%}
#cwroot .cw-chip .cw-fx.s{background:var(--green)}#cwroot .cw-chip .cw-fx.r{background:var(--brass)}#cwroot .cw-chip .cw-fx.l{background:#3f5a73}
#cwroot .cw-chip.cw-chip-live{box-shadow:inset 0 0 0 2px #3f5a7355}
#cwroot .cw-chip.cw-chip-live:hover{border-color:#3f5a73;box-shadow:0 0 0 1px #3f5a73}
#cwroot.cw-noimg .cw-chip img{display:none}
#cwroot.cw-noimg .cw-chip{display:flex;align-items:center;justify-content:center}
#cwroot.cw-novend .cw-chip .cw-vn{display:none}
#cwroot .cw-more{margin-top:4px;align-self:stretch;font-size:10px;font-weight:600;letter-spacing:.4px;color:var(--muted);
  background:var(--ground);border:1px dashed var(--hairline);border-radius:6px;padding:3px 6px;cursor:pointer}
#cwroot .cw-more:hover{color:var(--ink);border-color:var(--faint)}
#cwroot .cw-empty{padding:50px;text-align:center;color:var(--muted)}
#cwroot .cw-loading{padding:50px;text-align:center;color:var(--muted)}
/* ── modal ── */
#cwroot .cw-modal-bd{position:fixed;inset:0;background:rgba(31,27,23,.30);backdrop-filter:blur(1px);z-index:60;display:flex;align-items:center;justify-content:center;padding:24px}
#cwroot .cw-modal{background:var(--surface);border:1px solid var(--hairline);border-radius:16px;box-shadow:0 24px 64px rgba(31,27,23,.22);
  width:420px;max-width:100%;max-height:88vh;overflow:auto;padding:20px 24px 24px}
#cwroot .cw-mhead{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:14px}
#cwroot .cw-mtitle{font:600 21px/1.15 "Cormorant Garamond",Georgia,serif;color:var(--ink)}
#cwroot .cw-mclose{width:30px;height:30px;border-radius:50%;background:var(--ground);color:var(--muted);font-size:16px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;border:none;flex:none}
#cwroot .cw-mclose:hover{background:var(--hairline);color:var(--ink)}
#cwroot .cw-hero{width:100%;height:170px;border-radius:10px;overflow:hidden;margin-bottom:14px;background:var(--ground)}
#cwroot .cw-hero img{width:100%;height:100%;object-fit:cover;display:block}
#cwroot .cw-hero .cw-ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:24px;font-weight:700;color:#fff}
#cwroot .cw-dl{display:grid;grid-template-columns:96px 1fr;gap:6px 12px;font-size:13px;margin-bottom:8px}
#cwroot .cw-dl dt{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.5px}
#cwroot .cw-dl dd{margin:0;color:var(--ink)}
#cwroot .cw-dl code{font-family:ui-monospace,Menlo,monospace;font-size:12px}
#cwroot .cw-tag{display:inline-block;font-size:11px;font-weight:700;border-radius:999px;padding:2px 10px;text-transform:capitalize}
#cwroot .cw-tag.activation{background:var(--cb-brass);color:#7A571C}
#cwroot .cw-tag.marketing{background:var(--cb-brass);color:#7A571C}
#cwroot .cw-tag.campaign{background:var(--cb-plum);color:#6E2A40}
#cwroot .cw-tag.google{background:var(--cb-green);color:#2F5C43}
#cwroot .cw-tag.launched{background:#e2e8ef;color:#3f5a73}
#cwroot .cw-resched{display:flex;align-items:center;gap:8px;margin:12px 0;padding-top:12px;border-top:1px solid var(--hairline)}
#cwroot .cw-resched input[type=date]{font:inherit;font-size:13px;border:1px solid var(--hairline);border-radius:8px;padding:8px 10px;background:var(--surface);color:var(--ink)}
#cwroot .cw-cta{background:var(--plum);color:#fff;border:none;font-weight:600;font-size:13px;padding:9px 16px;border-radius:8px;cursor:pointer}
#cwroot .cw-cta:hover{background:#4d2230}
#cwroot .cw-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
#cwroot .cw-links a{text-decoration:none;color:var(--plum);border:1px solid var(--hairline);border-radius:8px;padding:6px 11px;font-size:12px}
#cwroot .cw-links a:hover{background:var(--ground)}
#cwroot .cw-note{font-size:12.5px;color:var(--muted);line-height:1.5}
@media(max-width:860px){
  #cwroot .cw-layout{display:block}
  #cwroot .cw-aside{width:auto;min-width:0;max-height:none;border-right:none;border-bottom:1px solid var(--hairline);margin-bottom:12px;position:static}
}
</style>

<div class="cw-top">
  <div class="cw-month">
    <button class="cw-nav" id="cwPrev" aria-label="Previous month">‹</button>
    <span class="cw-ml" id="cwML">…</span>
    <button class="cw-nav" id="cwNext" aria-label="Next month">›</button>
    <button class="cw-today" id="cwToday">Today</button>
  </div>
  <span class="cw-spacer"></span>
  <span class="cw-count" id="cwCount"></span>
  <div class="cw-ctl"><label>Density</label><input type="range" id="cwDensity" min="3" max="10" step="1"></div>
  <button class="cw-btn" id="cwRefresh" title="Re-project the activation schedule from live dw_unified">↻ Refresh</button>
</div>
<div class="cw-legend" id="cwLegend"></div>

<div class="cw-layout">
  <aside class="cw-aside" id="cwAside" aria-label="filters">
    <input type="text" id="cwQ" placeholder="Search title / sku / vendor / color…">
    <input type="text" id="cwPat" list="cwPatList" placeholder="Vendor type-ahead…">
    <datalist id="cwPatList"></datalist>
    <details id="cwFieldsBox"><summary>Chip display</summary>
      <div class="cw-fbody">
        <label class="cw-frow"><span class="cw-fl"><input type="checkbox" data-fv="img" checked>Images</span></label>
        <label class="cw-frow"><span class="cw-fl"><input type="checkbox" data-fv="vend" checked>Vendor label</span></label>
      </div>
    </details>
    <div id="cwFacets"></div>
    <button class="cw-btn cw-clear" id="cwClear">✕ Clear filters</button>
  </aside>
  <main class="cw-main">
    <div class="cw-cal" id="cwCal"><div class="cw-loading">Loading calendars…</div></div>
    <div class="cw-empty" id="cwEmpty" style="display:none">No items match these filters.</div>
  </main>
</div>

<div class="cw-modal-bd" id="cwModalBd" style="display:none"><div class="cw-modal" id="cwModal"></div></div>
</div>