Kvadrat Nordic Textile
Danish architectural textile house pairing tactile woven-wool swatches, warm raw linen surfaces, and disciplined Nordic grids.
Inspired by Kvadrat ↗
WHY THIS AESTHETIC IS UNIQUE
Translates physical upholstery weaves, yarn composition specs, and Martindale abrasion ratings into an ultra-calm Copenhagen showroom interface with live warp-and-weft swatch previews.
BEST FOR
TAGS
COLOR PALETTE (CLICK TO COPY HEX)
TYPOGRAPHY
- Display
- Newsreader, Georgia, serif
- Body
- Outfit, -apple-system, sans-serif
- Mono
- IBM Plex Mono, ui-monospace, monospace
- Scale
- Editorial Newsreader serif titles (34–54px) paired with clean 15px Outfit material descriptions and 11px monospace Martindale/composition specs.
ARCHITECTURE & MOBILE NOTES
LAYOUT
Showroom split-stage featuring a macro SVG warp-and-weft weave magnifier beside a color-way swatch matrix, followed by a hairline-divided textile specification table.
INTERACTION
Clicking any wool color-way swatch live-recolors the macro SVG weave texture, updates colorway code, Martindale abrasion score, and acoustic absorption rating, and allows adding swatches to a sample box.
MOBILE
Macro weave stage and swatch grid stack cleanly at 390px with >=44px color-way tiles and a compact sticky sample-box tray.
AI AGENT GUARDRAILS
DO
- Use fine CSS/SVG woven textures and warm flax tones (#F5F2EB) to communicate real textile materiality.
- Display authentic technical textile metadata (Martindale rubs, wool/viscose %, acoustic class).
- Keep layout alignment disciplined with calm 1px hairline dividers.
DON'T
- Do not use glossy neon gradients or heavy floating drop shadows.
- Do not crowd the swatch showroom with loud e-commerce countdown timers.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Kvadrat — Architectural Textile Showroom</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Outfit:wght@400;500;600&display=swap" rel="stylesheet">
<style>
:root {
--canvas: #F5F2EB;
--surface: #EAE4D8;
--ink: #1B1A18;
--accent: #B55239;
--muted: #736D63;
--rule: rgba(27, 26, 24, 0.14);
--warp: #B55239;
--weft: #8E3D28;
--thread-hi: #D87A61;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: var(--canvas);
color: var(--ink);
font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
}
.topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 24px;
border-bottom: 1px solid var(--rule);
position: sticky;
top: 0;
background: rgba(245, 242, 235, 0.94);
backdrop-filter: blur(8px);
z-index: 30;
}
.brand {
display: flex;
align-items: baseline;
gap: 12px;
text-decoration: none;
color: var(--ink);
}
.brand-word {
font-family: 'Outfit', sans-serif;
font-weight: 600;
letter-spacing: 0.16em;
text-transform: uppercase;
font-size: 14px;
}
.brand-sub {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
color: var(--muted);
}
.nav-links {
display: flex;
gap: 24px;
align-items: center;
}
.nav-links a {
text-decoration: none;
color: var(--muted);
font-size: 13px;
font-weight: 500;
letter-spacing: 0.04em;
transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.box-btn {
min-height: 44px;
padding: 0 16px;
border: 1px solid var(--ink);
background: transparent;
color: var(--ink);
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
letter-spacing: 0.08em;
text-transform: uppercase;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 8px;
transition: background 0.2s, color 0.2s;
}
.box-btn:hover { background: var(--ink); color: var(--canvas); }
.mobile-menu-btn {
display: none;
min-width: 44px;
min-height: 44px;
border: 1px solid var(--rule);
background: transparent;
color: var(--ink);
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
cursor: pointer;
}
.mobile-drawer {
display: none;
flex-direction: column;
border-bottom: 1px solid var(--rule);
background: var(--surface);
padding: 12px 20px;
gap: 4px;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer a {
min-height: 44px;
display: flex;
align-items: center;
text-decoration: none;
color: var(--ink);
font-size: 14px;
border-bottom: 1px solid var(--rule);
}
.mobile-drawer a:last-child { border-bottom: none; }
.container {
max-width: 1240px;
margin: 0 auto;
padding: 36px 24px 64px;
}
.intro-row {
display: grid;
grid-template-columns: 1.4fr 1fr;
gap: 32px;
padding-bottom: 32px;
border-bottom: 1px solid var(--rule);
align-items: end;
}
.eyebrow {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
letter-spacing: 0.14em;
text-transform: uppercase;
color: var(--muted);
margin: 0 0 12px;
}
h1 {
font-family: 'Newsreader', Georgia, serif;
font-weight: 400;
font-size: clamp(2.1rem, 4.4vw, 3.6rem);
line-height: 1.06;
letter-spacing: -0.02em;
margin: 0;
}
h1 em { font-style: italic; color: var(--accent); }
.intro-copy {
font-size: 15px;
line-height: 1.65;
color: var(--muted);
margin: 0;
}
.showroom-grid {
display: grid;
grid-template-columns: 1.15fr 0.85fr;
gap: 36px;
padding: 36px 0;
border-bottom: 1px solid var(--rule);
}
.weave-stage {
background: var(--surface);
border: 1px solid var(--rule);
padding: 20px;
display: flex;
flex-direction: column;
gap: 16px;
}
.stage-head {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 10px;
}
.stage-code {
font-family: 'IBM Plex Mono', monospace;
font-size: 12px;
letter-spacing: 0.08em;
}
.zoom-group {
display: flex;
gap: 6px;
}
.zoom-btn {
min-height: 44px;
min-width: 44px;
padding: 0 12px;
border: 1px solid var(--rule);
background: var(--canvas);
color: var(--ink);
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
cursor: pointer;
}
.zoom-btn.active {
background: var(--ink);
color: var(--canvas);
border-color: var(--ink);
}
.weave-frame {
width: 100%;
aspect-ratio: 16 / 10;
border: 1px solid rgba(27, 26, 24, 0.2);
overflow: hidden;
position: relative;
background: var(--warp);
}
.weave-frame svg {
width: 100%;
height: 100%;
display: block;
transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.weave-caption {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
gap: 8px;
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
color: var(--muted);
}
.swatch-panel {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 24px;
}
.swatch-title {
font-family: 'Newsreader', serif;
font-size: 28px;
font-weight: 400;
margin: 0 0 6px;
}
.swatch-designer {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
color: var(--muted);
letter-spacing: 0.06em;
text-transform: uppercase;
margin: 0 0 18px;
}
.swatch-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.swatch-tile {
min-height: 64px;
border: 1px solid var(--rule);
padding: 8px;
background: var(--canvas);
cursor: pointer;
display: flex;
flex-direction: column;
justify-content: space-between;
text-align: left;
transition: transform 0.18s, border-color 0.18s;
}
.swatch-tile:hover { transform: translateY(-2px); }
.swatch-tile.active {
border-color: var(--ink);
box-shadow: inset 0 0 0 1px var(--ink);
}
.swatch-chip {
width: 100%;
height: 28px;
border: 1px solid rgba(0, 0, 0, 0.12);
}
.swatch-num {
font-family: 'IBM Plex Mono', monospace;
font-size: 10px;
color: var(--ink);
margin-top: 6px;
}
.spec-list {
border-top: 1px solid var(--rule);
margin: 0;
padding: 0;
list-style: none;
}
.spec-list li {
display: flex;
justify-content: space-between;
gap: 12px;
padding: 11px 0;
border-bottom: 1px solid var(--rule);
font-size: 13px;
}
.spec-k {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
text-transform: uppercase;
color: var(--muted);
}
.spec-v { font-weight: 500; text-align: right; }
.action-row {
display: flex;
gap: 12px;
flex-wrap: wrap;
}
.primary-btn {
flex: 1;
min-height: 46px;
border: 1px solid var(--ink);
background: var(--ink);
color: var(--canvas);
font-family: 'Outfit', sans-serif;
font-size: 13px;
font-weight: 500;
letter-spacing: 0.06em;
text-transform: uppercase;
cursor: pointer;
padding: 0 18px;
}
.primary-btn:hover { background: var(--accent); border-color: var(--accent); }
.collection-section {
padding-top: 40px;
}
.section-head {
display: flex;
justify-content: space-between;
align-items: baseline;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 20px;
}
.section-head h2 {
font-family: 'Newsreader', serif;
font-weight: 400;
font-size: 26px;
margin: 0;
}
.filter-row {
display: flex;
gap: 8px;
flex-wrap: wrap;
}
.filter-pill {
min-height: 44px;
padding: 0 14px;
border: 1px solid var(--rule);
background: transparent;
color: var(--ink);
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
text-transform: uppercase;
cursor: pointer;
}
.filter-pill.active {
background: var(--ink);
color: var(--canvas);
border-color: var(--ink);
}
.material-cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 20px;
}
.mat-card {
border: 1px solid var(--rule);
background: var(--canvas);
padding: 18px;
display: flex;
flex-direction: column;
gap: 12px;
}
.mat-swatch-bar {
height: 10px;
width: 100%;
}
.mat-card h3 {
font-family: 'Newsreader', serif;
font-size: 21px;
font-weight: 400;
margin: 0;
}
.mat-meta {
font-family: 'IBM Plex Mono', monospace;
font-size: 11px;
color: var(--muted);
}
.mat-desc {
font-size: 13.5px;
line-height: 1.55;
color: var(--muted);
margin: 0;
}
.sample-drawer {
position: fixed;
inset: 0;
background: rgba(27, 26, 24, 0.42);
display: none;
justify-content: flex-end;
z-index: 60;
}
.sample-drawer.open { display: flex; }
.drawer-sheet {
width: min(380px, 100%);
background: var(--canvas);
height: 100%;
padding: 24px;
display: flex;
flex-direction: column;
gap: 16px;
border-left: 1px solid var(--rule);
overflow-y: auto;
}
.drawer-head {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--rule);
padding-bottom: 14px;
}
.drawer-head h3 {
font-family: 'Newsreader', serif;
font-weight: 400;
margin: 0;
font-size: 22px;
}
.sample-item {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 10px 0;
border-bottom: 1px solid var(--rule);
}
.sample-left {
display: flex;
align-items: center;
gap: 10px;
}
.sample-dot {
width: 24px;
height: 24px;
border: 1px solid rgba(0, 0, 0, 0.16);
flex-shrink: 0;
}
@media (max-width: 900px) {
.intro-row, .showroom-grid { grid-template-columns: 1fr; }
.material-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
.topbar { padding: 12px 16px; }
.nav-links { display: none; }
.mobile-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
.container { padding: 24px 16px 48px; }
.swatch-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.material-cards { grid-template-columns: 1fr; }
.brand-sub { display: none; }
}
</style>
</head>
<body>
<header class="topbar">
<a class="brand" href="#top">
<span class="brand-word">Kvadrat</span>
<span class="brand-sub">EBELTOFT · EST. 1968</span>
</a>
<nav class="nav-links" aria-label="Primary">
<a href="#showroom" class="active">Upholstery</a>
<a href="#library">Material Library</a>
<a href="#showroom">Acoustics</a>
<a href="#library">Sustainability</a>
</nav>
<div style="display:flex;gap:8px;align-items:center;">
<button class="box-btn" id="openBoxBtn" type="button">Sample Box (<span id="boxCount">1</span>)</button>
<button class="mobile-menu-btn" id="menuBtn" type="button" aria-label="Toggle Menu">MENU</button>
</div>
</header>
<nav class="mobile-drawer" id="mobileDrawer" aria-label="Mobile navigation">
<a href="#showroom">Upholstery Showroom</a>
<a href="#library">Architectural Library</a>
<a href="#showroom">Acoustic Textiles</a>
<a href="#library">Wool Provenance</a>
</nav>
<main class="container" id="top">
<section class="intro-row">
<div>
<p class="eyebrow">Copenhagen Textile Archive · Series 04</p>
<h1>Architectural wool woven for <em>quiet longevity</em>.</h1>
</div>
<p class="intro-copy">
Inspect warp-and-weft structure at macro scale, compare Martindale abrasion durability, and curate physical fabric cuttings for architectural specification.
</p>
</section>
<section class="showroom-grid" id="showroom">
<div class="weave-stage">
<div class="stage-head">
<span class="stage-code" id="activeCode">HALLINGDAL 65 · COL. 0674 TERRACOTTA</span>
<div class="zoom-group" role="group" aria-label="Weave magnification">
<button class="zoom-btn active" data-zoom="1" type="button">1×</button>
<button class="zoom-btn" data-zoom="1.45" type="button">2×</button>
<button class="zoom-btn" data-zoom="2.0" type="button">4×</button>
</div>
</div>
<div class="weave-frame">
<svg id="weaveSvg" viewBox="0 0 400 250" preserveAspectRatio="xMidYMid slice" aria-label="Macro textile weave">
<defs>
<pattern id="basketWeave" width="24" height="24" patternUnits="userSpaceOnUse">
<rect width="24" height="24" fill="var(--warp)"/>
<rect x="1" y="1" width="10" height="5" rx="1.5" fill="var(--thread-hi)" opacity="0.65"/>
<rect x="1" y="7" width="10" height="4" rx="1.5" fill="var(--weft)" opacity="0.72"/>
<rect x="13" y="13" width="10" height="5" rx="1.5" fill="var(--thread-hi)" opacity="0.62"/>
<rect x="13" y="19" width="10" height="4" rx="1.5" fill="var(--weft)" opacity="0.75"/>
<rect x="13" y="1" width="5" height="10" rx="1.5" fill="var(--weft)" opacity="0.82"/>
<rect x="19" y="1" width="4" height="10" rx="1.5" fill="var(--thread-hi)" opacity="0.48"/>
<rect x="1" y="13" width="5" height="10" rx="1.5" fill="var(--weft)" opacity="0.82"/>
<rect x="7" y="13" width="4" height="10" rx="1.5" fill="var(--thread-hi)" opacity="0.48"/>
</pattern>
<linearGradient id="fabricSheen" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="#FFFFFF" stop-opacity="0.16"/>
<stop offset="55%" stop-color="#000000" stop-opacity="0.02"/>
<stop offset="100%" stop-color="#000000" stop-opacity="0.24"/>
</linearGradient>
</defs>
<rect width="400" height="250" fill="url(#basketWeave)"/>
<rect width="400" height="250" fill="url(#fabricSheen)"/>
</svg>
</div>
<div class="weave-caption">
<span id="weaveNote">70% New Wool (Worsted), 30% Viscose</span>
<span>100,000 MARTINDALE · EU ECOLABEL</span>
</div>
</div>
<div class="swatch-panel">
<div>
<h2 class="swatch-title" id="swatchTitle">Hallingdal 65 — Terracotta</h2>
<p class="swatch-designer">Design: Nanna Ditzel, 1965 · Denmark</p>
<div class="swatch-grid" id="swatchGrid"></div>
</div>
<ul class="spec-list">
<li><span class="spec-k">Colorway Code</span><span class="spec-v" id="specCode">0674</span></li>
<li><span class="spec-k">Composition</span><span class="spec-v" id="specComp">70% New Wool, 30% Viscose</span></li>
<li><span class="spec-k">Abrasion</span><span class="spec-v" id="specMart">100,000 Martindale</span></li>
<li><span class="spec-k">Acoustic Class</span><span class="spec-v" id="specAcoustic">αw 0.85 (Class B)</span></li>
<li><span class="spec-k">Width / Weight</span><span class="spec-v">130 cm · 795 g/lin.m</span></li>
</ul>
<div class="action-row">
<button class="primary-btn" id="addSampleBtn" type="button">Add Cutting to Sample Box</button>
</div>
</div>
</section>
<section class="collection-section" id="library">
<div class="section-head">
<h2>Architectural Textile Library</h2>
<div class="filter-row" role="group" aria-label="Filter textiles">
<button class="filter-pill active" data-filter="all" type="button">All (6)</button>
<button class="filter-pill" data-filter="wool" type="button">Wool</button>
<button class="filter-pill" data-filter="acoustic" type="button">Acoustic</button>
<button class="filter-pill" data-filter="curtain" type="button">Curtain</button>
</div>
</div>
<div class="material-cards" id="materialCards"></div>
</section>
</main>
<div class="sample-drawer" id="sampleDrawer" aria-hidden="true">
<div class="drawer-sheet">
<div class="drawer-head">
<h3>Sample Cutting Box</h3>
<button class="zoom-btn" id="closeDrawerBtn" type="button">CLOSE</button>
</div>
<p style="font-size:13px;color:var(--muted);margin:0;">Complimentary A5 architectural textile cuttings dispatched from Ebeltoft within 48 hours.</p>
<div id="sampleList"></div>
</div>
</div>
<script>
const swatches = [
{ id: '0674', name: 'Terracotta', warp: '#B55239', weft: '#883A26', hi: '#D97E67', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.85 (Class B)' },
{ id: '0130', name: 'Nordic Charcoal', warp: '#3A3A38', weft: '#222220', hi: '#61615D', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.85 (Class B)' },
{ id: '0103', name: 'Unbleached Chalk', warp: '#DCD6C8', weft: '#BEB6A4', hi: '#F4F0E6', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.80 (Class B)' },
{ id: '0960', name: 'Fjord Moss', warp: '#4D6153', weft: '#344539', hi: '#748B7B', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.85 (Class B)' },
{ id: '0764', name: 'Copenhagen Indigo', warp: '#2F4863', weft: '#1E3145', hi: '#547291', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.90 (Class A)' },
{ id: '0457', name: 'Ochre Rye', warp: '#C4933F', weft: '#9A6F26', hi: '#DFB66A', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.85 (Class B)' },
{ id: '0227', name: 'Warm Sand', warp: '#B9A78E', weft: '#93816A', hi: '#D4C5AE', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.80 (Class B)' },
{ id: '0596', name: 'Heather Clay', warp: '#8D5B5C', weft: '#663D3E', hi: '#B07D7E', comp: '70% New Wool, 30% Viscose', mart: '100,000 Martindale', ac: 'αw 0.85 (Class B)' }
];
const library = [
{ name: 'Steelcut Trio 3', cat: 'wool', color: '#2F4863', meta: '90% NEW WOOL · 100,000 MARTINDALE', desc: 'Three-dimensional surface crafted by Frans Dijkmeijer and Giulio Ridolfo with subtle shifting hues.' },
{ name: 'Divina Melange 3', cat: 'acoustic', color: '#B55239', meta: '100% NEW WOOL · FELTED FINISH', desc: 'Piece-dyed woollen felt offering crisp architectural planes and high-frequency sound absorption.' },
{ name: 'Time 300 Curtain', cat: 'curtain', color: '#C4933F', meta: '100% TREVIRA CS · 300 CM WIDTH', desc: 'Translucent architectural drape filtering harsh Nordic daylight into diffused warm glare-free glow.' },
{ name: 'Remix 3', cat: 'wool', color: '#4D6153', meta: '90% NEW WOOL · 100,000 MARTINDALE', desc: 'Refined melange weave combining two yarn colors per thread for understated tonal depth.' },
{ name: 'Soft Cells Broadline', cat: 'acoustic', color: '#3A3A38', meta: 'PATENTED TENSION PANEL · CLASS A', desc: 'Modular acoustic wall and ceiling panels engineered to stay taut across humidity shifts.' },
{ name: 'Rime Sheer', cat: 'curtain', color: '#B9A78E', meta: 'LINEN BLEND · ACOUSTIC DRAPE', desc: 'Dry matte linen hand-feel designed for gallery partitions and open-plan timber studios.' }
];
let activeSwatch = swatches[0];
let sampleBox = [swatches[0]];
const swatchGrid = document.getElementById('swatchGrid');
function renderSwatches() {
swatchGrid.innerHTML = '';
swatches.forEach(s => {
const btn = document.createElement('button');
btn.type = 'button';
btn.className = 'swatch-tile' + (s.id === activeSwatch.id ? ' active' : '');
btn.innerHTML = `<span class="swatch-chip" style="background:${s.warp}"></span><span class="swatch-num">${s.id}</span>`;
btn.addEventListener('click', () => selectSwatch(s));
swatchGrid.appendChild(btn);
});
}
function selectSwatch(s) {
activeSwatch = s;
document.documentElement.style.setProperty('--warp', s.warp);
document.documentElement.style.setProperty('--weft', s.weft);
document.documentElement.style.setProperty('--thread-hi', s.hi);
document.documentElement.style.setProperty('--accent', s.warp);
document.getElementById('activeCode').textContent = `HALLINGDAL 65 · COL. ${s.id} ${s.name.toUpperCase()}`;
document.getElementById('swatchTitle').textContent = `Hallingdal 65 — ${s.name}`;
document.getElementById('specCode').textContent = s.id;
document.getElementById('specComp').textContent = s.comp;
document.getElementById('specMart').textContent = s.mart;
document.getElementById('specAcoustic').textContent = s.ac;
renderSwatches();
}
document.querySelectorAll('.zoom-btn[data-zoom]').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.zoom-btn[data-zoom]').forEach(b => b.classList.remove('active'));
btn.classList.add('active');
document.getElementById('weaveSvg').style.transform = `scale(${btn.dataset.zoom})`;
});
});
function renderLibrary(filter = 'all') {
const container = document.getElementById('materialCards');
container.innerHTML = '';
library.filter(m => filter === 'all' || m.cat === filter).forEach(m => {
const el = document.createElement('article');
el.className = 'mat-card';
el.innerHTML = `<div class="mat-swatch-bar" style="background:${m.color}"></div><h3>${m.name}</h3><div class="mat-meta">${m.meta}</div><p class="mat-desc">${m.desc}</p>`;
container.appendChild(el);
});
}
document.querySelectorAll('.filter-pill').forEach(pill => {
pill.addEventListener('click', () => {
document.querySelectorAll('.filter-pill').forEach(p => p.classList.remove('active'));
pill.classList.add('active');
renderLibrary(pill.dataset.filter);
});
});
function renderSamples() {
document.getElementById('boxCount').textContent = sampleBox.length;
const list = document.getElementById('sampleList');
if (!sampleBox.length) {
list.innerHTML = '<p style="font-size:13px;color:var(--muted);">No cuttings selected yet.</p>';
return;
}
list.innerHTML = sampleBox.map(s => `
<div class="sample-item">
<div class="sample-left">
<span class="sample-dot" style="background:${s.warp}"></span>
<div>
<div style="font-size:14px;font-weight:500;">Hallingdal 65 · ${s.name}</div>
<div style="font-family:'IBM Plex Mono',monospace;font-size:11px;color:var(--muted);">COL. ${s.id}</div>
</div>
</div>
<button class="zoom-btn" type="button" onclick="removeSample('${s.id}')">×</button>
</div>
`).join('');
}
window.removeSample = function(id) {
sampleBox = sampleBox.filter(s => s.id !== id);
renderSamples();
};
document.getElementById('addSampleBtn').addEventListener('click', () => {
if (!sampleBox.some(s => s.id === activeSwatch.id)) {
sampleBox.push(activeSwatch);
renderSamples();
}
const btn = document.getElementById('addSampleBtn');
btn.textContent = `Added Col. ${activeSwatch.id} to Box`;
setTimeout(() => { btn.textContent = 'Add Cutting to Sample Box'; }, 1400);
});
const drawer = document.getElementById('sampleDrawer');
document.getElementById('openBoxBtn').addEventListener('click', () => drawer.classList.add('open'));
document.getElementById('closeDrawerBtn').addEventListener('click', () => drawer.classList.remove('open'));
drawer.addEventListener('click', e => { if (e.target === drawer) drawer.classList.remove('open'); });
document.getElementById('menuBtn').addEventListener('click', () => {
document.getElementById('mobileDrawer').classList.toggle('open');
});
renderSwatches();
renderLibrary();
renderSamples();
</script>
</body>
</html>