dev #26

Merged
ksenia_mikhailova merged 39 commits from dev into main 2024-07-15 09:00:49 +03:00
3 changed files with 34 additions and 45 deletions
Showing only changes of commit ec42dfba66 - Show all commits

View File

@ -23,14 +23,7 @@ const cameraStat = reactive({
})
const pointLight = ref()
const groundMaterial = ref({
color: "#555",
roughness: 0.7,
metalness: 0,
side: FrontSide,
precision: 'lowp',
})
const pointLight2 = ref()
const loadAll = async () => {
const { scene: light } = await useGLTF('/models_light/zabor_so_svetom.glb')
pointLight.value = light.children[2]

View File

@ -78,11 +78,11 @@ const changeParametres = () => {
if (auto_length) {
let w = parametric.length.min
const max_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.min + fence_length))
const min_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.max + fence_length))
const min_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.max + fence_length))
for (let index = min_sections; index <= max_sections; index++) {
full_sections = index
w = (total_length_mm - fence_length * (index - 1)) / index
w = (total_length_mm - fence_length - fence_length * index) / index
if (
w >= parametric.length.min
&& w <= parametric.length.max
@ -99,7 +99,7 @@ const changeParametres = () => {
}
}
if (((full_sections * length) + (full_sections * fence_length) + fence_length) <= total_length_mm) {
if (((full_sections * length) + (full_sections * fence_length) + fence_length) < total_length_mm) {
form_state.extra_section = Math.floor((total_length_mm - fence_length) % length)
} else {
form_state.extra_section = 0
@ -160,19 +160,6 @@ const goal = (target: string, params: object) => {
<input id="height" type="range" class="w-full" v-bind="parametric.height"
v-model="form_state.height" :ref="form_refs.height" />
</div>
<div class="form-item">
<label for="total_length">Общая длина забора, м</label>
<input type="number" id="total_length" v-bind="parametric.total_length"
v-model="form_state.total_length" :ref="form_refs.total_length" />
</div>
<div class="form-item form-item_checkbox">
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
<label for="auto_length">Автоматический подбор секции</label>
</div>
<div class="form-item form-item_checkbox">
<input id="remove_pillar" type="checkbox" v-model="form_state.remove_pillar" />
<label for="remove_pillar">Без столбов</label>
</div>
</div>
</div>
<div class="col-span-12 lg:col-span-6">
@ -183,27 +170,40 @@ const goal = (target: string, params: object) => {
disabled />
<ColorPicker :cb="setLamelleColor" />
</div>
<div class="form-item">
<template v-for="item in predefLamelleColors">
<ColorPicker :color="item" :cb="setLamelleColor" :open="false"
:active="lamelle_color == item" />
</template>
</div>
<div class="form-item">
<label for="pillar_color">Цвет столба</label>
<input id="pillar_color" type="text" :value="getColorNameFromRal(pillar_color)" class="w-60"
disabled />
<ColorPicker :cb="setPillarColor" />
</div>
</div>
</div>
<div class="col-span-12">
<div class="form-row">
<div class="form-item">
<template v-for="item in predefPillarColors">
<ColorPicker :color="item" :cb="setPillarColor" :open="false"
:active="pillar_color == item" />
</template>
<label for="total_length">Общая длина забора, м</label>
<input type="number" id="total_length" v-bind="parametric.total_length"
v-model="form_state.total_length" :ref="form_refs.total_length" />
</div>
<div class="form-item w-full lg:w-2/4">
<p v-if="form_state.extra_section" class="text-ioprim">
Внимание! Дополнительная секция приводит к увеличению стоимости.
Рекомендуем вам изменить длину забора или длину секции!
</p>
</div>
</div>
<div class="form-row min-h-12">
<div class="form-item form-item_checkbox">
<input id="auto_length" type="checkbox" v-model="form_state.auto_length" />
<label for="auto_length">Автоматический подбор секции</label>
</div>
<div class="form-item form-item_checkbox">
<input id="remove_pillar" type="checkbox" v-model="form_state.remove_pillar" />
<label for="remove_pillar">Без столбов</label>
</div>
</div>
</div>
<div class="col-span-12 lg:col-span-8 prose min-w-full">
<div class="col-span-12 lg:col-span-6 prose min-w-full">
<template v-if="(form_state.total_length * 1000) >= parametric.length.min">
<p>
Забор общей длиной {{ form_state.total_length }}{{ '\xa0' }}м,
@ -227,18 +227,14 @@ const goal = (target: string, params: object) => {
{{ `длиной ${form_state.extra_section}\xa0мм` }}
</template>.
</p>
</template>
</div>
<div class="prose col-span-12 lg:col-span-6">
<p>
Окрашивается по технологии порошковой окраски: <br />
ламели: {{ getColorNameFromRal(lamelle_color)?.toLowerCase() }};
столбы: {{ getColorNameFromRal(pillar_color)?.toLowerCase() }}.
</p>
</template>
</div>
<div class="prose col-span-12 lg:col-span-4">
<p v-if="form_state.extra_section" class="text-ioprim">
Внимание! Дополнительная секция приводит к увеличению стоимости.
Рекомендуем вам изменить длину забора или длину секции!
</p>
</div>
<div class="form-row justify-center">
<button @click.prevent="toggleModal">Рассчитать прямо сейчас</button>

View File

@ -13,7 +13,7 @@ export const use_pillar_color = () => useState<ralTypes>('pillar_color', () => p
export const use_lamelle_color = () => useState<ralTypes>('lamelle_color', () => predefLamelleColors[Math.floor(Math.random() * predefLamelleColors.length)] as ralTypes)
export const use_section_count = () => useState('section_count', () => n)
export const use_extra_section = () => useState('extra_section', () => 0)
export const use_total_length = () => useState('total_length', () => ((min * n) - 100) * 0.001)
export const use_total_length = () => useState('total_length', () => (((min + 104) * n) + 104) * 0.001)
export const use_min_length = () => useState('min_length', () => 700)
export const use_max_size = () => useState<number>('max_size', () => 13)
export const use_explosion_state = () => useState<boolean>('explosion_state', () => false)