From 195332d963197f072ac8e9a884b581cbc70732c7 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Tue, 24 Sep 2024 16:58:15 +0300 Subject: [PATCH] test slots --- components/calc/values.vue | 8 ++++++-- components/dropdown/colorPicker.vue | 17 ++++++++++++++--- components/model/parametric.vue | 14 +++++++------- components/pattern.ts | 2 +- composables/useCalc.ts | 5 ++++- public/fence_one/bottom.glb | Bin 2752 -> 3060 bytes public/fence_one/top.glb | Bin 2832 -> 3080 bytes public/pattern/tile2.jpg | Bin 0 -> 54553 bytes 8 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 public/pattern/tile2.jpg diff --git a/components/calc/values.vue b/components/calc/values.vue index ad27f40..fda68c2 100644 --- a/components/calc/values.vue +++ b/components/calc/values.vue @@ -4,6 +4,7 @@ import type { ralTypes } from '@/components/ral' import { predefLamelleColors, predefPillarColors } from '~/composables/useCalc'; import type { patternTypes } from '../pattern'; +import { Vector3 } from 'three'; const lamelle_height = use_lamelle_height() const lamelles_count = use_lamelles_count() @@ -16,6 +17,7 @@ const section_count = use_section_count() const extra_section = use_extra_section() const total_length = use_total_length() const min_length = use_min_length() +const goto_cam = use_goto_camera() if (!pillar_color.value) { const r = Math.floor(Math.random() * predefPillarColors.length) @@ -137,14 +139,16 @@ const changeParametres = () => { const setLamelleColor = (color: ralTypes) => { + goto_cam.value = new Vector3(-2, -2, -2) lamelle_color.value = color; lamelle_text.value = contrastColor(color) ?? '#000' } const setPillarColor = (color: ralTypes) => { + goto_cam.value = new Vector3(2, 2, 2) pillar_color.value = color pillar_text.value = contrastColor(color) ?? '#000' } -const setPillarPattern = (pattern:patternTypes) => { +const setPillarPattern = (pattern: patternTypes) => { pillar_pattern.value = pattern } watch(() => form_state, changeParametres, { deep: true }) @@ -231,7 +235,7 @@ const calc_table = computed(() => { backgroundColor: getColorHexFromRal(lamelle_color) ?? 'transparent', color: lamelle_text }" disabled /> - + 123
diff --git a/components/dropdown/colorPicker.vue b/components/dropdown/colorPicker.vue index ded7759..c7af0ba 100644 --- a/components/dropdown/colorPicker.vue +++ b/components/dropdown/colorPicker.vue @@ -4,6 +4,8 @@ import { ralClassicPallette, getColorHexFromRal } from '@/components/ral' const props = defineProps(['color', 'cb', 'open', 'active']) const open = props.open ?? true +const goto_cam = use_goto_camera() + const onClick = (color: string) => { if (props.cb) { props.cb(color) @@ -12,6 +14,9 @@ const onClick = (color: string) => { } const isOpenPicker = ref(false) const toggleOpen = (value: boolean = !isOpenPicker) => { + if (value == false) { + goto_cam.value = undefined + } isOpenPicker.value = value !== undefined ? value : !isOpenPicker.value } const picker = ref() @@ -29,9 +34,15 @@ onUnmounted(() => {