app
Wire Harness Designer
Public Made by Adomby adom
Design wire harnesses in the browser and export a professional, print-ready PDF assembly drawing. Pick connectors, wire gauge, colour and stripe, sleeving, and connector-to-connector lengths; get a live fishbone diagram with a wire schedule and title block. Click any wire or connector in the drawing to edit it. Save and reload the whole harness as JSON.
master
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
:root {
--bg: #0d1117;
--surface: #161b22;
--elevated: #1c2128;
--overlay: #21262d;
--border: #30363d;
--border-soft: #262c34;
--text: #e6edf3;
--text-2: #8b949e;
--text-3: #545c66;
--accent: #00b8b0;
--accent-bright: #00e6dc;
--purple: #8c6bf7;
--blue: #58a6ff;
--green: #3fb950;
--red: #f85149;
--yellow: #d29922;
--font-head: 'Familjen Grotesk', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
--font-body: 'Satoshi', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
--font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
margin: 0;
background: var(--bg);
color: var(--text);
font-family: var(--font-body);
font-size: 13px;
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
#app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* ---------- header ---------- */
.appbar {
height: 44px; min-height: 44px;
display: flex; align-items: center; gap: 10px;
padding: 0 12px;
background: var(--surface);
border-bottom: 1px solid var(--border);
position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--accent); cursor: default; }
.brand-icon { width: 17px; height: 17px; color: var(--accent); flex: none; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--accent); letter-spacing: .1px; white-space: nowrap; }
.brand-dot { color: var(--text-3); }
.brand-sub { font-family: var(--font-head); font-weight: 500; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.vsep { width: 1px; height: 22px; background: var(--border); flex: none; }
.subject { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; }
.subject-name { font-weight: 700; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
/* ---------- buttons ---------- */
.btn {
font-family: var(--font-body); font-size: 12px; font-weight: 500;
color: var(--text); background: var(--elevated);
border: 1px solid var(--border); border-radius: 8px;
padding: 6px 11px; cursor: pointer; white-space: nowrap;
transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--overlay); border-color: #3d4652; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #04211f; font-weight: 600; }
.btn-primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.btn-sm { padding: 4px 8px; font-size: 11px; border-radius: 6px; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: rgba(248,81,73,.12); border-color: rgba(248,81,73,.5); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--elevated); color: var(--text); border-color: var(--border); }
#btnMobileEdit { display: none; }
/* ---------- body split ---------- */
.body { flex: 1; display: flex; min-height: 0; }
.editor {
width: 384px; min-width: 384px; max-width: 384px;
background: var(--surface);
border-right: 1px solid var(--border);
overflow-y: auto; overflow-x: hidden;
padding: 12px 12px 40px;
}
.preview { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #0a0e14; }
/* ---------- editor sections ---------- */
.section { margin-bottom: 14px; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--elevated); overflow: hidden; }
.section-head {
display: flex; align-items: center; gap: 8px;
padding: 9px 12px; cursor: pointer; user-select: none;
background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}
.section-head:hover { background: rgba(255,255,255,.03); }
.section-title { font-family: var(--font-head); font-weight: 600; font-size: 12.5px; color: var(--text); flex: 1; }
.section-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-2); background: var(--overlay); border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px; }
.section-caret { color: var(--text-2); transition: transform .15s ease; font-size: 11px; }
.section.collapsed .section-caret { transform: rotate(-90deg); }
.section-body { padding: 4px 12px 12px; }
.section.collapsed .section-body { display: none; }
/* ---------- form fields ---------- */
.field { margin: 8px 0; }
.field > label { display: block; font-size: 10.5px; color: var(--text-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
input[type=text], input[type=number], select, textarea {
width: 100%; font-family: var(--font-body); font-size: 12.5px;
color: var(--text); background: var(--bg);
border: 1px solid var(--border); border-radius: 7px;
padding: 6px 8px; outline: none;
transition: border-color .12s ease, box-shadow .12s ease;
}
input[type=number] { font-family: var(--font-mono); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,184,176,.18); }
textarea { resize: vertical; min-height: 44px; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b949e' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 24px; }
/* ---------- item cards (connectors / wires / wraps) ---------- */
.item {
border: 1px solid var(--border); border-radius: 10px;
background: var(--surface); padding: 9px; margin: 8px 0;
position: relative;
}
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.item-tag { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--accent); background: rgba(0,184,176,.1); border: 1px solid rgba(0,184,176,.25); border-radius: 6px; padding: 1px 7px; }
.item-title { font-size: 11.5px; color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-del { color: var(--text-3); background: transparent; border: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.item-del:hover { color: var(--red); background: rgba(248,81,73,.12); }
.row-inline { display: flex; align-items: center; gap: 6px; }
input.pin-input { width: 54px; flex: none; }
.mini { font-size: 10px; color: var(--text-3); text-align: center; }
.addbtn {
width: 100%; margin-top: 6px; padding: 7px;
border: 1px dashed var(--border); border-radius: 9px;
background: transparent; color: var(--text-2); cursor: pointer;
font-size: 12px; transition: all .15s ease;
}
.addbtn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,184,176,.05); }
/* colour picker with swatch */
.color-wrap { display: flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid #565f6a; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.grow, select.grow, input.grow { flex: 1 1 auto; width: auto; min-width: 0; }
/* segment length rows */
.seg-row { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid var(--border-soft); }
.seg-row:last-child { border-bottom: none; }
.seg-pair { flex: 1; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.seg-arrow { color: var(--accent); margin: 0 2px; }
.seg-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-2); background: var(--overlay); border: 1px solid var(--border); border-radius: 999px; padding: 1px 6px; flex: none; }
input.seg-len { width: 80px; flex: none; }
.seg-unit { font-size: 11px; color: var(--text-3); flex: none; }
/* ---------- preview ---------- */
.preview-toolbar {
height: 34px; min-height: 34px; display: flex; align-items: center;
padding: 0 10px; gap: 8px; border-bottom: 1px solid var(--border);
background: var(--surface);
}
.pv-left { display: flex; align-items: center; gap: 8px; flex: 1; }
.pv-label { font-family: var(--font-head); font-size: 10.5px; font-weight: 600; letter-spacing: 1px; color: var(--text-2); }
.pv-page { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.pv-right { display: flex; align-items: center; gap: 4px; }
.pv-gap { width: 8px; }
.iconbtn {
min-width: 26px; height: 26px; padding: 0 7px;
display: inline-flex; align-items: center; justify-content: center;
font-family: var(--font-body); font-size: 12px;
color: var(--text-2); background: var(--elevated);
border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
}
.iconbtn:hover { color: var(--text); background: var(--overlay); }
.sheet-scroll { flex: 1; overflow: auto; padding: 20px; display: flex; align-items: flex-start; justify-content: center; }
.sheet-wrap {
background: #ffffff; border-radius: 3px;
box-shadow: 0 12px 40px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
line-height: 0; transition: width .12s ease;
}
.harness-sheet { display: block; width: 100%; height: auto; }
/* ---------- status bar ---------- */
.statusbar {
height: 26px; min-height: 26px; display: flex; align-items: center;
padding: 0 12px; gap: 14px; font-size: 11px; color: var(--text-2);
background: var(--surface); border-top: 1px solid var(--border);
}
#statCounts { font-family: var(--font-mono); }
.status-hint { margin-left: auto; color: var(--text-3); }
/* ---------- toasts ---------- */
#toast-host {
position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
z-index: 9998; pointer-events: none;
}
.toast {
pointer-events: auto; display: flex; align-items: center; gap: 9px;
min-width: 220px; max-width: 460px; padding: 9px 13px;
background: var(--overlay); border: 1px solid var(--border);
border-left-width: 3px; border-radius: 9px; color: var(--text);
font-size: 12.5px; box-shadow: 0 8px 28px rgba(0,0,0,.5);
animation: toastIn .18s ease;
}
.toast.hide { animation: toastOut .18s ease forwards; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast.info { border-left-color: var(--accent); }
.toast .t-ico { width: 15px; height: 15px; flex: none; }
.toast .t-act { margin-left: 6px; color: var(--accent-bright); background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 600; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
/* ---------- tooltip ---------- */
#tooltip {
position: fixed; z-index: 99999; pointer-events: none;
max-width: 260px; padding: 7px 10px; font-size: 11.5px; line-height: 1.4;
color: var(--text); background: var(--overlay);
border: 1px solid var(--border); border-radius: 8px;
box-shadow: 0 8px 24px rgba(0,0,0,.5);
opacity: 0; transform: translateY(3px); transition: opacity .18s ease, transform .18s ease;
text-transform: none; font-weight: 400; white-space: normal;
}
#tooltip.show { opacity: 1; transform: none; }
/* clickable elements in the drawing */
svg .pickable { cursor: pointer; }
svg path.pickable:hover { stroke: var(--accent) !important; stroke-opacity: .28 !important; }
svg rect.pickable:hover { stroke: var(--accent) !important; stroke-width: 2 !important; }
/* click-to-edit popover */
.pick-pop {
position: fixed; z-index: 99998; width: 264px;
background: var(--overlay); border: 1px solid var(--border); border-radius: 11px;
box-shadow: 0 16px 40px rgba(0,0,0,.6);
opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left;
transition: opacity .15s ease, transform .15s ease;
}
.pick-pop.show { opacity: 1; transform: none; }
.pp-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.pp-sub { flex: 1; font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-close { background: transparent; border: none; color: var(--text-2); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.pp-close:hover { color: var(--text); background: var(--elevated); }
.pp-body { padding: 10px; }
.pp-body .grid2 { margin-top: 8px; }
.pp-l { display: block; font-size: 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; margin: 8px 0 4px; }
.pp-body > .pp-l:first-child, .pp-body .grid2 .pp-l { margin-top: 0; }
/* app-info popover on brand hover */
.brand-pop {
position: fixed; z-index: 99999; top: 44px; left: 10px;
width: 250px; padding: 12px; background: var(--overlay);
border: 1px solid var(--border); border-radius: 10px;
box-shadow: 0 12px 32px rgba(0,0,0,.55);
opacity: 0; transform: translateY(-4px); pointer-events: none;
transition: opacity .18s ease, transform .18s ease;
}
.brand-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.brand-pop h4 { margin: 0 0 6px; font-family: var(--font-head); font-size: 13px; }
.brand-pop dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11.5px; }
.brand-pop dt { color: var(--text-2); }
.brand-pop dd { margin: 0; font-family: var(--font-mono); color: var(--text); }
/* ---------- responsive ---------- */
@media (max-width: 900px) {
#btnMobileEdit { display: inline-flex; align-items: center; }
#btnNew, #btnSample { display: none; }
.body { flex-direction: column; }
.editor { width: 100%; min-width: 0; max-width: none; border-right: none; border-bottom: 1px solid var(--border); flex: 1; }
.preview { display: none; }
#app.show-preview .editor { display: none; }
#app.show-preview .preview { display: flex; flex: 1; }
.subject-meta { display: none; }
}