dev #84
|
@ -181,7 +181,7 @@ a[href^="#"] {
|
||||||
@apply py-0 relative;
|
@apply py-0 relative;
|
||||||
|
|
||||||
>.container:first-child {
|
>.container:first-child {
|
||||||
@apply relative h-[50vh] min-h-[600px] justify-between;
|
@apply relative min-h-[650px] justify-between;
|
||||||
|
|
||||||
>* {
|
>* {
|
||||||
@apply z-10
|
@apply z-10
|
||||||
|
@ -281,7 +281,7 @@ label {
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
@apply bg-white border border-gray-300 text-gray-900 rounded focus:ring-blue-500 focus:border-blue-500 focus-visible:border-blue-500 text-lg p-2.5 disabled:cursor-not-allowed disabled:text-black;
|
@apply bg-white border border-gray-300 text-gray-900 text-lg p-2.5 rounded focus:ring-blue-500 focus:border-blue-500 focus-visible:border-blue-500 disabled:cursor-not-allowed disabled:text-black disabled:bg-neutral-300;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=checkbox] {
|
input[type=checkbox] {
|
||||||
|
@ -343,7 +343,13 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
&_checkbox {
|
&_checkbox {
|
||||||
@apply w-full xl:w-auto flex-row xl:flex-initial flex-nowrap gap-4
|
@apply w-full xl:w-auto flex-row xl:flex-initial flex-nowrap gap-4;
|
||||||
|
}
|
||||||
|
&_color {
|
||||||
|
@apply w-full;
|
||||||
|
.color_picker {
|
||||||
|
@apply ml-4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=range] {
|
input[type=range] {
|
||||||
|
@ -364,7 +370,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
&-changer {
|
&-changer {
|
||||||
@apply absolute w-80 z-10 p-4 border rounded bg-white flex gap-0 right-0 lg:right-auto;
|
@apply absolute w-80 z-20 p-4 border rounded bg-white flex gap-0 right-0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,7 +403,7 @@ button {
|
||||||
}
|
}
|
||||||
|
|
||||||
.calc_table {
|
.calc_table {
|
||||||
@apply flex flex-col gap-2 mb-4;
|
@apply flex flex-col gap-2 self-end;
|
||||||
|
|
||||||
>.grid {
|
>.grid {
|
||||||
@apply gap-2 items-center;
|
@apply gap-2 items-center;
|
||||||
|
|
|
@ -155,13 +155,14 @@ const goal = (target: string, params: object) => {
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-item w-full">
|
<div class="form-item w-full">
|
||||||
<label for="length">Длина ламельного блока, мм</label>
|
<label for="length">Длина ламельного блока, мм</label>
|
||||||
<input :value.input="`${form_state.length.toFixed(0)} мм`" :disabled="form_state.auto_length" class="w-full" />
|
<input :value.input="`${form_state.length.toFixed(0)} мм`" :disabled="form_state.auto_length"
|
||||||
|
class="w-full" />
|
||||||
<input id="length" type="range" class="xl:w-full" v-bind="parametric.length"
|
<input id="length" type="range" class="xl:w-full" v-bind="parametric.length"
|
||||||
v-model="form_state.length" :disabled="form_state.auto_length" :ref="form_refs.length" />
|
v-model="form_state.length" :disabled="form_state.auto_length" :ref="form_refs.length" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item w-full">
|
<div class="form-item w-full">
|
||||||
<label for="height">Высота забора, мм</label>
|
<label for="height">Высота забора, мм</label>
|
||||||
<input :value="`${form_state.height} мм`" class="w-full" />
|
<input :value="`${form_state.height} мм`" class="w-full" disabled />
|
||||||
<input id="height" type="range" class="xl:w-full" v-bind="parametric.height"
|
<input id="height" type="range" class="xl:w-full" v-bind="parametric.height"
|
||||||
v-model="form_state.height" :ref="form_refs.height" />
|
v-model="form_state.height" :ref="form_refs.height" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -169,9 +170,18 @@ const goal = (target: string, params: object) => {
|
||||||
<div class="form-item">
|
<div class="form-item">
|
||||||
<label for="total_length">Общая длина забора, м</label>
|
<label for="total_length">Общая длина забора, м</label>
|
||||||
<input type="number" id="total_length" v-bind="parametric.total_length" min=0 max="600"
|
<input type="number" id="total_length" v-bind="parametric.total_length" min=0 max="600"
|
||||||
v-model="form_state.total_length" :ref="form_refs.total_length" class="w-full"/>
|
v-model="form_state.total_length" :ref="form_refs.total_length" class="w-full" />
|
||||||
|
</div>
|
||||||
|
<div class="form-item text-sm xl:text-base">
|
||||||
|
<p v-if="form_state.total_length_mm < parametric.length.min" class="text-ioprim">
|
||||||
|
Выбранный размер забора слишком мал для расчета стоимости. Пожалуйста, выберите больший
|
||||||
|
размер, чтобы продолжить.
|
||||||
|
</p>
|
||||||
|
<p v-if="form_state.extra_section" class="text-ioprim">
|
||||||
|
Внимание! Дополнительная секция приводит к увеличению стоимости.
|
||||||
|
Рекомендуем вам изменить длину забора или длину секции!
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-item form-item_checkbox">
|
<div class="form-item form-item_checkbox">
|
||||||
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
|
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
|
||||||
<label for="auto_length">Автоматический подбор секции</label>
|
<label for="auto_length">Автоматический подбор секции</label>
|
||||||
|
@ -183,69 +193,49 @@ const goal = (target: string, params: object) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-3 col-start-10">
|
<div class="col-span-3 col-start-10">
|
||||||
<div class="form-item">
|
<div class="form-row">
|
||||||
|
<div class="form-item form-item_color">
|
||||||
<label for="lamelle_color">Цвет ламелей</label>
|
<label for="lamelle_color">Цвет ламелей</label>
|
||||||
<input id="lamelle_color" type="text" :value="getColorNameFromRal(lamelle_color)" class="w-60"
|
<input id="lamelle_color" type="text" :value="getColorNameFromRal(lamelle_color)" class="w-60"
|
||||||
disabled />
|
disabled />
|
||||||
<ColorPicker :cb="setLamelleColor" />
|
<ColorPicker :cb="setLamelleColor" />
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item">
|
<div class="form-item form-item_color">
|
||||||
<label for="pillar_color">Цвет столба</label>
|
<label for="pillar_color">Цвет столба</label>
|
||||||
<input id="pillar_color" type="text" :value="getColorNameFromRal(pillar_color)" class="w-60" disabled />
|
<input id="pillar_color" type="text" :value="getColorNameFromRal(pillar_color)" class="w-60"
|
||||||
|
disabled />
|
||||||
<ColorPicker :cb="setPillarColor" />
|
<ColorPicker :cb="setPillarColor" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<template v-if="(form_state.total_length * 1000) >= parametric.length.min">
|
<template v-if="(form_state.total_length * 1000) >= parametric.length.min">
|
||||||
<div class="col-span-12">
|
<div class="col-span-12 xl:col-span-6 xl:col-start-4 grid calc_table">
|
||||||
<div class="col-span-12 xl:col-span-8 xl:col-start-3 grid calc_table">
|
<div class="grid grid-cols-4">
|
||||||
<div class="grid grid-cols-6">
|
<div class="col-span-3 calc_table-maincell">Секции</div>
|
||||||
<div class="col-span-4 calc_table-maincell">Секции</div>
|
<div class="col-span-1 calc_table-maincell">{{ section_count }}</div>
|
||||||
<div class="col-span-2 calc_table-maincell">{{ section_count }}</div>
|
<div class="col-span-3">
|
||||||
<div class="col-span-6 sm:col-span-4">
|
|
||||||
Ламели, RAL {{ lamelle_color }}, {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}
|
Ламели, RAL {{ lamelle_color }}, {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-3 sm:col-span-1">{{ section_count * lamelles_count }}</div>
|
<div class="col-span-1">{{ section_count * lamelles_count }}</div>
|
||||||
<div class="col-span-3 sm:col-span-1">
|
|
||||||
{{ `${parseFloat(form_state.length.toString()).toFixed(2)}\xa0мм` }}</div>
|
|
||||||
<template v-if="!form_state.remove_pillar">
|
<template v-if="!form_state.remove_pillar">
|
||||||
<div class="col-span-6 sm:col-span-4">Столбы, RAL {{ pillar_color }}, {{
|
<div class="col-span-3">Столбы, RAL {{ pillar_color }}, {{
|
||||||
getColorNameFromRal(pillar_color)?.toLowerCase() }}</div>
|
getColorNameFromRal(pillar_color)?.toLowerCase() }}</div>
|
||||||
<div class="col-span-3 sm:col-span-1">
|
<div class="col-span-1">
|
||||||
{{ section_count + ~~(!!form_state.extra_section) + 1 }}
|
{{ section_count + ~~(!!form_state.extra_section) + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-3 sm:col-span-1">
|
|
||||||
{{ `${parseFloat(form_state.fence_length.toString()).toFixed(2)}\xa0мм` }}
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="form_state.extra_section">
|
<template v-if="form_state.extra_section">
|
||||||
<div class="col-span-4 calc_table-maincell">Дополнительная секция</div>
|
<div class="col-span-3 calc_table-maincell">Дополнительная секция</div>
|
||||||
<div class="col-span-2 calc_table-maincell">1</div>
|
<div class="col-span-1 calc_table-maincell">1</div>
|
||||||
<div class="col-span-6 sm:col-span-4">
|
<div class="col-span-3">
|
||||||
Ламели, RAL {{ lamelle_color }}, {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}
|
Ламели, RAL {{ lamelle_color }}, {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-3 sm:col-span-1">
|
<div class="col-span-1">
|
||||||
{{ 1 * lamelles_count }}</div>
|
{{ 1 * lamelles_count }}</div>
|
||||||
<div class="col-span-3 sm:col-span-1">{{
|
|
||||||
`${parseFloat(form_state.extra_section.toString()).toFixed(2)}\xa0мм` }}</div>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="col-span-12 text-center mb-4">
|
|
||||||
<button @click.prevent="toggleModal">Рассчитать</button>
|
<button @click.prevent="toggleModal">Рассчитать</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-span-12">
|
|
||||||
<div class="form-item xl:w-2/4 text-sm xl:text-base">
|
|
||||||
<p v-if="form_state.total_length_mm < parametric.length.min" class="text-ioprim">
|
|
||||||
Выбранный размер забора слишком мал для расчета стоимости. Пожалуйста, выберите больший
|
|
||||||
размер, чтобы продолжить.
|
|
||||||
</p>
|
|
||||||
<p v-if="form_state.extra_section" class="text-ioprim">
|
|
||||||
Внимание! Дополнительная секция приводит к увеличению стоимости.
|
|
||||||
Рекомендуем вам изменить длину забора или длину секции!
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
|
@ -28,7 +28,6 @@ onUnmounted(() => {
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<div>
|
|
||||||
<div class="color_picker" ref="picker">
|
<div class="color_picker" ref="picker">
|
||||||
<div class="color_picker-selected" @click="open ? toggleOpen(!isOpenPicker) : onClick(props.color)"
|
<div class="color_picker-selected" @click="open ? toggleOpen(!isOpenPicker) : onClick(props.color)"
|
||||||
:style="[props.color && { backgroundColor: getColorHexFromRal(props.color) ?? '' }]"
|
:style="[props.color && { backgroundColor: getColorHexFromRal(props.color) ?? '' }]"
|
||||||
|
@ -41,7 +40,6 @@ onUnmounted(() => {
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.color_picker-selected:not([style*=color]) {
|
.color_picker-selected:not([style*=color]) {
|
||||||
|
|
|
@ -29,22 +29,6 @@ const lamelle_height = use_lamelle_height()
|
||||||
const total = ref((section_count.value + ~~(!!extra_section.value)))
|
const total = ref((section_count.value + ~~(!!extra_section.value)))
|
||||||
const position = ref(new Vector3())
|
const position = ref(new Vector3())
|
||||||
|
|
||||||
const clickable_positions = reactive({
|
|
||||||
'top': [position.value.x, (lamelle_count.value + 1) * lamelle_height.value, 0],
|
|
||||||
'lam': [position.value.x, position.value.y * 0.5, 0]
|
|
||||||
})
|
|
||||||
const clickable_pointers = ref<any[]>([])
|
|
||||||
const clickable_refs = ref<any>([])
|
|
||||||
|
|
||||||
Object.entries(clickable_positions).map(el => {
|
|
||||||
const p = props.models.pointer.clone()
|
|
||||||
p.position.set(...el[1])
|
|
||||||
p.updateMatrixWorld()
|
|
||||||
p.name = `clickable_${props.number}_${el[0]}`
|
|
||||||
clickable_pointers.value.push(p)
|
|
||||||
clickable_refs.value.push(ref(p.name))
|
|
||||||
})
|
|
||||||
|
|
||||||
const count_pos = () => {
|
const count_pos = () => {
|
||||||
total.value = (section_count.value + ~~(!!extra_section.value))
|
total.value = (section_count.value + ~~(!!extra_section.value))
|
||||||
|
|
||||||
|
@ -81,22 +65,7 @@ const count_pos = () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
line?.updateMatrixWorld()
|
line?.updateMatrixWorld()
|
||||||
|
|
||||||
clickable_positions.top = [position.value.x, (lamelle_count.value + 1) * lamelle_height.value, 0];
|
|
||||||
clickable_positions.lam = [position.value.x, position.value.y * 0.5, 0];
|
|
||||||
}
|
}
|
||||||
watch(clickable_positions, () => {
|
|
||||||
clickable_refs.value.map((el: Ref<Object3D[]>) => {
|
|
||||||
const name = el.value[0].name.replace(`clickable_${props.number}_`, '')
|
|
||||||
if (name in clickable_positions) {
|
|
||||||
const p = clickable_positions[name as keyof typeof clickable_positions];
|
|
||||||
console.log(props.number, p, el.value[0].name)
|
|
||||||
el.value[0].position.set(p[0], p[1], p[2])
|
|
||||||
el.value[0].children[0].position.set(p[0], p[1], p[2])
|
|
||||||
el.value[0].updateMatrixWorld()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}, { deep: true })
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
count_pos()
|
count_pos()
|
||||||
|
@ -105,24 +74,6 @@ watch(() => [props.count, fence_section.value, section_count.value, extra_sectio
|
||||||
count_pos,
|
count_pos,
|
||||||
{ flush: 'post' }
|
{ flush: 'post' }
|
||||||
)
|
)
|
||||||
|
|
||||||
const { onBeforeRender } = useLoop()
|
|
||||||
onBeforeRender(() => {
|
|
||||||
clickable_refs.value.map((el: any) => {
|
|
||||||
if (el.value[0] && el.value[0].children) {
|
|
||||||
el.value[0].children[0].lookAt(camera.value?.position);
|
|
||||||
el.value[0].children[0].rotateX(degToRad(90));
|
|
||||||
el.value[0].children[0].rotateZ(degToRad(15));
|
|
||||||
|
|
||||||
const dis_to_cam = camera.value?.position.distanceTo(el.value[0].position);
|
|
||||||
if (dis_to_cam) {
|
|
||||||
const scaling = (0.66 * dis_to_cam) / 100
|
|
||||||
el.value[0].children[0].scale.set(scaling, scaling, scaling);
|
|
||||||
el.value[0].updateMatrixWorld()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<TresGroup :name="`line_${props.number}`" :rotate-y="rotate()" :position-x="position.x" :position-y="position.y"
|
<TresGroup :name="`line_${props.number}`" :rotate-y="rotate()" :position-x="position.x" :position-y="position.y"
|
||||||
|
@ -137,10 +88,5 @@ onBeforeRender(() => {
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</TresGroup>
|
</TresGroup>
|
||||||
<TresGroup name="pointer">
|
|
||||||
<template v-for="(p, i) in clickable_pointers">
|
|
||||||
<TresObject3D v-bind="p.clone()" :ref="clickable_refs[i]" :visible="false" />
|
|
||||||
</template>
|
|
||||||
</TresGroup>
|
|
||||||
</TresGroup>
|
</TresGroup>
|
||||||
</template>
|
</template>
|
Loading…
Reference in New Issue