diff --git a/assets/main.scss b/assets/main.scss index 8e73e53..e376409 100644 --- a/assets/main.scss +++ b/assets/main.scss @@ -348,11 +348,6 @@ button { &_color { @apply w-full; - - .color_picker, - .list_picker { - @apply ml-4; - } } input[type=range] { @@ -361,35 +356,15 @@ button { } } -.color_picker { +.picker { @apply leading-none; &-selected { @apply size-10 rounded border-gray-300 shadow inline-block leading-none; - - &__active { - @apply outline outline-2 outline-offset-2 outline-primary; - } } &-changer { - @apply absolute w-80 z-20 p-4 border rounded bg-white flex gap-0 right-0; - } -} - -.list_picker { - @apply leading-none; - - &-selected { - @apply size-10 rounded border-gray-300 shadow inline-block leading-none; - - &__active { - @apply outline outline-2 outline-offset-2 outline-primary; - } - } - - &-changer { - @apply absolute w-80 z-20 p-4 border rounded bg-white flex gap-0 right-0; + @apply flex gap-0; } &-list { diff --git a/components/calc/models.vue b/components/calc/models.vue index 30b45b2..0013532 100644 --- a/components/calc/models.vue +++ b/components/calc/models.vue @@ -4,7 +4,6 @@ import { Stats, OrbitControls } from '@tresjs/cientos' import { degToRad } from 'three/src/math/MathUtils.js'; const section_count = use_section_count() -const extra_section = use_extra_section() const fence_section = use_fence_section() const defDistance = 3 @@ -26,7 +25,7 @@ const cameraStat = reactive({ const camera = ref("camera") -watch(fence_section, ()=>{ +watch(fence_section, () => { let v = fence_section.value * 2; if (v <= defDistance) v = defDistance controlsState.minDistance = v; @@ -47,12 +46,14 @@ watch(fence_section, ()=>{ + + + - diff --git a/components/calc/values.vue b/components/calc/values.vue index ad27f40..d9a8f6b 100644 --- a/components/calc/values.vue +++ b/components/calc/values.vue @@ -3,7 +3,8 @@ import { getColorHexFromRal, getColorNameFromRal } from '@/components/ral' import type { ralTypes } from '@/components/ral' import { predefLamelleColors, predefPillarColors } from '~/composables/useCalc'; -import type { patternTypes } from '../pattern'; +import { getFilename, type patternTypes } from '../pattern'; +import { Vector3 } from 'three'; const lamelle_height = use_lamelle_height() const lamelles_count = use_lamelles_count() @@ -16,6 +17,8 @@ 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() +const open_calc = use_open_calc() if (!pillar_color.value) { const r = Math.floor(Math.random() * predefPillarColors.length) @@ -144,7 +147,7 @@ const setPillarColor = (color: ralTypes) => { 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 }) @@ -180,6 +183,12 @@ const calc_table = computed(() => { }, ] }) + +watch(open_calc, () => { + if (Object.keys(open_calc.value).length == 0) { + goto_cam.value = new Vector3(1, 1, 1) + } +}) - \ No newline at end of file + + \ No newline at end of file diff --git a/components/dropdown/colorPicker.vue b/components/dropdown/colorPicker.vue index ded7759..4056e3b 100644 --- a/components/dropdown/colorPicker.vue +++ b/components/dropdown/colorPicker.vue @@ -1,48 +1,13 @@ + \ No newline at end of file diff --git a/components/dropdown/list.vue b/components/dropdown/list.vue index 5a06f48..0032bb1 100644 --- a/components/dropdown/list.vue +++ b/components/dropdown/list.vue @@ -1,49 +1,12 @@ \ No newline at end of file diff --git a/components/dropdown/picker.vue b/components/dropdown/picker.vue new file mode 100644 index 0000000..424d611 --- /dev/null +++ b/components/dropdown/picker.vue @@ -0,0 +1,74 @@ + + + \ No newline at end of file diff --git a/components/model/camera.vue b/components/model/camera.vue new file mode 100644 index 0000000..8a5c7c9 --- /dev/null +++ b/components/model/camera.vue @@ -0,0 +1,50 @@ + + diff --git a/components/model/parametric.vue b/components/model/parametric.vue index 6aa58f6..1336584 100644 --- a/components/model/parametric.vue +++ b/components/model/parametric.vue @@ -4,16 +4,12 @@ import { CineonToneMapping, Mesh, Object3D, - Vector3, - EquirectangularReflectionMapping, - Euler, PMREMGenerator, } from 'three'; import { GainMapLoader, } from '@monogrid/gainmap-js' //@ts-ignore import { useGLTF, } from '@tresjs/cientos' import { getColorHexFromRal, type ralTypes } from '../ral'; -import { getFilename } from '../pattern'; const pillar_color = use_pillar_color() const pillar_pattern = use_pattern() @@ -65,7 +61,7 @@ set_material(lamelle.value, getColorHexFromRal(lamelle_color.value)); [top, fastening, fence, fence_bottom, fence_top].map( (el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value)) }); [fence_inner].map( - (el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value), lamelle_count.value) }); + (el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value)) }); const { seek, seekAll } = useSeek() watch(lamelle_color, () => { @@ -136,8 +132,12 @@ watch(() => [section_count.value, extra_section.value], () => { watch(lamelle_count, () => { [fence_inner].map( - (el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value), lamelle_count.value) }); - camera.value?.lookAt(10, 10, 10) + (el: Ref) => { set_material(el.value, getColorHexFromRal(pillar_color.value), + { + pattern: pillar_pattern.value, + count: lamelle_count.value + } + ) }); }) const pmremGenerator = new PMREMGenerator(renderer.value); pmremGenerator.compileEquirectangularShader(); diff --git a/components/pattern.ts b/components/pattern.ts index e8b19ef..43974c7 100644 --- a/components/pattern.ts +++ b/components/pattern.ts @@ -1,7 +1,7 @@ export const patterns = [ { name: 'Без узора', }, { name: 'Узор 1', filename: 'tile1.png' }, - { name: 'Еще раз узор 1', filename: 'tile1.png' }, + { name: 'А это узор 2', filename: 'tile2.jpg' }, ] export const getFilename = (name: patternTypes) => { const el = patterns.find(el => el.name == name) diff --git a/composables/useCalc.ts b/composables/useCalc.ts index 22ef575..a2aaa39 100644 --- a/composables/useCalc.ts +++ b/composables/useCalc.ts @@ -1,4 +1,5 @@ import type { ralTypes } from '@/components/ral' +import { Vector3 } from 'three' import { type patternTypes } from '~/components/pattern' export const predefPillarColors = ['3004', '7043', '6028', '5013', '8016', '1020', '3005', '4009'] @@ -19,4 +20,7 @@ export const use_extra_section = () => useState('extra_section', () => 0) 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('max_size', () => 20) -export const use_explosion_state = () => useState('explosion_state', () => false) \ No newline at end of file +export const use_explosion_state = () => useState('explosion_state', () => false) + +export const use_goto_camera = () => useState('gotocam', () => undefined) +export const use_open_calc = () => useState('open_calc', () => []) \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts index eb555f3..e6328bf 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,6 +1,7 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ + devtools: { enabled: false }, hooks: {}, app: { pageTransition: { name: 'page', mode: 'out-in' }, diff --git a/public/fence_one/bottom.glb b/public/fence_one/bottom.glb index 14c14e8..bb714af 100644 Binary files a/public/fence_one/bottom.glb and b/public/fence_one/bottom.glb differ diff --git a/public/fence_one/top.glb b/public/fence_one/top.glb index a9a456a..3accdf5 100644 Binary files a/public/fence_one/top.glb and b/public/fence_one/top.glb differ diff --git a/public/pattern/tile2.jpg b/public/pattern/tile2.jpg new file mode 100644 index 0000000..8671d3e Binary files /dev/null and b/public/pattern/tile2.jpg differ