diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 9de87c7..c4e7594 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -794,12 +794,36 @@ kbd { stroke: #7d8aa0; } -.node .cable-fan { - fill: none; - stroke: #7d8aa0; - stroke-width: 1.2; +/* A free cable end is only its wires running into the cable; this is where to grab it. */ +.node .cable-hit { + fill: transparent; + stroke: transparent; } +.node:hover .cable-hit, +.node.ghost .cable-hit { + stroke: rgb(125 138 160 / 0.5); + stroke-dasharray: 3 3; +} + +.harness { + --w-on: var(--on); + --w-off: var(--off); + fill: none; + stroke: var(--w-off); + stroke-width: 1.6; + stroke-linejoin: round; + pointer-events: none; +} + +.harness.on { stroke: var(--w-on); } +.harness.c-red { --w-on: #ff5c5c; --w-off: #6b3337; } +.harness.c-orange { --w-on: #ff9f43; --w-off: #6b4a2b; } +.harness.c-yellow { --w-on: #ffd93d; --w-off: #625a2e; } +.harness.c-blue { --w-on: #4dabff; --w-off: #2b4a6b; } +.harness.c-purple { --w-on: #b388ff; --w-off: #463768; } +.harness.c-pink { --w-on: #ff7ac6; --w-off: #673657; } + .node .body.cable-end.plugged { fill: #253447; stroke: #6fa3cf; @@ -819,7 +843,7 @@ kbd { .node .cable-name { font-size: 9px; - fill: var(--text); + fill: var(--muted); } /* Pixel and pixel screens. */ diff --git a/app/components/editor/Canvas.vue b/app/components/editor/Canvas.vue index d40b625..ceb9340 100644 --- a/app/components/editor/Canvas.vue +++ b/app/components/editor/Canvas.vue @@ -5,7 +5,7 @@ import type { CircuitNode, PanelRow, PinRef, Wire } from '~/lib/logic/types' import { branchCorners, branchTo, moveCorner, moveSegment, routeTouchesBox, segmentDrag, splitDrag } from '~/lib/logic/wires' import { circuitRoutes, findCrossings } from '~/lib/logic/routing' import { seriesLinks } from '~/lib/logic/bulk' -import { LANE, ribbon } from '~/lib/logic/cables' +import { LANE, ribbon, RIBBON_MAX } from '~/lib/logic/cables' import { wirePath } from '~/lib/draw' import { pinName } from '~/lib/logic/labels' @@ -40,9 +40,6 @@ interface Route { sleeve?: number } -/** Cables with up to this many wires show each wire as its own line. */ -const RIBBON_MAX = 16 - const toPath = (pts: Pt[]) => pts.map(([x, y], i) => `${i ? 'L' : 'M'}${x * G} ${y * G}`).join('') const routes = computed(() => { diff --git a/app/components/editor/NodeView.vue b/app/components/editor/NodeView.vue index 155fbe7..b1f260c 100644 --- a/app/components/editor/NodeView.vue +++ b/app/components/editor/NodeView.vue @@ -1,6 +1,7 @@