diff --git a/assets/main.scss b/assets/main.scss index 8bf6159..8ecb5fc 100644 --- a/assets/main.scss +++ b/assets/main.scss @@ -178,10 +178,18 @@ a[href^="#"] { } &_calc { - @apply py-0; + // @apply; - &-canvas { - @apply relative h-[50vh] min-h-[600px]; + .container { + @apply gap-4 items-stretch; + + >* { + @apply relative; + } + + >div:first-child { + @apply min-h-[600px]; + } } } @@ -273,13 +281,17 @@ label { } input { - @apply bg-neutral-200 border border-gray-300 text-gray-900 rounded focus:ring-blue-500 focus: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 } input[type=checkbox] { @apply w-4 h-4; } +input[type=range] { + @apply w-full bg-transparent border-transparent cursor-pointer appearance-none disabled:opacity-50 disabled:pointer-events-none focus:outline-none [&::-webkit-slider-thumb]:w-2.5 [&::-webkit-slider-thumb]:h-2.5 [&::-webkit-slider-thumb]:-mt-0.5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:bg-white [&::-webkit-slider-thumb]:shadow-[0_0_0_4px_#111] [&::-webkit-slider-thumb]:shadow-slate-500 [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:transition-all [&::-webkit-slider-thumb]:duration-150 [&::-webkit-slider-thumb]:ease-in-out [&::-webkit-slider-thumb]:dark:bg-neutral-700 [&::-moz-range-thumb]:w-2.5 [&::-moz-range-thumb]:h-2.5 [&::-moz-range-thumb]:appearance-none [&::-moz-range-thumb]:bg-white [&::-moz-range-thumb]:border-4 [&::-moz-range-thumb]:border-blue-600 [&::-moz-range-thumb]:rounded-full [&::-moz-range-thumb]:transition-all [&::-moz-range-thumb]:duration-150 [&::-moz-range-thumb]:ease-in-out [&::-webkit-slider-runnable-track]:w-full [&::-webkit-slider-runnable-track]:h-2 [&::-webkit-slider-runnable-track]:bg-gray-100 [&::-webkit-slider-runnable-track]:rounded-full [&::-webkit-slider-runnable-track]:dark:bg-neutral-700 [&::-moz-range-track]:w-full [&::-moz-range-track]:h-2 [&::-moz-range-track]:bg-gray-100 [&::-moz-range-track]:rounded-full; +} + textarea { @apply block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 max-w-full min-h-10 max-h-40; } @@ -294,51 +306,133 @@ button { } .form { - @apply col-span-full grid grid-cols-12 gap-4; + @apply col-span-full h-full flex flex-col gap-4 justify-between; + + &-group { + @apply rounded flex flex-col gap-4 p-4 shadow shadow-slate-400; + } &-row { - @apply col-span-full flex flex-row flex-wrap gap-4; + @apply flex flex-row flex-wrap gap-2; + + &_picker { + @apply grid grid-cols-2 justify-center items-center; + } } &-item { - @apply flex flex-row gap-4 items-center justify-start xl:justify-center flex-wrap xl:flex-nowrap; + @apply flex flex-row items-center justify-start flex-wrap; label { - @apply w-full xl:w-auto; + @apply w-full; } .icon { - @apply hover:text-primary cursor-pointer transition-colors text-2xl; + @apply hover:text-primary cursor-pointer transition-colors text-xl; &.disabled { @apply text-neutral pointer-events-none cursor-not-allowed; } } - &_checkbox { - @apply w-full xl:w-auto flex-row xl:flex-initial flex-nowrap + &_total { + @apply w-full flex-nowrap; + + input { + @apply w-20 bg-slate-100; + } } - input[type=range] { - @apply min-w-[calc(100%-8rem)] xl:min-w-min; + &_checkbox { + @apply w-full xl:w-auto flex-row xl:flex-initial flex-nowrap gap-2 items-center; + + label { + @apply leading-none; + } + + svg { + @apply text-slate-500; + } + } + + &_range { + @apply w-full; + + >div { + @apply flex flex-nowrap w-full gap-2 items-center; + + input { + @apply flex-grow; + } + + span { + @apply min-w-16; + } + } + } + + &_picker { + @apply w-full; + + svg { + @apply text-slate-500; + } } } } -.color_picker { - @apply leading-none; +.picker { + @apply leading-none w-full row-start-2; + + &_open { + @apply flex-wrap; + } + + &_disabled { + @apply pointer-events-none opacity-50; + } + + &-input { + @apply flex items-center justify-between; + + >div { + @apply min-h-12 overflow-hidden rounded border-gray-300 shadow flex leading-none grow justify-center items-center p-2; + + span { + @apply grow text-left max-w-[80%] break-words line-clamp-2; + } + } + + } + + &-button { + @apply min-w-6 shrink-0 h-full; + } &-selected { - @apply size-10 rounded border-gray-300 shadow inline-block leading-none; - - &__active { - @apply outline outline-2 outline-offset-2 outline-primary; - } + @apply h-10 overflow-hidden rounded border-gray-300 shadow inline-block leading-none grow; } &-changer { - @apply absolute w-80 z-10 p-4 border rounded bg-white flex gap-0 right-0 lg:right-auto; + @apply gap-3 mt-4 max-h-36 overflow-auto order-10 hidden; + + &_open { + @apply flex flex-wrap col-span-2; + } } + + &-list { + @apply flex gap-4 w-full; + } + + &-item { + @apply size-10; + + &--empty { + @apply block bg-slate-300; + } + } + } .feature { @@ -369,11 +463,15 @@ button { } } +.calc { + @apply max-h-[800px] relative h-full; +} + .calc_table { - @apply flex flex-col gap-2 mb-4; + @apply flex flex-col gap-2 self-end; >.grid { - @apply gap-2 items-center; + @apply gap-2 items-end; >[class*=col] { @apply p-1 border-solid border-b; diff --git a/components/calc/models.vue b/components/calc/models.vue new file mode 100644 index 0000000..6a8a735 --- /dev/null +++ b/components/calc/models.vue @@ -0,0 +1,47 @@ + + \ No newline at end of file diff --git a/components/calc/values.vue b/components/calc/values.vue new file mode 100644 index 0000000..e7910f3 --- /dev/null +++ b/components/calc/values.vue @@ -0,0 +1,281 @@ + + \ No newline at end of file diff --git a/components/calcModels.vue b/components/calcModels.vue deleted file mode 100644 index 5689f78..0000000 --- a/components/calcModels.vue +++ /dev/null @@ -1,83 +0,0 @@ - - \ No newline at end of file diff --git a/components/calcValues.vue b/components/calcValues.vue deleted file mode 100644 index 65c4c5b..0000000 --- a/components/calcValues.vue +++ /dev/null @@ -1,256 +0,0 @@ - - \ No newline at end of file diff --git a/components/colorPicker.vue b/components/colorPicker.vue deleted file mode 100644 index 5c084f4..0000000 --- a/components/colorPicker.vue +++ /dev/null @@ -1,50 +0,0 @@ - - - \ No newline at end of file diff --git a/components/dropdown/color.vue b/components/dropdown/color.vue new file mode 100644 index 0000000..1055670 --- /dev/null +++ b/components/dropdown/color.vue @@ -0,0 +1,13 @@ + + \ No newline at end of file diff --git a/components/dropdown/list.vue b/components/dropdown/list.vue new file mode 100644 index 0000000..2aa0af9 --- /dev/null +++ b/components/dropdown/list.vue @@ -0,0 +1,28 @@ + + \ No newline at end of file diff --git a/components/dropdown/picker.vue b/components/dropdown/picker.vue new file mode 100644 index 0000000..4e0a8a6 --- /dev/null +++ b/components/dropdown/picker.vue @@ -0,0 +1,79 @@ + + + \ No newline at end of file diff --git a/components/expDiagram.vue b/components/expDiagram.vue index 66193a8..358cf2a 100644 --- a/components/expDiagram.vue +++ b/components/expDiagram.vue @@ -18,23 +18,16 @@ const toggleExpState = () => { explosion_state.value = !explosion_state.value } const back_light = ref() -const key_light = ref() const secondary_light = ref() const loadAll = async () => { const { scene: back } = await useGLTF('/models_light/back_exp.glb') - const { scene: key } = await useGLTF('/models_light/key_exp.glb') const { scene: secondary } = await useGLTF('/models_light/secondary_exp.glb') - const k = 0.001 + const k = 0.03 back_light.value = back.children[0] back_light.value.intensity = back_light.value.intensity * k - back_light.value.shadow.bias = -0.01 - - key_light.value = key.children[0] - key_light.value.intensity = key_light.value.intensity * k - key_light.value.shadow.bias = -0.01 - key_light.value.cast_shadow = true + back_light.value.shadow.bias = -0.02 secondary_light.value = secondary.children[0] secondary_light.value.intensity = secondary_light.value.intensity * k @@ -63,17 +56,10 @@ onMounted(() => { + - - - - -
diff --git a/components/modal.vue b/components/modal.vue index 08957fa..38478a3 100644 --- a/components/modal.vue +++ b/components/modal.vue @@ -2,6 +2,8 @@ import { getColorNameFromRal } from '@/components/ral' import type { ralTypes } from '@/components/ral' import { apiFetch } from '~/utils/apiFetch'; +import { getName as getPatternName } from './pattern'; +import { getName as getTopperName } from './topper'; const config = useRuntimeConfig() const apiBase = config.public.apiBase @@ -17,6 +19,8 @@ const section_count = useState('section_count') const extra_section = useState('extra_section') const total_length = useState('total_length') const remove_pillar = useState('remove_pillar') +const pillar_topper = use_topper() +const pillar_pattern = use_pattern() const toggleModal = () => { modal_data.email = undefined @@ -143,6 +147,8 @@ const total_txt = computed(() => { lam_quad_regular: discountValue * lamelles_block * lam_count * lamelle_height.value * length_m, lam_quad_extra: discountValue * lamelles_block * lam_count * lamelle_height.value * extra_m, } + const isPattern = pillar_pattern.value !== 0; + const isTopper = pillar_topper.value !== 0; // console.log(prices) const extra = extra_section.value ? { pillar: !remove_pillar.value && { @@ -164,6 +170,24 @@ const total_txt = computed(() => { value: prices.lam_quad_regular * sections }, }; + const decor = {} as { [key: string]: { txt: string, value?: string } } + if ( + !remove_pillar.value + && ( + pillar_pattern.value !== 0 + || pillar_topper.value !== 0 + ) + ) { + const els = []; + if (isPattern) els.push('нанесения узоров на опорные столбы') + if (isTopper) els.push('индивидуального дизайна колпаков') + const txt = `Стоимость ${els.join(' и ')} рассчитывается отдельно.` + decor.el = { + txt: txt, + } + if (isPattern) decor.pattern = { txt: 'Узор опорного столба', value: getPatternName(pillar_pattern.value) } + if (isTopper) decor.topper = { txt: 'Колпак', value: getTopperName(pillar_topper.value) } + } const total = [extra, regular].map(item => Object.values(item).map(el => el ? el.value : 0)).flat().reduce((a, b) => a + b, 0) @@ -173,11 +197,18 @@ const total_txt = computed(() => { const res_extra = extra_section.value ? Object.values(extra).map(item => Object.entries(item).map(el => el[0] == 'value' ? roubleSign.format(el[1] as number) : el[1]).join(': ') ).filter(Boolean) : [] + const res_decor = Object.values(decor).map(item => + Object.entries(item).map(el => el[1]).join(': ') + ).filter(Boolean) - const res_total = [`Итого ${roubleSign.format(total)}`] + const total_str = [] + if (isPattern) total_str.push('узора') + if (isTopper) total_str.push('колпаков') + const res_total = [`Итого${total_str.length ? ' без ' + total_str.join(' и ') : ''}: ${roubleSign.format(total)}`] return { regular: res_regular, extra: res_extra, + decor: res_decor, total: res_total } }) @@ -243,8 +274,8 @@ const policy = () => { Цвет столба: {{ getColorNameFromRal(pillar_color) }}
Цвет ламелей: {{ getColorNameFromRal(lamelle_color) }}

-