@abi-software/scaffoldvuer 0.3.0 → 0.3.2-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,272 @@
1
+ <template>
2
+ <el-container v-show="settings.length > 0" class="t-slides-container">
3
+ <el-header height="30px" class="header">
4
+ <div>Texture Slides Settings</div>
5
+ </el-header>
6
+ <el-main class="block">
7
+ <el-row v-for="(slide, index) in settings" :key="slide.id">
8
+ <el-col :offset="0" :span="2">
9
+ <el-select
10
+ :popper-append-to-body="false"
11
+ :value="slide.direction"
12
+ placeholder="Select"
13
+ class="input-box"
14
+ popper-class="viewer_dropdown"
15
+ @change="modifyDirection($event, slide)"
16
+ >
17
+ <el-option
18
+ v-for="item in directions"
19
+ :key="item.value"
20
+ :label="item.label"
21
+ :value="item.value"
22
+ />
23
+ </el-select>
24
+ </el-col>
25
+ <el-col :offset="0" :span="14">
26
+ <el-slider
27
+ v-model="slide.value"
28
+ class="my-slider"
29
+ :step="0.01"
30
+ :min="0"
31
+ :max="1"
32
+ :show-tooltip="false"
33
+ @input="modifySlide(slide)"
34
+ />
35
+ </el-col>
36
+ <el-col :offset="0" :span="3">
37
+ <el-input-number
38
+ v-model="slide.value"
39
+ :step="0.01"
40
+ :min="0"
41
+ :max="1"
42
+ :controls="false"
43
+ class="input-box number-input"
44
+ />
45
+ </el-col>
46
+ <el-col :offset="2" :span="2">
47
+ <i
48
+ class="el-icon-close close-icon"
49
+ @click="removeSlide(index, slide)"
50
+ />
51
+ </el-col>
52
+ </el-row>
53
+ </el-main>
54
+ <el-footer height="30px" class="add-slides-text" @click.native="addNewSlide">
55
+ <el-row>
56
+ <el-col :span="2">
57
+ <i class="el-icon-plus" />
58
+ </el-col>
59
+ <el-col :span="10"> Add a new slide </el-col>
60
+ </el-row>
61
+ </el-footer>
62
+ </el-container>
63
+ </template>
64
+
65
+ <script>
66
+ /* eslint-disable no-alert, no-console */
67
+ import Vue from "vue";
68
+ import {
69
+ Col,
70
+ Container,
71
+ Footer,
72
+ Header,
73
+ Icon,
74
+ InputNumber,
75
+ Main,
76
+ Row,
77
+ Slider,
78
+ } from "element-ui";
79
+ import lang from "element-ui/lib/locale/lang/en";
80
+ import locale from "element-ui/lib/locale";
81
+
82
+ locale.use(lang);
83
+ Vue.use(Col);
84
+ Vue.use(Container);
85
+ Vue.use(Footer);
86
+ Vue.use(Header);
87
+ Vue.use(Icon);
88
+ Vue.use(InputNumber);
89
+ Vue.use(Main);
90
+ Vue.use(Slider);
91
+ Vue.use(Row);
92
+
93
+ /**
94
+ * A component to control the opacity of the target object.
95
+ */
96
+ export default {
97
+ name: "TextureSlidesControls",
98
+ data: function () {
99
+ return {
100
+ settings: [],
101
+ directions: [
102
+ {
103
+ value: "x",
104
+ label: "x",
105
+ },
106
+ {
107
+ value: "y",
108
+ label: "y",
109
+ },
110
+ {
111
+ value: "z",
112
+ label: "z",
113
+ },
114
+ ],
115
+ };
116
+ },
117
+ watch: {
118
+ settings: function () {
119
+ if (this.material && this._zincObject) {
120
+ this._zincObject.setAlpha(this.material.opacity);
121
+ }
122
+ },
123
+ },
124
+ mounted: function () {
125
+ this._zincObject = undefined;
126
+ },
127
+ methods: {
128
+ setObject: function (object) {
129
+ if (object.isTextureSlides) {
130
+ this._zincObject = object;
131
+ this.settings = this._zincObject.getTextureSettings();
132
+ } else {
133
+ this._zincObject = undefined;
134
+ this.settings = [];
135
+ }
136
+ },
137
+ addNewSlide: function () {
138
+ const newSettings = { direction: "x", value: 0 };
139
+ const returnSettings = this._zincObject.createSlide(newSettings);
140
+ this.settings.push(returnSettings);
141
+ },
142
+ modifyDirection: function(direction, slide) {
143
+ if (slide) {
144
+ slide.direction = direction;
145
+ this._zincObject.modifySlideSettings(slide);
146
+ }
147
+ },
148
+ modifySlide: function (slide) {
149
+ if (slide) {
150
+ this._zincObject.modifySlideSettings(slide);
151
+ }
152
+ },
153
+ removeSlide: function (index, slide) {
154
+ this._zincObject.removeSlideWithId(slide.id);
155
+ this.settings.splice(index, 1);
156
+ },
157
+ },
158
+ };
159
+ </script>
160
+
161
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
162
+ <style scoped lang="scss">
163
+ @import "~element-ui/packages/theme-chalk/src/col";
164
+ @import "~element-ui/packages/theme-chalk/src/container";
165
+ @import "~element-ui/packages/theme-chalk/src/input-number";
166
+ @import "~element-ui/packages/theme-chalk/src/slider";
167
+ @import "~element-ui/packages/theme-chalk/src/row";
168
+
169
+ .header {
170
+ color: #606266;
171
+ line-height: 1;
172
+ padding: 8px 17px 1px 15px;
173
+ border-bottom: 1px solid #ebeef5;
174
+ font-size: 14px;
175
+ }
176
+
177
+ .add-slides-text {
178
+ color: $app-primary-color;
179
+ line-height: 1;
180
+ padding: 9px 17px 9px 15px;
181
+ border-top: 1px solid #ebeef5;
182
+ font-size: 12px;
183
+ cursor: pointer;
184
+ pointer-events: auto;
185
+ }
186
+
187
+ .display {
188
+ width: 44px;
189
+ }
190
+
191
+ .block {
192
+ pointer-events: auto;
193
+ &.el-main {
194
+ padding: 5px;
195
+ &::-webkit-scrollbar {
196
+ width: 10px;
197
+ }
198
+
199
+ &::-webkit-scrollbar-thumb {
200
+ border-radius: 10px;
201
+ box-shadow: inset 0 0 6px #c0c4cc;
202
+ }
203
+ }
204
+ }
205
+
206
+ .my-slider {
207
+ width: 109px;
208
+ top: -6px;
209
+ left: 50px;
210
+ position: relative;
211
+ }
212
+
213
+ .t-slides-container {
214
+ width: 300px;
215
+ height: 250px;
216
+ border-radius: 4px;
217
+ border: solid 1px #d8dce6;
218
+ background-color: #fff;
219
+ overflow-y: none;
220
+ }
221
+
222
+ ::v-deep .el-slider__bar {
223
+ background-color: $app-primary-color;
224
+ }
225
+
226
+ .input-box {
227
+ width: 42px;
228
+ border-radius: 4px;
229
+ border: 1px solid rgb(144, 147, 153);
230
+ background-color: var(--white);
231
+ font-weight: 500;
232
+ color: rgb(48, 49, 51);
233
+ margin-left: 8px;
234
+
235
+ &.number-input {
236
+ width: 42px;
237
+ ::v-deep .el-input__inner {
238
+ padding-left: 0px;
239
+ padding-right: 0px;
240
+ }
241
+ }
242
+
243
+ ::v-deep .el-input__inner {
244
+ color: $app-primary-color;
245
+ height: 22px;
246
+ padding-left: 8px;
247
+ padding-right: 8px;
248
+ border: none;
249
+ font-family: "Asap", sans-serif;
250
+ line-height: 22px;
251
+ }
252
+
253
+ ::v-deep .el-input,
254
+ ::v-deep .el-input__icon {
255
+ line-height: 22px;
256
+ }
257
+
258
+ .viewer_dropdown .el-select-dropdown__item {
259
+ white-space: nowrap;
260
+ color: $app-primary-color;
261
+ text-align: left;
262
+ font-family: "Asap", sans-serif;
263
+ }
264
+ }
265
+
266
+ .close-icon {
267
+ color: $app-primary-color;
268
+ top: 2px;
269
+ position: relative;
270
+ cursor: pointer;
271
+ }
272
+ </style>
@@ -44,6 +44,9 @@
44
44
  @change="setColour(data, $event)"
45
45
  />
46
46
  <span>{{ node.label }}</span>
47
+ <span v-if="data.isTextureSlides" class="node-options">
48
+ (Texture)
49
+ </span>
47
50
  </span>
48
51
  </el-tree>
49
52
  </div>
@@ -205,6 +208,7 @@ export default {
205
208
  id: region.uuid + "/" + zincObject.uuid,
206
209
  isPrimitives: true,
207
210
  regionPath: zincObject.region.getFullPath(),
211
+ isTextureSlides: zincObject.isTextureSlides ? true : false,
208
212
  };
209
213
  this.addTreeItem(regionData.children, child);
210
214
  }
@@ -682,6 +686,10 @@ export default {
682
686
  }
683
687
  }
684
688
 
689
+ .node-options {
690
+ text-align: right;
691
+ }
692
+
685
693
  .drawer-button.open i {
686
694
  transform: rotate(0deg) scaleY(2.5);
687
695
  }
@@ -144,9 +144,9 @@ RendererModule.prototype.objectsToZincObjects = function(objects) {
144
144
  let glyphset = zincObject;
145
145
  if (zincObject.isGlyph)
146
146
  glyphset = zincObject.getGlyphset();
147
- zincObjects. push(glyphset);
147
+ zincObjects.push(glyphset);
148
148
  } else {
149
- zincObjects. push(zincObject);
149
+ zincObjects.push(zincObject);
150
150
  }
151
151
  }
152
152
  }