From 92535f6f171431fcc9123964a6043bed24e2d991 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Wed, 12 Mar 2025 09:41:22 +0300 Subject: [PATCH] radiobtn style --- components/model/diagram.vue | 24 ++++++++++++++++-------- components/model/env.vue | 2 +- pages/index.vue | 21 +++++++++++++-------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/components/model/diagram.vue b/components/model/diagram.vue index 6c93592..eff23ed 100644 --- a/components/model/diagram.vue +++ b/components/model/diagram.vue @@ -29,14 +29,15 @@ const { scene: aristo_planki } = await useGLTF('/models_aristo_exp/planki.glb') const { scene: aristo_stolb } = await useGLTF('/models_aristo_exp/stolb.glb') const { scene: aristo_verh } = await useGLTF('/models_aristo_exp/verh.glb') -const kosynka = ref(standart_kosynka) -const krepleniye_planok = ref(standart_krepleniye_planok) -const osnova_stolba = ref(standart_osnova_stolba) -const planki = ref(standart_planki) -const stolb = ref(standart_stolb) -const verh = ref(standart_verh) +const kosynka = ref() +const krepleniye_planok = ref() +const osnova_stolba = ref() +const planki = ref() +const stolb = ref() +const verh = ref() -watch(() => globalFenceType.value?.type, (t) => { +const setModels = () => { + const t = globalFenceType.value?.type || 'aristo' if (t == 'aristo') { kosynka.value = aristo_kosynka krepleniye_planok.value = aristo_krepleniye_planok @@ -53,6 +54,12 @@ watch(() => globalFenceType.value?.type, (t) => { stolb.value = standart_stolb verh.value = standart_verh } +} + +setModels() + +watch(() => globalFenceType.value?.type, (t) => { + setModels() set_material(planki.value, getColorHexFromRal(lamelle_color.value)); [stolb, verh, krepleniye_planok].map(el => set_material(el.value, getColorHexFromRal(pillar_color.value))) }) @@ -67,7 +74,8 @@ set_material(planki.value, getColorHexFromRal(lamelle_color.value));