[HOME] 3D: цвета комнат по цветной схеме владельца; стены полупрозрачные — видно мебель и планировку
lint / hygiene (push) Failing after 18s

This commit is contained in:
root committed 2026-11-02 14:10:14 +03:00
1 parent c07b6f2ee1
commit 23dec7b153
1 file changed
+25 -2
+25 -2
View File
@@ -210,12 +210,18 @@ class House3dCard extends HTMLElement {
drop.forEach((o) => o.parent && o.parent.remove(o));
const DOLLHOUSE = this._config.dollhouse !== false;
const HIDE_INTERIOR = this._config.showInterior === false;
const wallsFaded = true;
if (DOLLHOUSE) {
model.traverse((o) => {
if (!o.isMesh) return;
const n = o.name || "";
if (/^(r_north|r_south|tech_roof|porch_roof)$/.test(n) || n.indexOf("ceil_") === 0) {
o.visible = false;
} else if (wallsFaded && n.indexOf("ipart_") === 0 && o.material) {
o.material.transparent = true;
o.material.opacity = 0.32;
o.material.depthWrite = false;
o.material.needsUpdate = true;
}
});
}
@@ -394,6 +400,22 @@ class House3dCard extends HTMLElement {
if (!saved || typeof saved !== "object" || !Object.keys(saved).length) return false;
const X0 = 180, Y0 = 173, SX = 42.0, SY = 41.4, TER = 2.45, LY = 8.60;
const ROOM_STYLE = {
terrasa: { floor: 0xb08a5e, wall: 0x8a6a45 },
kitchen: { floor: 0x9fb08a, wall: 0xe6e1d6 },
spalnia: { floor: 0xb08a5e, wall: 0x5c6657 },
danina_komnata: { floor: 0xb08a5e, wall: 0xe6e1d6 },
kabinet: { floor: 0xb08a5e, wall: 0x3e4a56 },
sanuzel: { floor: 0x4a5a63, wall: 0x7fa8bd },
tualet: { floor: 0x4a5a63, wall: 0x7fa8bd },
garderob: { floor: 0xb08a5e, wall: 0xe6e1d6 },
kladovaia: { floor: 0x8d8a80, wall: 0xe6e1d6 },
koridor: { floor: 0x9aa88f, wall: 0xe6e1d6 },
prihozhaya: { floor: 0xb08a5e, wall: 0xe6e1d6 },
tambur: { floor: 0xb08a5e, wall: 0xe6e1d6 },
postirochnaia: { floor: 0x7fa8bd, wall: 0xe6e1d6 },
kryltso: { floor: 0xb08a5e, wall: 0x8a6a45 },
};
const COLORS = {
terrasa: 0xb08a5e, kitchen: 0xb08a5e, spalnia: 0x8a7a68, danina_komnata: 0xb08a5e,
kabinet: 0xb08a5e, sanuzel: 0x3a3d40, tualet: 0x3a3d40, garderob: 0xb08a5e,
@@ -418,7 +440,7 @@ class House3dCard extends HTMLElement {
const fg = new T.ExtrudeGeometry(shape, { depth: 0.05, bevelEnabled: false });
fg.rotateX(-Math.PI / 2);
const fm = new T.Mesh(fg, new T.MeshStandardMaterial({
color: COLORS[id] || 0xb08a5e, roughness: 0.65, metalness: 0.0,
color: (ROOM_STYLE[id] || {}).floor || COLORS[id] || 0xb08a5e, roughness: 0.65, metalness: 0.0,
transparent: true, opacity: 0.85, side: T.DoubleSide,
}));
fm.name = "zone_" + id;
@@ -433,8 +455,9 @@ class House3dCard extends HTMLElement {
if (len < 0.2) continue;
const wg = new T.BoxGeometry(len + 0.06, 2.5, 0.06);
const wm = new T.Mesh(wg, new T.MeshStandardMaterial({
color: id === "spalnia" ? 0x5c6657 : id === "kabinet" ? 0x3e4a56 : 0xd8d2c4,
color: (ROOM_STYLE[id] || {}).wall || 0xd8d2c4,
roughness: 0.9, metalness: 0.0, side: T.DoubleSide,
transparent: true, opacity: 0.38, depthWrite: false,
}));
wm.position.set((a.x + b.x) / 2, 0.78 + 1.25, (a.y + b.y) / 2);
wm.rotation.y = -Math.atan2(b.y - a.y, b.x - a.x);