@abi-software/scaffoldvuer 0.1.2 → 0.1.5-1.beta.1

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,222 @@
1
+ <template>
2
+ <div
3
+ v-if="material!=undefined"
4
+ ref="control"
5
+ class="opacity-control"
6
+ >
7
+ <el-drawer
8
+ custom-class="my-drawer"
9
+ class="drawer-content"
10
+ :visible.sync="drawerOpen"
11
+ :append-to-body="false"
12
+ :modal-append-to-body="false"
13
+ size="300"
14
+ :with-header="false"
15
+ :wrapper-closable="false"
16
+ :modal="false"
17
+ >
18
+ <div
19
+ v-if="drawerOpen"
20
+ class="tab-button close"
21
+ @click="toggleDrawer"
22
+ >
23
+ <i class="el-icon-arrow-right" />
24
+ </div>
25
+ <el-container class="opacity-container">
26
+ <el-header
27
+ height="37px"
28
+ class="header"
29
+ >
30
+ <div>Opacity</div>
31
+ </el-header>
32
+ <el-main class="main">
33
+ <div class="block">
34
+ <span class="display">{{ displayString }}</span>
35
+ <el-slider
36
+ v-model="material.opacity"
37
+ class="my-slider"
38
+ :step="0.01"
39
+ :min="0"
40
+ :max="1"
41
+ :format-tooltip="formatTooltip"
42
+ :show-tooltip="false"
43
+ />
44
+ </div>
45
+ </el-main>
46
+ </el-container>
47
+ </el-drawer>
48
+ <div
49
+ v-if="!drawerOpen"
50
+ class="tab-button open"
51
+ @click="toggleDrawer"
52
+ >
53
+ <i class="el-icon-arrow-left" />
54
+ </div>
55
+ </div>
56
+ </template>
57
+
58
+ <script>
59
+ /* eslint-disable no-alert, no-console */
60
+ import Vue from "vue";
61
+ import { Container, Drawer, Header, Icon, Main, Slider } from "element-ui";
62
+ import lang from "element-ui/lib/locale/lang/en";
63
+ import locale from "element-ui/lib/locale";
64
+
65
+ locale.use(lang);
66
+ Vue.use(Container);
67
+ Vue.use(Drawer);
68
+ Vue.use(Header);
69
+ Vue.use(Icon);
70
+ Vue.use(Main);
71
+ Vue.use(Slider);
72
+
73
+ /**
74
+ * A component to control the opacity of the target object.
75
+ */
76
+ export default {
77
+ name: "OpacityControls",
78
+ data: function() {
79
+ return {
80
+ displayString: "100%",
81
+ material: undefined,
82
+ drawerOpen: true
83
+ };
84
+ },
85
+ watch: {
86
+ "material.opacity": function() {
87
+ if (this.material) {
88
+ this._zincobject.setAlpha(this.material.opacity);
89
+ }
90
+ }
91
+ },
92
+ mounted: function() {
93
+ this._zincobject = undefined;
94
+ },
95
+ methods: {
96
+ formatTooltip(val) {
97
+ this.displayString = Math.floor(100 * val + 0.5) + "%";
98
+ return this.displayString;
99
+ },
100
+ toggleDrawer: function() {
101
+ this.drawerOpen = !this.drawerOpen;
102
+ },
103
+ setObject(object) {
104
+ if (object) this.material = object.morph.material;
105
+ else this.material = undefined;
106
+ this._zincobject = object;
107
+ }
108
+ }
109
+ };
110
+ </script>
111
+
112
+ <!-- Add "scoped" attribute to limit CSS to this component only -->
113
+ <style scoped lang="scss">
114
+ @import "~element-ui/packages/theme-chalk/src/container";
115
+ @import "~element-ui/packages/theme-chalk/src/drawer";
116
+ @import "~element-ui/packages/theme-chalk/src/slider";
117
+
118
+ .opacity-control {
119
+ text-align: left;
120
+ width:300px;
121
+ }
122
+
123
+ .header {
124
+ color: #606266;
125
+ line-height: 1;
126
+ padding: 9px 17px 0 15px;
127
+ border-bottom: 1px solid #ebeef5;
128
+ font-size: 14px;
129
+ }
130
+
131
+ .display {
132
+ width: 44px;
133
+ }
134
+
135
+ .icon {
136
+ right: 17px;
137
+ position: absolute;
138
+ top: 10px;
139
+ }
140
+
141
+ .main {
142
+ font-size: 13px;
143
+ padding: 20px 17px 0 15px;
144
+ }
145
+
146
+ .block {
147
+ left: 40px;
148
+ position: absolute;
149
+ top: 57px;
150
+ width: 200px;
151
+ }
152
+
153
+ .my-slider {
154
+ position: absolute;
155
+ width: 109px;
156
+ top: -12px;
157
+ left: 50px;
158
+ pointer-events: auto;
159
+ }
160
+
161
+ .opacity-container {
162
+ width: 224px;
163
+ height: 93px;
164
+ border-radius: 4px;
165
+ border: solid 1px #d8dce6;
166
+ background-color: #fff;
167
+ }
168
+
169
+ ::v-deep .el-slider__bar {
170
+ background-color: $app-primary-color;
171
+ }
172
+
173
+ .drawer-content {
174
+ position: relative;
175
+ height: 93px;
176
+ pointer-events: none;
177
+ }
178
+
179
+ ::v-deep .my-drawer {
180
+ background: rgba(0, 0, 0, 0);
181
+ box-shadow: none;
182
+ }
183
+
184
+ ::v-deep .my-drawer .el-drawer__body {
185
+ height: 93px;
186
+ }
187
+
188
+ .tab-button {
189
+ width: 20px;
190
+ height: 40px;
191
+ z-index: 8;
192
+ right: 0px;
193
+
194
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
195
+ border: solid 1px #e4e7ed;
196
+ background-color: #FFFFFF;
197
+ text-align: center;
198
+ vertical-align: middle;
199
+ cursor: pointer;
200
+ pointer-events: auto;
201
+ //transition: bottom 0.3s;
202
+
203
+ &.close {
204
+ float: left;
205
+ flex: 1;
206
+ border-right: 0;
207
+ margin-top: 26px;
208
+ }
209
+
210
+ &.open {
211
+ position: absolute;
212
+ bottom:26px;
213
+ }
214
+
215
+ i {
216
+ margin-top: 12px;
217
+ color: $app-primary-color;
218
+ transform: scaleY(2.5);
219
+ }
220
+ }
221
+
222
+ </style>
@@ -0,0 +1,44 @@
1
+ ScaffoldVuer demo:
2
+ ```vue
3
+ <template>
4
+ <div class="wrapper">
5
+ <ScaffoldVuer class="vuer"
6
+ :url="url"
7
+ :helpMode="helpMode"
8
+ :displayMarkers="displayMarkers"
9
+ :displayMinimap="displayMinimap"
10
+ :minimapSettings="minimapSettings" />
11
+ </div>
12
+ </template>
13
+
14
+ <script>
15
+ export default {
16
+ data: function() {
17
+ return {
18
+ url: "https://mapcore-bucket1.s3-us-west-2.amazonaws.com/others/29_Jan_2020/heartICN_metadata.json",
19
+ helpMode: false,
20
+ displayMarkers: true,
21
+ displayMinimap: false,
22
+ minimapSettings: {
23
+ x_offset: 16,
24
+ y_offset: 16,
25
+ width: 128,
26
+ height: 128,
27
+ align: "bottom-right"
28
+ },
29
+ };
30
+ }
31
+ }
32
+ </script>
33
+
34
+ <style scoped>
35
+ .wrapper {
36
+ height:600px;
37
+ }
38
+ .vuer {
39
+ width:100%;
40
+ height:600px;
41
+ }
42
+ </style>
43
+ ```
44
+