From 1e14b9dc953ec3e80d20c01cfa8dab9cde18a92f Mon Sep 17 00:00:00 2001 From: aarizona Date: Tue, 24 Sep 2024 20:54:32 +0300 Subject: [PATCH] color picker ref --- assets/main.scss | 29 +----------- components/calc/models.vue | 7 +-- components/calc/values.vue | 28 ++++++----- components/dropdown/colorPicker.vue | 62 +++--------------------- components/dropdown/list.vue | 56 +++------------------- components/dropdown/picker.vue | 73 +++++++++++++++++++++++++++++ components/model/camera.vue | 50 ++++++++++++++++++++ composables/useCalc.ts | 3 +- nuxt.config.ts | 1 + 9 files changed, 161 insertions(+), 148 deletions(-) create mode 100644 components/dropdown/picker.vue create mode 100644 components/model/camera.vue diff --git a/assets/main.scss b/assets/main.scss index 4c78cfb..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 475bab2..02ac212 100644 --- a/components/calc/values.vue +++ b/components/calc/values.vue @@ -139,12 +139,10 @@ 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' } @@ -225,43 +223,48 @@ const calc_table = computed(() => { + +
- + - +
- + - +
- + - + backgroundImage: `url(${getFilename(pillar_pattern)})` + }" /> +
+ {{ goto_cam }}
\ No newline at end of file diff --git a/components/dropdown/list.vue b/components/dropdown/list.vue index 45ccd12..0032bb1 100644 --- a/components/dropdown/list.vue +++ b/components/dropdown/list.vue @@ -1,56 +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..998f3d7 --- /dev/null +++ b/components/dropdown/picker.vue @@ -0,0 +1,73 @@ + + + \ 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/composables/useCalc.ts b/composables/useCalc.ts index c8ad9b7..a2aaa39 100644 --- a/composables/useCalc.ts +++ b/composables/useCalc.ts @@ -22,4 +22,5 @@ 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) -export const use_goto_camera = () => useState('gotocam', () => undefined) \ No newline at end of file +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' },