release: add sketch revolve and configurable gears

This commit is contained in:
Formsmith
2026-07-24 11:55:44 +03:00
parent 5dde9faceb
commit fe161f8d75
32 changed files with 1913 additions and 115 deletions
+222 -1
View File
@@ -877,6 +877,22 @@ button {
background: #edf2f6;
}
.dashboard-version-row {
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 13px;
color: #52697d;
border-top: 1px solid #dce5ec;
font-size: 13px;
font-weight: 800;
}
.dashboard-version-row strong {
color: #263f57;
font-size: 14px;
}
@media (max-width: 860px) {
.dashboard-topbar {
grid-template-columns: 1fr auto;
@@ -1363,7 +1379,7 @@ button {
}
.sketch-start-section {
min-width: 250px;
min-width: 260px;
}
.sketch-finish-section {
@@ -1477,6 +1493,75 @@ button {
cursor: default;
}
.sketch-create-menu {
position: relative;
height: 43px;
}
.sketch-create-menu-trigger {
position: relative;
min-width: 112px;
padding-right: 20px;
}
.sketch-create-menu-trigger.active {
color: #17405d;
background: #e7f5fb;
border-color: #bcdce8;
}
.sketch-command-button .sketch-create-menu-chevron {
position: absolute;
right: 4px;
bottom: 5px;
width: 13px;
height: 13px;
}
.sketch-create-dropdown {
position: absolute;
top: calc(100% + 5px);
left: 0;
z-index: 70;
display: grid;
width: 232px;
padding: 5px;
background: rgba(250, 252, 253, 0.99);
border: 1px solid #cbd9e3;
border-radius: 7px;
box-shadow: 0 12px 28px rgba(26, 47, 66, 0.22);
}
.sketch-create-dropdown button {
display: grid;
gap: 3px;
width: 100%;
padding: 9px 10px;
color: #314b61;
background: transparent;
border: 0;
border-radius: 5px;
cursor: pointer;
text-align: left;
}
.sketch-create-dropdown button:hover,
.sketch-create-dropdown button:focus-visible {
background: #e7f5fb;
outline: none;
}
.sketch-create-dropdown strong {
font-size: 12px;
font-weight: 900;
}
.sketch-create-dropdown span {
color: #708395;
font-size: 10px;
font-weight: 700;
}
.toolbar-icon.disabled .sketch-reference-icon,
.toolbar-icon:disabled .sketch-reference-icon,
.sketch-command-button.disabled .sketch-reference-icon,
@@ -2683,6 +2768,51 @@ button {
pointer-events: none;
}
.sketch-revolve-preview {
position: absolute;
top: 18px;
right: 22px;
z-index: 8;
width: clamp(210px, 25vw, 330px);
height: clamp(170px, 28vh, 270px);
overflow: hidden;
background: rgba(250, 253, 254, 0.94);
border: 1px solid rgba(166, 190, 204, 0.9);
border-radius: 12px;
box-shadow: 0 12px 34px rgba(34, 67, 86, 0.16);
pointer-events: none;
}
.sketch-revolve-preview-title {
position: absolute;
top: 10px;
left: 12px;
z-index: 1;
color: #49647a;
font-size: 11px;
font-weight: 900;
letter-spacing: 0.04em;
text-transform: uppercase;
}
.sketch-revolve-preview canvas {
display: block;
width: 100%;
height: 100%;
background: radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.98), rgba(229, 240, 245, 0.92));
}
.sketch-revolve-preview-empty {
display: grid;
height: 100%;
place-items: center;
padding: 34px;
color: #718696;
font-size: 13px;
font-weight: 750;
text-align: center;
}
.sketch-plate-wrap {
position: absolute;
inset: 14px 14px 42px;
@@ -2746,6 +2876,24 @@ button {
stroke-width: 1.6;
}
.sketch-revolve-guide rect {
fill: rgba(248, 251, 252, 0.66);
}
.sketch-revolve-guide line {
stroke: #c838bc;
stroke-width: 2.5;
stroke-dasharray: 8 5;
vector-effect: non-scaling-stroke;
}
.sketch-revolve-guide text {
fill: #9e2996;
font-weight: 900;
letter-spacing: 0.08em;
text-anchor: end;
}
.sketch-reference-shapes rect,
.sketch-reference-shapes ellipse {
fill: rgba(207, 142, 42, 0.22);
@@ -3971,6 +4119,17 @@ button {
overflow: hidden;
}
.shape-inspector.sketch-revolve-inspector,
.shape-inspector.gear-inspector {
overflow-anchor: none;
scrollbar-width: none;
}
.shape-inspector.sketch-revolve-inspector::-webkit-scrollbar,
.shape-inspector.gear-inspector::-webkit-scrollbar {
display: none;
}
.shape-inspector-header {
display: flex;
align-items: center;
@@ -4185,6 +4344,8 @@ button {
gap: 8px;
width: calc(100% - 20px);
height: 38px;
min-height: 38px;
flex-shrink: 0;
margin: 0 10px 12px;
color: #28516d;
background: #ffffff;
@@ -4215,6 +4376,10 @@ button {
border-radius: 8px;
}
.property-card.collapsed {
padding-bottom: 0;
}
.property-card-header {
display: flex;
align-items: center;
@@ -4247,6 +4412,62 @@ button {
gap: 17px;
}
.gear-type-property {
display: grid;
gap: 8px;
color: #586a7d;
font-size: 15px;
font-weight: 650;
}
.gear-type-options {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 7px;
}
.gear-type-options button {
display: grid;
min-width: 0;
min-height: 84px;
place-items: center;
gap: 3px;
padding: 5px 3px 7px;
color: #53687a;
background: #f6f9fb;
border: 1px solid #cbd7e0;
border-radius: 7px;
cursor: pointer;
font-size: 11px;
font-weight: 800;
transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}
.gear-type-options button:hover:not(:disabled) {
color: #176f94;
background: #eef9fc;
border-color: #8fc9dc;
}
.gear-type-options button.selected {
color: #0b789f;
background: #eaf8fc;
border-color: #40aad0;
box-shadow: 0 0 0 2px rgba(0, 159, 211, 0.12);
}
.gear-type-options button:disabled {
cursor: default;
opacity: 0.5;
}
.gear-type-options img {
display: block;
width: 62px;
height: 62px;
object-fit: contain;
}
.range-property {
display: grid;
gap: 7px;
+9 -5
View File
@@ -6,7 +6,7 @@ import { SketchForgeEditor, importedShapeFromStl, importedShapeFromSvg } from "@
import { hydrateEditorHistoryState, type EditorHistoryEntry } from "@/lib/editorHistory";
import { createLocalId } from "@/lib/localIds";
import { attachProjectAsset, dedupeProjectAssets, projectAssetFromBytes, sourceFormatForFileName } from "@/lib/projectAssets";
import { importSkfProject } from "@/lib/skfProject";
import { importSkfProject, SKF_CREATED_WITH_VERSION } from "@/lib/skfProject";
import { importExtensionSupported } from "@/lib/stlImport";
import { DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, workplaneSettingsFingerprint } from "@/lib/workplaneSettings";
import type { GridSize, ProjectAsset, WorkplaneShape, WorkplaneWorkspaceSettings } from "@/types/sketchforge";
@@ -1062,7 +1062,7 @@ function Dashboard({
<span>Challenges</span>
</button>
</div>
<button className="dashboard-nav-item dashboard-settings-button" type="button" aria-label="Download settings" title="Download settings" onClick={onOpenSettings}>
<button className="dashboard-nav-item dashboard-settings-button" type="button" aria-label="Settings" title="Settings" onClick={onOpenSettings}>
<Settings size={20} />
<span>Settings</span>
</button>
@@ -1275,10 +1275,10 @@ function Dashboard({
) : null}
{settingsOpen ? (
<section className="dashboard-settings-panel" role="dialog" aria-modal="true" aria-label="Download settings">
<section className="dashboard-settings-panel" role="dialog" aria-modal="true" aria-label="Settings">
<header>
<strong>Download settings</strong>
<button type="button" aria-label="Close download settings" onClick={onCloseSettings}>
<strong>Settings</strong>
<button type="button" aria-label="Close settings" onClick={onCloseSettings}>
<X size={18} />
</button>
</header>
@@ -1301,6 +1301,10 @@ function Dashboard({
placeholder="C:\\Users\\username\\Downloads"
/>
</label>
<div className="dashboard-version-row">
<span>SketchForge version</span>
<strong>{SKF_CREATED_WITH_VERSION}</strong>
</div>
</section>
) : null}
</main>