@qispace/vue3-player 0.0.5
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.
- package/README.md +18 -0
- package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts +4 -0
- package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts.map +1 -0
- package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts +4 -0
- package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts.map +1 -0
- package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts +4 -0
- package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts.map +1 -0
- package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts +4 -0
- package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts.map +1 -0
- package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts +4 -0
- package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts +3 -0
- package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts +4 -0
- package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts +4 -0
- package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts +4 -0
- package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts +5 -0
- package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts.map +1 -0
- package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts +4 -0
- package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/shared/QiFloatingCard.vue.d.ts +4 -0
- package/dist/components/shared/QiFloatingCard.vue.d.ts.map +1 -0
- package/dist/components/shared/QiHoverProbe.vue.d.ts +4 -0
- package/dist/components/shared/QiHoverProbe.vue.d.ts.map +1 -0
- package/dist/components/shared/QiNorthDirection.vue.d.ts +3 -0
- package/dist/components/shared/QiNorthDirection.vue.d.ts.map +1 -0
- package/dist/components/shared/QiZoomBox.vue.d.ts +4 -0
- package/dist/components/shared/QiZoomBox.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/Disclaimer.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/Disclaimer.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts +3 -0
- package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/ManualSlideShow.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/ManualSlideShow.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/ManualSlideShowPlayer.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/ManualSlideShowPlayer.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/SingleImage.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/SingleImage.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/SocialShare.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/SocialShare.vue.d.ts.map +1 -0
- package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts +4 -0
- package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts.map +1 -0
- package/dist/lib/virtualTour__/ApartmentConfig.d.ts +27 -0
- package/dist/lib/virtualTour__/ApartmentFiles.d.ts +7 -0
- package/dist/lib/virtualTour__/MinimapConfig.d.ts +23 -0
- package/dist/lib/virtualTour__/impl/HttpApartmentFiles.d.ts +19 -0
- package/dist/vue3-player.cjs.js +2 -0
- package/dist/vue3-player.esm.js +2992 -0
- package/dist/vue3-player.iife.js +3 -0
- package/dist/vue3-player.umd.js +3 -0
- package/package.json +65 -0
- package/src/components/apartmentChooser/QiApartmentChooser.vue +319 -0
- package/src/components/apartmentChooser/QiApartmentChooserNavigation.vue +88 -0
- package/src/components/apartmentChooser/QiApartmentChooserRaster.vue +408 -0
- package/src/components/apartmentChooser/QiApartmentChooserRotator.vue +202 -0
- package/src/components/apartmentChooser/QiApartmentChooserSvg.vue +257 -0
- package/src/components/apartmentChooser/index.js +5 -0
- package/src/components/buildingPicker/QiBuildingChooser.vue +61 -0
- package/src/components/buildingPicker/QiBuildingChooserRaster.vue +312 -0
- package/src/components/buildingPicker/QiBuildingChooserRasterOverlay.vue +96 -0
- package/src/components/buildingPicker/QiBuildingChooserSceneImageStack.vue +89 -0
- package/src/components/buildingPicker/QiBuildingChooserSunSimControl.vue +257 -0
- package/src/components/buildingPicker/QiBuildingChooserSvg.vue +414 -0
- package/src/components/buildingPicker/index.js +6 -0
- package/src/components/index.ts +4 -0
- package/src/components/shared/QiFloatingCard.vue +76 -0
- package/src/components/shared/QiHoverProbe.vue +22 -0
- package/src/components/shared/QiNorthDirection.vue +27 -0
- package/src/components/shared/QiZoomBox.vue +322 -0
- package/src/components/shared/index.js +4 -0
- package/src/components/virtualTourV2/Compass.vue +37 -0
- package/src/components/virtualTourV2/Disclaimer.vue +41 -0
- package/src/components/virtualTourV2/FloorLevel.vue +73 -0
- package/src/components/virtualTourV2/FullScreenButton.vue +23 -0
- package/src/components/virtualTourV2/InteriorSelector.vue +90 -0
- package/src/components/virtualTourV2/ManualSlideShow.vue +198 -0
- package/src/components/virtualTourV2/ManualSlideShowPlayer.vue +159 -0
- package/src/components/virtualTourV2/PlayerV2.vue +300 -0
- package/src/components/virtualTourV2/ScrollHelper.vue +74 -0
- package/src/components/virtualTourV2/SettingsUI.vue +355 -0
- package/src/components/virtualTourV2/SingleImage.vue +36 -0
- package/src/components/virtualTourV2/SocialShare.vue +163 -0
- package/src/components/virtualTourV2/TimeOfDay.vue +50 -0
- package/src/components/virtualTourV2/Tutorial.vue +690 -0
- package/src/components/virtualTourV2/ViewModeToggle.vue +24 -0
- package/src/components/virtualTourV2/VirtualTourV2.vue +876 -0
- package/src/components/virtualTourV2/WaypointCarousel.vue +162 -0
- package/src/components/virtualTourV2/index.js +1 -0
- package/src/components/virtualTourV2/minimapv2/MiniMapMap.vue +262 -0
- package/src/components/virtualTourV2/minimapv2/MiniMapV2.vue +110 -0
- package/src/components/virtualTourV2/minimapv2/MinimapCompass.vue +39 -0
- package/src/components/virtualTourV2/minimapv2/Moveable.vue +208 -0
- package/src/components/virtualTourV2/minimapv2/RotationMarkerV2.vue +79 -0
- package/src/components/virtualTourV2/minimapv2/SunsimulationSlider.vue +203 -0
- package/src/components/virtualTourV2/minimapv2/index.js +1 -0
- package/src/entry.esm.js +17 -0
- package/src/entry.js +13 -0
- package/src/entry.ts_ +17 -0
- package/src/lib/apartmentChooser/BuildingViewerModel.js +60 -0
- package/src/lib/apartmentChooser/CircularSlideshow.js +66 -0
- package/src/lib/apartmentChooser/RotationStep.js +31 -0
- package/src/lib/apartmentChooser/SceneRotator.js +25 -0
- package/src/lib/apartmentChooser/index.js +3 -0
- package/src/lib/apartmentChooser/throttle.js +15 -0
- package/src/lib/buildingPicker/BuildingMap.js +24 -0
- package/src/lib/buildingPicker/BuildingPickerResourceProvider.js +97 -0
- package/src/lib/buildingPicker/CanvasRaster.js +29 -0
- package/src/lib/buildingPicker/DayOfYearSelector.js +36 -0
- package/src/lib/buildingPicker/SampleRaster.js +14 -0
- package/src/lib/buildingPicker/index.js +5 -0
- package/src/lib/index.js +4 -0
- package/src/lib/shared/BatchLoadTracker.js +52 -0
- package/src/lib/shared/I18N.js +65 -0
- package/src/lib/shared/ResourceLoader.js +33 -0
- package/src/lib/shared/index.js +3 -0
- package/src/lib/virtualTour/CameraSnapshot.js +42 -0
- package/src/lib/virtualTour/FullscreenModel.js +69 -0
- package/src/lib/virtualTour/textures/arrow.png +0 -0
- package/src/lib/virtualTour/textures/compass-bg.png +0 -0
- package/src/lib/virtualTour/textures/compass-needle.png +0 -0
- package/src/lib/virtualTour/textures/compass-north.png +0 -0
- package/src/lib/virtualTour/textures/floor-1.svg +4 -0
- package/src/lib/virtualTour/textures/floor-2.svg +4 -0
- package/src/lib/virtualTour/textures/marker.png +0 -0
- package/src/lib/virtualTour/textures/tod-sun.png +0 -0
- package/src/lib/virtualTour__/ApartmentConfig.ts +80 -0
- package/src/lib/virtualTour__/ApartmentFiles.ts +8 -0
- package/src/lib/virtualTour__/CameraNavigator.js_ +74 -0
- package/src/lib/virtualTour__/CameraSnapshot.js +42 -0
- package/src/lib/virtualTour__/CoordConversions.js +43 -0
- package/src/lib/virtualTour__/FullscreenModel.js +69 -0
- package/src/lib/virtualTour__/MinimapConfig.ts +46 -0
- package/src/lib/virtualTour__/PlayerViewModel.js +423 -0
- package/src/lib/virtualTour__/config/ApartmentConfig.js +92 -0
- package/src/lib/virtualTour__/config/CameraConfig.js +97 -0
- package/src/lib/virtualTour__/config/Interaction.js +393 -0
- package/src/lib/virtualTour__/config/Panorama.js +78 -0
- package/src/lib/virtualTour__/config/PlayerConfig.js +812 -0
- package/src/lib/virtualTour__/config/rawinflate.export.js +833 -0
- package/src/lib/virtualTour__/config/shaders.js +24 -0
- package/src/lib/virtualTour__/impl/HttpApartmentFiles.ts +57 -0
- package/src/lib/virtualTour__/index.js +1 -0
- package/src/lib/virtualTour__/textures/arrow.png +0 -0
- package/src/lib/virtualTour__/textures/compass-bg.png +0 -0
- package/src/lib/virtualTour__/textures/compass-needle.png +0 -0
- package/src/lib/virtualTour__/textures/compass-north.png +0 -0
- package/src/lib/virtualTour__/textures/floor-1.svg +4 -0
- package/src/lib/virtualTour__/textures/floor-2.svg +4 -0
- package/src/lib/virtualTour__/textures/marker.png +0 -0
- package/src/lib/virtualTour__/textures/tod-sun.png +0 -0
- package/src/main.ts_ +24 -0
- package/src/shims-png.d.ts +4 -0
- package/src/shims-tsx.d.ts +11 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/style.css +0 -0
- package/src/vite-env.d.ts +5 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
id="moveableDiv"
|
|
4
|
+
class="big d-flex justify-space-between flex-column align-center sizer"
|
|
5
|
+
:class="currentSize"
|
|
6
|
+
>
|
|
7
|
+
<v-btn
|
|
8
|
+
class="close-icon"
|
|
9
|
+
icon="mdi-window-close"
|
|
10
|
+
size="x-small"
|
|
11
|
+
@click="$emit('close')"
|
|
12
|
+
>
|
|
13
|
+
</v-btn>
|
|
14
|
+
<v-btn
|
|
15
|
+
class="resize-icon"
|
|
16
|
+
icon="mdi-image-size-select-small"
|
|
17
|
+
size="x-small"
|
|
18
|
+
@click="toggleSize"
|
|
19
|
+
title="Resize"
|
|
20
|
+
>
|
|
21
|
+
</v-btn>
|
|
22
|
+
<v-btn
|
|
23
|
+
class="rotate-icon"
|
|
24
|
+
size="x-small"
|
|
25
|
+
icon="mdi mdi-rotate-right"
|
|
26
|
+
@click="$emit('transform')"
|
|
27
|
+
title="Rotate"
|
|
28
|
+
>
|
|
29
|
+
</v-btn>
|
|
30
|
+
|
|
31
|
+
<!-- just a filler div to center elements -->
|
|
32
|
+
<div id="filler-div"></div>
|
|
33
|
+
|
|
34
|
+
<div class="moveable-body" id="moveableDivheader">
|
|
35
|
+
<slot class="slot" name="body"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<div class="moveable-footer">
|
|
39
|
+
<slot name="footer"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
<script>
|
|
44
|
+
export default {
|
|
45
|
+
name: "Moveable",
|
|
46
|
+
emits: ["close"],
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
currentSize: "big",
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
mounted() {
|
|
53
|
+
configureDraggable(document.getElementById("moveableDiv"));
|
|
54
|
+
},
|
|
55
|
+
methods: {
|
|
56
|
+
toggleSize() {
|
|
57
|
+
if (this.currentSize === "big") {
|
|
58
|
+
this.currentSize = "small";
|
|
59
|
+
} else {
|
|
60
|
+
this.currentSize = "big";
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
function configureDraggable(box) {
|
|
67
|
+
const element = document.getElementById(box.id + "header");
|
|
68
|
+
if (!element) return;
|
|
69
|
+
|
|
70
|
+
var pos1 = 0,
|
|
71
|
+
pos2 = 0,
|
|
72
|
+
pos3 = 0,
|
|
73
|
+
pos4 = 0;
|
|
74
|
+
|
|
75
|
+
element.addEventListener("touchstart", dragStart, { passive: false });
|
|
76
|
+
element.addEventListener("touchend", dragEnd, { passive: false });
|
|
77
|
+
element.addEventListener("mousedown", dragStart, { passive: false });
|
|
78
|
+
element.addEventListener("mouseup", dragEnd, { passive: false });
|
|
79
|
+
|
|
80
|
+
function dragStart(e) {
|
|
81
|
+
e = e || window.event;
|
|
82
|
+
e.preventDefault();
|
|
83
|
+
let event = e;
|
|
84
|
+
if (e.type === "touchstart") {
|
|
85
|
+
event = e.touches[0];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
pos3 = event.clientX;
|
|
89
|
+
pos4 = event.clientY;
|
|
90
|
+
|
|
91
|
+
document.addEventListener("mouseup", dragEnd, { passive: false });
|
|
92
|
+
document.addEventListener("touchend", dragEnd, { passive: false });
|
|
93
|
+
|
|
94
|
+
document.addEventListener("mousemove", drag, { passive: false });
|
|
95
|
+
document.addEventListener("touchmove", drag, { passive: false });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function drag(e) {
|
|
99
|
+
e = e || window.event;
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
|
|
102
|
+
let event = e;
|
|
103
|
+
if (e.type === "touchmove") {
|
|
104
|
+
event = e.touches[0];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
pos1 = pos3 - event.clientX;
|
|
108
|
+
pos2 = pos4 - event.clientY;
|
|
109
|
+
pos3 = event.clientX;
|
|
110
|
+
pos4 = event.clientY;
|
|
111
|
+
|
|
112
|
+
box.style.top = box.offsetTop - pos2 + "px";
|
|
113
|
+
box.style.left = box.offsetLeft - pos1 + "px";
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function dragEnd() {
|
|
117
|
+
document.removeEventListener("mouseup", dragEnd, false);
|
|
118
|
+
document.removeEventListener("mousemove", drag, false);
|
|
119
|
+
document.removeEventListener("touchend", dragEnd, false);
|
|
120
|
+
document.removeEventListener("touchmove", drag, false);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
</script>
|
|
124
|
+
<style scoped>
|
|
125
|
+
#moveableDiv {
|
|
126
|
+
position: fixed;
|
|
127
|
+
z-index: 15;
|
|
128
|
+
background-color: #ffffff;
|
|
129
|
+
border: 1px solid #d3d3d3;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#moveableDivheader {
|
|
133
|
+
cursor: move;
|
|
134
|
+
z-index: 10;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.big {
|
|
138
|
+
width: 512px;
|
|
139
|
+
height: 440px;
|
|
140
|
+
top: 50%;
|
|
141
|
+
left: 50%;
|
|
142
|
+
transform: translate(-50%, -50%);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.small {
|
|
146
|
+
width: 250px;
|
|
147
|
+
height: 300px;
|
|
148
|
+
bottom: 10px;
|
|
149
|
+
right: 10px;
|
|
150
|
+
transform: translate(0%, 0%);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.sizer {
|
|
154
|
+
/* resize: both; */
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
min-width: 250px;
|
|
157
|
+
min-height: 300px;
|
|
158
|
+
max-width: 700px;
|
|
159
|
+
max-height: 531px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.resize-icon {
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: 5px;
|
|
165
|
+
right: 5px;
|
|
166
|
+
z-index: 11;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.rotate-icon {
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: 5px;
|
|
172
|
+
right: 45px;
|
|
173
|
+
z-index: 12;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.close-icon {
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 5px;
|
|
179
|
+
left: 5px;
|
|
180
|
+
z-index: 11;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.moveable-body {
|
|
184
|
+
z-index: 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.moveable-footer {
|
|
188
|
+
width: 100%;
|
|
189
|
+
height: 50px;
|
|
190
|
+
margin-bottom: 10px;
|
|
191
|
+
background: #fff;
|
|
192
|
+
z-index: 2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.filler-div {
|
|
196
|
+
display: none;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
@media only screen and (max-width: 600px) {
|
|
200
|
+
.sizer {
|
|
201
|
+
/* resize: both; */
|
|
202
|
+
overflow: hidden;
|
|
203
|
+
|
|
204
|
+
max-width: 90%;
|
|
205
|
+
max-height: 80vh;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg
|
|
3
|
+
class="rotation-marker-svg"
|
|
4
|
+
viewBox="0 0 40 40"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
>
|
|
7
|
+
<defs>
|
|
8
|
+
<radialGradient id="Gradient" cx="0" cy="0" r="0.9" fx="0" fy="0">
|
|
9
|
+
<stop offset="0%" class="stop1" />
|
|
10
|
+
<stop offset="60%" class="stop2" />
|
|
11
|
+
<stop offset="90%" class="stop3" />
|
|
12
|
+
</radialGradient>
|
|
13
|
+
|
|
14
|
+
<linearGradient id="LineGradient" gradientTransform="rotate(90)">
|
|
15
|
+
<stop offset="0%" class="stop1" />
|
|
16
|
+
<stop offset="75%" class="stop2" />
|
|
17
|
+
<stop offset="100%" class="stop3" />
|
|
18
|
+
</linearGradient>
|
|
19
|
+
</defs>
|
|
20
|
+
<g transform-origin="20 20" :transform="`rotate(${+45 + rotation})`">
|
|
21
|
+
<rect
|
|
22
|
+
id="field-of-view-gradient"
|
|
23
|
+
x="20"
|
|
24
|
+
y="20"
|
|
25
|
+
width="38"
|
|
26
|
+
height="38"
|
|
27
|
+
transform="rotate(0)"
|
|
28
|
+
transform-origin="20 20"
|
|
29
|
+
fill="url(#Gradient)"
|
|
30
|
+
/>
|
|
31
|
+
<rect
|
|
32
|
+
class="field-of-view-border"
|
|
33
|
+
x="20"
|
|
34
|
+
y="20"
|
|
35
|
+
width="1"
|
|
36
|
+
height="25"
|
|
37
|
+
fill="url(#LineGradient)"
|
|
38
|
+
transform="rotate(0)"
|
|
39
|
+
transform-origin="20 20"
|
|
40
|
+
/>
|
|
41
|
+
<rect
|
|
42
|
+
class="field-of-view-border"
|
|
43
|
+
x="19"
|
|
44
|
+
y="19"
|
|
45
|
+
width="1"
|
|
46
|
+
height="25"
|
|
47
|
+
fill="url(#LineGradient)"
|
|
48
|
+
transform="rotate(-90)"
|
|
49
|
+
transform-origin="20 20"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<circle cx="20" cy="20" r="5" fill="white" />
|
|
53
|
+
<circle cx="20" cy="20" r="3" fill="red" />
|
|
54
|
+
</g>
|
|
55
|
+
</svg>
|
|
56
|
+
</template>
|
|
57
|
+
|
|
58
|
+
<script>
|
|
59
|
+
export default {
|
|
60
|
+
props: {
|
|
61
|
+
rotation: {
|
|
62
|
+
type: Number,
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
}
|
|
67
|
+
</script>
|
|
68
|
+
<style>
|
|
69
|
+
.stop1 {
|
|
70
|
+
stop-color: white;
|
|
71
|
+
}
|
|
72
|
+
.stop2 {
|
|
73
|
+
stop-color: white;
|
|
74
|
+
stop-opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
.stop3 {
|
|
77
|
+
stop-color: transparent;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ss-wrapper">
|
|
3
|
+
<div class="slider">
|
|
4
|
+
<div class="minimap-sun-slider">
|
|
5
|
+
<v-progress-linear
|
|
6
|
+
v-if="imagesPreloading"
|
|
7
|
+
indeterminate
|
|
8
|
+
rounded
|
|
9
|
+
height="6"
|
|
10
|
+
color="grey lighten-1"
|
|
11
|
+
class="mr-2"
|
|
12
|
+
/>
|
|
13
|
+
<v-slider
|
|
14
|
+
v-else
|
|
15
|
+
v-model="hourMark"
|
|
16
|
+
:min="0"
|
|
17
|
+
:max="23"
|
|
18
|
+
:step="1"
|
|
19
|
+
color="#373737"
|
|
20
|
+
track-color="#373737"
|
|
21
|
+
thumb-color="#373737"
|
|
22
|
+
:hide-details="true"
|
|
23
|
+
>
|
|
24
|
+
<template v-slot:prepend>
|
|
25
|
+
<v-icon color="#ffab02">mdi-white-balance-sunny</v-icon>
|
|
26
|
+
</template>
|
|
27
|
+
</v-slider>
|
|
28
|
+
</div>
|
|
29
|
+
<div v-if="!imagesPreloading" class="time-label">
|
|
30
|
+
{{ timeString }} {{ hourMarkString }}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
export default {
|
|
38
|
+
name: "SunsimulationSlider",
|
|
39
|
+
emits: ["set-background-image"],
|
|
40
|
+
props: {
|
|
41
|
+
minimapJSON: { type: Array, required: true },
|
|
42
|
+
level: { type: Number, required: true },
|
|
43
|
+
root: { type: String, required: true },
|
|
44
|
+
},
|
|
45
|
+
inject: ["localMode", "fileLoader"],
|
|
46
|
+
data() {
|
|
47
|
+
return {
|
|
48
|
+
imageUrl: "",
|
|
49
|
+
imageHeight: 0,
|
|
50
|
+
hourMark: new Date().getHours(),
|
|
51
|
+
imagesPreloading: true,
|
|
52
|
+
loading: true,
|
|
53
|
+
firstImage: "",
|
|
54
|
+
preloadedSunSimImages: new Map(),
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
computed: {
|
|
58
|
+
minimapData() {
|
|
59
|
+
return this.minimapJSON[this.level];
|
|
60
|
+
},
|
|
61
|
+
hourMarkString() {
|
|
62
|
+
const hour = Math.floor(this.hourMark).toString().padStart(2, "0");
|
|
63
|
+
return `${hour}:00`;
|
|
64
|
+
},
|
|
65
|
+
timeString() {
|
|
66
|
+
if (this.minimapData.sunsimFilesTimeStamps[this.hourMark]) {
|
|
67
|
+
const date =
|
|
68
|
+
this.minimapData.sunsimFilesTimeStamps[this.hourMark].split(" ");
|
|
69
|
+
|
|
70
|
+
return `${date[0]} ${date[1]}`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return "";
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
async mounted() {
|
|
77
|
+
this.firstImage = await this.fetchAndConvertToBase64(
|
|
78
|
+
this.minimapData.sunsimFiles[this.hourMark]
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
this.loading = false;
|
|
82
|
+
|
|
83
|
+
const backgroundImages = await this.preloadImages(this.minimapJSON);
|
|
84
|
+
this.preloadedSunSimImages = backgroundImages;
|
|
85
|
+
this.imagesPreloading = false;
|
|
86
|
+
this.$emit(
|
|
87
|
+
"set-background-image",
|
|
88
|
+
this.getImageUrl(this.level, this.hourMark)
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
watch: {
|
|
92
|
+
hourMark() {
|
|
93
|
+
const newImage = this.getImageUrl(this.level, this.hourMark);
|
|
94
|
+
|
|
95
|
+
this.$emit("set-background-image", newImage);
|
|
96
|
+
},
|
|
97
|
+
level: {
|
|
98
|
+
handler() {
|
|
99
|
+
this.$emit(
|
|
100
|
+
"set-background-image",
|
|
101
|
+
this.getImageUrl(this.level, this.hourMark)
|
|
102
|
+
);
|
|
103
|
+
},
|
|
104
|
+
immediate: true,
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
getImageUrl(level, hourMark) {
|
|
109
|
+
// if (this.imagesPreloading) return this.firstImage
|
|
110
|
+
|
|
111
|
+
if (this.preloadedSunSimImages.get(`sunsim${level}_${hourMark}`))
|
|
112
|
+
return this.preloadedSunSimImages.get(`sunsim${level}_${hourMark}`);
|
|
113
|
+
return "";
|
|
114
|
+
},
|
|
115
|
+
async preloadImages(minimapJSON) {
|
|
116
|
+
let images = new Map();
|
|
117
|
+
|
|
118
|
+
for (let i = 0; i < minimapJSON.length; i++) {
|
|
119
|
+
const sunsimFiles = minimapJSON[i].sunsimFiles;
|
|
120
|
+
|
|
121
|
+
for (let j = 0; j < sunsimFiles.length; j++) {
|
|
122
|
+
const element = sunsimFiles[j];
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const url = element;
|
|
126
|
+
const nameOnly = element.split(".");
|
|
127
|
+
const image = await this.fetchAndConvertToBase64(this.root + url);
|
|
128
|
+
|
|
129
|
+
images.set(nameOnly[0], image);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
continue;
|
|
132
|
+
// ignore on fetch errors
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return images;
|
|
138
|
+
},
|
|
139
|
+
async fetchAndConvertToBase64(url) {
|
|
140
|
+
let actualUrl = url;
|
|
141
|
+
|
|
142
|
+
if (this.localMode) {
|
|
143
|
+
actualUrl = `${this.fileLoader.getURL(url)}`;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const response = await fetch(actualUrl);
|
|
147
|
+
const blob = await response.blob();
|
|
148
|
+
const base64 = await this.convertToBase64(blob);
|
|
149
|
+
const base64Image = this.base64toImage(base64);
|
|
150
|
+
return base64Image;
|
|
151
|
+
},
|
|
152
|
+
base64toImage(base64) {
|
|
153
|
+
return "data:image/jpeg;base64," + base64;
|
|
154
|
+
},
|
|
155
|
+
async convertToBase64(blob) {
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
const reader = new FileReader();
|
|
158
|
+
reader.onload = () => {
|
|
159
|
+
const base64 = reader.result.split(",")[1];
|
|
160
|
+
resolve(base64);
|
|
161
|
+
};
|
|
162
|
+
reader.onerror = reject;
|
|
163
|
+
reader.readAsDataURL(blob);
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<style scoped>
|
|
171
|
+
.ss-wrapper {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: row;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
margin: 0 10px;
|
|
176
|
+
position: relative;
|
|
177
|
+
z-index: 100;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.sun-icon {
|
|
181
|
+
width: 10%;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.slider {
|
|
185
|
+
display: flex;
|
|
186
|
+
flex-direction: column;
|
|
187
|
+
flex: 1 1 auto;
|
|
188
|
+
padding: 3px 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
i.v-icon.notranslate.mdi.mdi-white-balance-sunny.theme--light {
|
|
192
|
+
font-size: 40px;
|
|
193
|
+
color: #ffab02;
|
|
194
|
+
padding: 5px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.time-label {
|
|
198
|
+
padding: 0;
|
|
199
|
+
display: inline-block;
|
|
200
|
+
margin-top: -10px;
|
|
201
|
+
margin-left: 50px;
|
|
202
|
+
}
|
|
203
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MiniMapV2 } from './MiniMapV2'
|
package/src/entry.esm.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Import vue components
|
|
2
|
+
import * as components from '@/components/index'
|
|
3
|
+
|
|
4
|
+
// install function executed by Vue.use()
|
|
5
|
+
const install = function installVisuadoVueComponents(Vue) {
|
|
6
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
7
|
+
Vue.component(componentName, component)
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Create module definition for Vue.use()
|
|
12
|
+
export default install
|
|
13
|
+
|
|
14
|
+
// To allow individual component use, export components
|
|
15
|
+
// each can be registered via Vue.component()
|
|
16
|
+
export * from '@/components/index'
|
|
17
|
+
export * from '@/lib/index'
|
package/src/entry.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// iife/cjs usage extends esm default export - so import it all
|
|
2
|
+
import plugin, * as components from '@/entry.esm'
|
|
3
|
+
|
|
4
|
+
// Attach named exports directly to plugin. IIFE/CJS will
|
|
5
|
+
// only expose one global var, with component exports exposed as properties of
|
|
6
|
+
// that global var (eg. plugin.component)
|
|
7
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
8
|
+
if (componentName !== 'default') {
|
|
9
|
+
plugin[componentName] = component
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export default plugin
|
package/src/entry.ts_
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Import vue components
|
|
2
|
+
import * as components from '@/components/index'
|
|
3
|
+
|
|
4
|
+
// install function executed by Vue.use()
|
|
5
|
+
const install = function installQiSpaceVueComponents(Vue) {
|
|
6
|
+
Object.entries(components).forEach(([componentName, component]) => {
|
|
7
|
+
Vue.component(componentName, component)
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Create module definition for Vue.use()
|
|
12
|
+
export default install
|
|
13
|
+
|
|
14
|
+
// To allow individual component use, export components
|
|
15
|
+
// each can be registered via Vue.component()
|
|
16
|
+
export * from '@/components/index'
|
|
17
|
+
export * from '@/lib/index'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const SCENE_COUNT = 4
|
|
2
|
+
|
|
3
|
+
export function nextScene(fromScene) {
|
|
4
|
+
return fromScene < SCENE_COUNT ? fromScene + 1 : 1
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function prevScene(fromScene) {
|
|
8
|
+
return fromScene > 1 ? fromScene - 1 : SCENE_COUNT
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class BuildingViewerModel {
|
|
12
|
+
constructor(scene) {
|
|
13
|
+
this._state = {
|
|
14
|
+
isRotating: false,
|
|
15
|
+
currentScene: scene,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get isRotating() {
|
|
20
|
+
return this._state.isRotating
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
set isRotating(value) {
|
|
24
|
+
this._state.isRotating = value
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
get navigator() {
|
|
28
|
+
return this._navigator
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get sceneModel() {
|
|
32
|
+
return this._sceneModel
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
unlessRotatingDo(action) {
|
|
36
|
+
if (!this.isRotating) {
|
|
37
|
+
action()
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get currentScene() {
|
|
42
|
+
return this._state.currentScene
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
set currentScene(value) {
|
|
46
|
+
this._state.currentScene = value
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
rotateCounterClockwise() {
|
|
50
|
+
this.unlessRotatingDo(() => {
|
|
51
|
+
this.currentScene = nextScene(this.currentScene)
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
rotateClockwise() {
|
|
56
|
+
this.unlessRotatingDo(() => {
|
|
57
|
+
this.currentScene = prevScene(this.currentScene)
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
|
|
3
|
+
export class CircularSlideshow {
|
|
4
|
+
static create(imageFetcher, limit = undefined) {
|
|
5
|
+
const slideshow = new CircularSlideshow(imageFetcher, limit)
|
|
6
|
+
slideshow.activate()
|
|
7
|
+
return slideshow
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
constructor(imageFetcher, limit) {
|
|
11
|
+
this._fetcher = imageFetcher
|
|
12
|
+
this._imageFetcher = imageFetcher
|
|
13
|
+
this._imageIndex = 0
|
|
14
|
+
this._limit = limit
|
|
15
|
+
|
|
16
|
+
this._state = Vue.observable({ isActive: false, image: undefined })
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
install(component, showInterval) {
|
|
20
|
+
const interval = setInterval(() => {
|
|
21
|
+
this.showNext()
|
|
22
|
+
}, showInterval)
|
|
23
|
+
|
|
24
|
+
component.$on('hook:beforeDestroy', () => {
|
|
25
|
+
clearInterval(interval)
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async activate() {
|
|
30
|
+
this._imageIndex = 0
|
|
31
|
+
this._state.isActive = await this._fetchImage()
|
|
32
|
+
.then(() => true)
|
|
33
|
+
.catch(() => false)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async showNext() {
|
|
37
|
+
this._imageIndex++
|
|
38
|
+
if (this._limit) this._imageIndex = this._imageIndex % this._limit
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
await this._fetchImage()
|
|
42
|
+
} catch {
|
|
43
|
+
this._limit = this._imageIndex - 1
|
|
44
|
+
await this._reset()
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get isActive() {
|
|
49
|
+
return this._state.isActive
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
get image() {
|
|
53
|
+
return this._state.image
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_fetchImage() {
|
|
57
|
+
return this._fetcher(this._imageIndex).then(
|
|
58
|
+
(image) => (this._state.image = image)
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async _reset() {
|
|
63
|
+
this._imageIndex = 0
|
|
64
|
+
await this._fetchImage()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class RotationStep {
|
|
2
|
+
constructor(rotator, direction, frameIndex, sceneCount) {
|
|
3
|
+
this._rotator = rotator
|
|
4
|
+
this._direction = direction
|
|
5
|
+
this._frameIndex = frameIndex
|
|
6
|
+
this._sceneCount = sceneCount
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
get atEnd() {
|
|
10
|
+
return this._sceneCount === 0
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get frameIndex() {
|
|
14
|
+
return this._frameIndex
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
nextFrame() {
|
|
18
|
+
const nextFrameIndex = this._rotator.clampFrameIndex(
|
|
19
|
+
this._frameIndex + this._direction
|
|
20
|
+
)
|
|
21
|
+
const sceneCount = this._rotator.isCardinalFrame(nextFrameIndex)
|
|
22
|
+
? this._sceneCount - 1
|
|
23
|
+
: this._sceneCount
|
|
24
|
+
return new RotationStep(
|
|
25
|
+
this._rotator,
|
|
26
|
+
this._direction,
|
|
27
|
+
nextFrameIndex,
|
|
28
|
+
sceneCount
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|