Refine BIM section controls and styling
This commit is contained in:
@@ -49,6 +49,14 @@ const defaultSettings = {
|
||||
measureLabel: "#c4ff67",
|
||||
measureLabelText: "#292929",
|
||||
measureDot: "#c4ff67",
|
||||
sectionAxisX: "#ff2b2b",
|
||||
sectionAxisY: "#35ff4f",
|
||||
sectionAxisZ: "#285bff",
|
||||
sectionGizmoDiameter: 1,
|
||||
sectionPlaneFill: "#606060",
|
||||
sectionPlaneAlpha: 0.32,
|
||||
sectionPlaneEdge: "#0d0d0d",
|
||||
sectionPlaneEdgeAlpha: 0.8,
|
||||
};
|
||||
|
||||
const STORAGE_KEY = "bimdc-settings-v3";
|
||||
@@ -109,6 +117,14 @@ const applySettings = (s) => {
|
||||
root.style.setProperty("--measure-label", s.measureLabel);
|
||||
root.style.setProperty("--measure-label-text", s.measureLabelText);
|
||||
root.style.setProperty("--measure-dot", s.measureDot);
|
||||
root.style.setProperty("--section-axis-x", s.sectionAxisX);
|
||||
root.style.setProperty("--section-axis-y", s.sectionAxisY);
|
||||
root.style.setProperty("--section-axis-z", s.sectionAxisZ);
|
||||
root.style.setProperty("--section-gizmo-diameter", s.sectionGizmoDiameter);
|
||||
root.style.setProperty("--section-plane-fill", s.sectionPlaneFill);
|
||||
root.style.setProperty("--section-plane-alpha", s.sectionPlaneAlpha);
|
||||
root.style.setProperty("--section-plane-edge", s.sectionPlaneEdge);
|
||||
root.style.setProperty("--section-plane-edge-alpha", s.sectionPlaneEdgeAlpha);
|
||||
// подсветка объектов
|
||||
root.style.setProperty("--highlight-color", s.highlight);
|
||||
};
|
||||
@@ -352,6 +368,50 @@ export function createSettingsMenu({ panel, controls = {}, onChange = null, onSh
|
||||
});
|
||||
panel.appendChild(navCube);
|
||||
|
||||
const sectionCut = section("Разрез / сечение");
|
||||
addColor(sectionCut, "Ось X", "sectionAxisX");
|
||||
addColor(sectionCut, "Ось Y", "sectionAxisY");
|
||||
addColor(sectionCut, "Ось Z", "sectionAxisZ");
|
||||
addSettingsSlider({
|
||||
parent: sectionCut,
|
||||
label: "Диаметр гизмо",
|
||||
value: Math.round(Math.max(0.5, Math.min(1.8, Number(state.sectionGizmoDiameter ?? 1))) * 100),
|
||||
min: 50,
|
||||
max: 180,
|
||||
step: 5,
|
||||
formatValue: (val) => `${Math.round(val)}%`,
|
||||
onChange: (val) => {
|
||||
setVal("sectionGizmoDiameter", Math.max(0.5, Math.min(1.8, Number(val) / 100)));
|
||||
},
|
||||
});
|
||||
addColor(sectionCut, "Плоскость", "sectionPlaneFill");
|
||||
addSettingsSlider({
|
||||
parent: sectionCut,
|
||||
label: "Прозрачность плоскости",
|
||||
value: Math.round(Math.max(0, Math.min(1, Number(state.sectionPlaneAlpha ?? 0.32))) * 100),
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 5,
|
||||
formatValue: (val) => `${Math.round(val)}%`,
|
||||
onChange: (val) => {
|
||||
setVal("sectionPlaneAlpha", Math.max(0, Math.min(1, Number(val) / 100)));
|
||||
},
|
||||
});
|
||||
addColor(sectionCut, "Обводка", "sectionPlaneEdge");
|
||||
addSettingsSlider({
|
||||
parent: sectionCut,
|
||||
label: "Прозрачность обводки",
|
||||
value: Math.round(Math.max(0, Math.min(1, Number(state.sectionPlaneEdgeAlpha ?? 0.8))) * 100),
|
||||
min: 0,
|
||||
max: 100,
|
||||
step: 5,
|
||||
formatValue: (val) => `${Math.round(val)}%`,
|
||||
onChange: (val) => {
|
||||
setVal("sectionPlaneEdgeAlpha", Math.max(0, Math.min(1, Number(val) / 100)));
|
||||
},
|
||||
});
|
||||
panel.appendChild(sectionCut);
|
||||
|
||||
const measure = section("Линейка");
|
||||
addColor(measure, "Линия/бордер", "measureLine");
|
||||
addColor(measure, "Плашка", "measureLabel");
|
||||
|
||||
Reference in New Issue
Block a user