Add toolbar buttons ruler and cut previews

This commit is contained in:
Formsmith
2026-06-18 08:56:40 +03:00
parent 66023aab7c
commit 648d520422
14 changed files with 823 additions and 71 deletions
+113 -3
View File
@@ -985,11 +985,34 @@ button {
.toolbar-icon svg,
.toolbar-icon .toolbar-sprite-icon,
.toolbar-icon .vector-toolbar-sprite-icon {
.toolbar-icon .vector-toolbar-sprite-icon,
.toolbar-icon .toolbar-command-icon {
width: 32px;
height: 32px;
}
.toolbar-command-icon {
display: block;
object-fit: contain;
opacity: 0.96;
transition: filter 120ms ease, opacity 120ms ease;
}
.toolbar-icon.disabled .toolbar-command-icon {
filter: grayscale(1) brightness(1.25);
opacity: 0.22;
}
.toolbar-icon:not(.disabled):hover .toolbar-command-icon {
filter: contrast(1.08) brightness(0.94) drop-shadow(0 0 4px rgba(0, 156, 222, 0.3));
opacity: 1;
}
.toolbar-icon.active .toolbar-command-icon {
filter: contrast(1.12) brightness(0.9) drop-shadow(0 0 5px rgba(0, 156, 222, 0.38));
opacity: 1;
}
.toolbar-sprite-icon {
display: block;
background-repeat: no-repeat;
@@ -1482,7 +1505,7 @@ button {
position: absolute;
top: 173px;
left: 8px;
z-index: 4;
z-index: 8;
display: grid;
gap: 4px;
}
@@ -1505,6 +1528,14 @@ button {
border-color: #c4d2dc;
}
.camera-controls button.active,
.camera-controls button[aria-pressed="true"] {
color: #007eae;
background: #e8f8fd;
border-color: #63cbe8;
box-shadow: 0 0 0 3px rgba(0, 159, 207, 0.14), 0 1px 2px rgba(30, 50, 70, 0.08);
}
.workplane-wrap {
position: absolute;
inset: 0;
@@ -1539,6 +1570,11 @@ button {
cursor: crosshair;
}
.workplane-wrap.ruler-mode .three-workplane-host,
.workplane-wrap.ruler-mode .three-workplane-host:active {
cursor: crosshair;
}
.three-workplane-host canvas {
display: block;
width: 100%;
@@ -1554,6 +1590,78 @@ button {
pointer-events: none;
}
.ruler-overlay {
position: absolute;
inset: 0;
z-index: 7;
pointer-events: none;
}
.ruler-guides {
position: absolute;
inset: 0;
overflow: visible;
pointer-events: none;
}
.ruler-segment {
stroke: #173b5a;
stroke-width: 2;
vector-effect: non-scaling-stroke;
pointer-events: none;
}
.ruler-segment-hit {
stroke: transparent;
stroke-width: 14;
vector-effect: non-scaling-stroke;
pointer-events: stroke;
cursor: pointer;
}
.ruler-point,
.ruler-hover-point {
fill: #ffffff;
stroke: #008fbe;
stroke-width: 2.4;
vector-effect: non-scaling-stroke;
}
.ruler-point {
pointer-events: all;
cursor: pointer;
}
.ruler-point.pending {
fill: #00a7d8;
stroke: #ffffff;
filter: drop-shadow(0 0 3px rgba(0, 126, 174, 0.72));
}
.ruler-hover-point {
fill: rgba(0, 167, 216, 0.28);
stroke-dasharray: 3 2;
pointer-events: none;
}
.ruler-label {
position: absolute;
z-index: 2;
min-width: 46px;
padding: 5px 9px;
color: #16283a;
background: rgba(255, 255, 255, 0.96);
border: 1px solid rgba(190, 211, 224, 0.96);
border-radius: 999px;
box-shadow: 0 1px 4px rgba(20, 42, 58, 0.12);
font-size: 13px;
font-weight: 600;
line-height: 1;
text-align: center;
pointer-events: none;
transform: translate(-50%, -50%);
}
.transform-overlay {
position: absolute;
inset: 0;
@@ -2732,9 +2840,11 @@ button {
cursor: pointer;
}
.sidebar-tool svg {
.sidebar-tool svg,
.sidebar-tool .toolbar-command-icon {
width: 58px;
height: 58px;
object-fit: contain;
}
.sidebar-tool:hover {