@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,319 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="viewModel">
|
|
3
|
+
<div class="interactive-viewer">
|
|
4
|
+
<div class="fill-parent">
|
|
5
|
+
<qi-zoom-box
|
|
6
|
+
:desktop="loadState.isReady && interactiveDesktop"
|
|
7
|
+
:mobile="loadState.isReady && interactiveMobile"
|
|
8
|
+
>
|
|
9
|
+
<qi-apartment-chooser-rotator
|
|
10
|
+
:cdn-file-resolver="cdnFileResolver"
|
|
11
|
+
:view-model="viewModel"
|
|
12
|
+
:cardinal-frames="scenes"
|
|
13
|
+
:build="build"
|
|
14
|
+
@progress="loadState.progress = $event"
|
|
15
|
+
@loaded="loadState.isReady = true"
|
|
16
|
+
@error="loadState.isError = true"
|
|
17
|
+
/>
|
|
18
|
+
<template v-if="loadState.isReady">
|
|
19
|
+
<div>
|
|
20
|
+
<component
|
|
21
|
+
:is="overlayComponent"
|
|
22
|
+
:cdn-file-resolver="cdnFileResolver"
|
|
23
|
+
:view-model="viewModel"
|
|
24
|
+
:selected-unit-id="selectedUnitId"
|
|
25
|
+
:scene-data="sceneData"
|
|
26
|
+
:color-callback="colorCallback"
|
|
27
|
+
:unit-callback="unitCallback"
|
|
28
|
+
:can-go-to-unit-callback="canGoToUnitCallback"
|
|
29
|
+
:draw-observer="drawObserver"
|
|
30
|
+
@select-unit="$emit('select-unit', $event)"
|
|
31
|
+
@go-to-unit="$emit('go-to-unit', $event)"
|
|
32
|
+
@hover-over="hoverOver"
|
|
33
|
+
@hover-out="hoverOut"
|
|
34
|
+
@pos="onPos"
|
|
35
|
+
>
|
|
36
|
+
<template #default="props">
|
|
37
|
+
<slot v-bind="props" />
|
|
38
|
+
</template>
|
|
39
|
+
</component>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
</qi-zoom-box>
|
|
43
|
+
<qi-floating-card
|
|
44
|
+
v-if="hoverApartment && showCards"
|
|
45
|
+
:is-hoverable="isHoverable"
|
|
46
|
+
:pos="pos"
|
|
47
|
+
@outside="closeHandler"
|
|
48
|
+
>
|
|
49
|
+
<slot
|
|
50
|
+
:unit="hoverApartment"
|
|
51
|
+
:can-go-to-unit="canGoToUnitCallback(hoverApartment)"
|
|
52
|
+
:go-to-unit="
|
|
53
|
+
() =>
|
|
54
|
+
canGoToUnitCallback(hoverApartment) &&
|
|
55
|
+
$emit('go-to-unit', hoverApartment)
|
|
56
|
+
"
|
|
57
|
+
:pos="pos"
|
|
58
|
+
:is-hoverable="isHoverable"
|
|
59
|
+
:close="closeHandler"
|
|
60
|
+
/>
|
|
61
|
+
</qi-floating-card>
|
|
62
|
+
<template v-if="loadState.isReady">
|
|
63
|
+
<div class="navigation">
|
|
64
|
+
<qi-apartment-chooser-navigation
|
|
65
|
+
:can-go-to-unit-callback="canGoToUnitCallback"
|
|
66
|
+
:selected-unit="selectedUnit"
|
|
67
|
+
:prev-unit="prevUnit"
|
|
68
|
+
:next-unit="nextUnit"
|
|
69
|
+
:view-model="viewModel"
|
|
70
|
+
@go-to-unit="$emit('go-to-unit', $event)"
|
|
71
|
+
@prev-unit="$emit('nav-unit', prevUnit)"
|
|
72
|
+
@next-unit="$emit('nav-unit', nextUnit)"
|
|
73
|
+
/>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
76
|
+
<div v-else-if="!loadState.isError">
|
|
77
|
+
<v-progress-linear
|
|
78
|
+
:indeterminate="!loadState.progress"
|
|
79
|
+
:value="loadState.progress"
|
|
80
|
+
/>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
<qi-hover-probe ref="hoverProbe" />
|
|
85
|
+
</div>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script>
|
|
89
|
+
import QiApartmentChooserRaster from "./QiApartmentChooserRaster.vue";
|
|
90
|
+
import QiApartmentChooserSvg from "./QiApartmentChooserSvg.vue";
|
|
91
|
+
import QiApartmentChooserNavigation from "./QiApartmentChooserNavigation.vue";
|
|
92
|
+
import QiApartmentChooserRotator from "./QiApartmentChooserRotator.vue";
|
|
93
|
+
import QiFloatingCard from "@/components/shared/QiFloatingCard.vue";
|
|
94
|
+
import QiHoverProbe from "@/components/shared/QiHoverProbe.vue";
|
|
95
|
+
import QiZoomBox from "@/components/shared/QiZoomBox.vue";
|
|
96
|
+
import { ResourceLoader } from "@/lib/shared/ResourceLoader";
|
|
97
|
+
import {
|
|
98
|
+
SCENE_COUNT,
|
|
99
|
+
nextScene,
|
|
100
|
+
BuildingViewerModel,
|
|
101
|
+
} from "@/lib/apartmentChooser/BuildingViewerModel";
|
|
102
|
+
import { I18N } from "@/lib/shared/I18N";
|
|
103
|
+
|
|
104
|
+
const DEFAULT_SCENE = 4;
|
|
105
|
+
const DEFAULT_CARDINAL_FRAMES = [0, 16, 32, 48];
|
|
106
|
+
|
|
107
|
+
export default {
|
|
108
|
+
name: "QiApartmentChooser",
|
|
109
|
+
components: {
|
|
110
|
+
QiApartmentChooserRaster,
|
|
111
|
+
QiApartmentChooserSvg,
|
|
112
|
+
QiApartmentChooserNavigation,
|
|
113
|
+
QiApartmentChooserRotator,
|
|
114
|
+
QiFloatingCard,
|
|
115
|
+
QiHoverProbe,
|
|
116
|
+
QiZoomBox,
|
|
117
|
+
},
|
|
118
|
+
provide() {
|
|
119
|
+
const localizer = this.i18n
|
|
120
|
+
? new I18N(this.i18n.labels, this.i18n.language)
|
|
121
|
+
: new I18N();
|
|
122
|
+
return {
|
|
123
|
+
i18n: localizer,
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
emits: [
|
|
127
|
+
"select-unit",
|
|
128
|
+
"go-to-unit",
|
|
129
|
+
"nav-unit",
|
|
130
|
+
"hover-over-unit",
|
|
131
|
+
"hover-out-unit",
|
|
132
|
+
"initialized",
|
|
133
|
+
],
|
|
134
|
+
props: {
|
|
135
|
+
i18n: { type: Object, default: undefined },
|
|
136
|
+
showCards: { type: Boolean, default: true },
|
|
137
|
+
build: { type: String, default: "" },
|
|
138
|
+
buildingSceneDataResolver: { type: Function, default: null },
|
|
139
|
+
buildingScenesByApartmentResolver: { type: Function, default: null },
|
|
140
|
+
cdnFileResolver: { type: Function, required: true },
|
|
141
|
+
colorCallback: {
|
|
142
|
+
type: Function,
|
|
143
|
+
default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 }),
|
|
144
|
+
},
|
|
145
|
+
unitCallback: { type: Function, default: (unitId) => unitId },
|
|
146
|
+
canGoToUnitCallback: { type: Function, default: () => true },
|
|
147
|
+
selectedUnitId: { type: String, default: null },
|
|
148
|
+
nextUnit: { type: Object, default: null },
|
|
149
|
+
prevUnit: { type: Object, default: null },
|
|
150
|
+
drawObserver: {
|
|
151
|
+
type: [Object, Array, String, Number, Boolean],
|
|
152
|
+
default: null,
|
|
153
|
+
},
|
|
154
|
+
interactiveDesktop: { type: Boolean, default: true },
|
|
155
|
+
interactiveMobile: { type: Boolean, default: true },
|
|
156
|
+
useSvg: { type: Boolean, default: false },
|
|
157
|
+
},
|
|
158
|
+
data() {
|
|
159
|
+
return {
|
|
160
|
+
loadState: { isReady: false, isError: false, progress: undefined },
|
|
161
|
+
scenesByApartment: null,
|
|
162
|
+
sceneData: null,
|
|
163
|
+
scenes: null,
|
|
164
|
+
viewModel: undefined,
|
|
165
|
+
resourceLoader: new ResourceLoader(),
|
|
166
|
+
pos: { x: 0, y: 0, width: 0, height: 0 },
|
|
167
|
+
closeHandler: undefined,
|
|
168
|
+
hoverApartment: undefined,
|
|
169
|
+
};
|
|
170
|
+
},
|
|
171
|
+
computed: {
|
|
172
|
+
isHoverable() {
|
|
173
|
+
return this.$refs.hoverProbe.isHoverEnabled;
|
|
174
|
+
},
|
|
175
|
+
selectedUnit() {
|
|
176
|
+
return this.unitCallback
|
|
177
|
+
? this.unitCallback(this.selectedUnitId)
|
|
178
|
+
: this.selectedUnitId;
|
|
179
|
+
},
|
|
180
|
+
overlayComponent() {
|
|
181
|
+
return this.useSvg ? QiApartmentChooserSvg : QiApartmentChooserRaster;
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
watch: {
|
|
185
|
+
selectedUnitId: {
|
|
186
|
+
handler() {
|
|
187
|
+
if (this.selectedUnitId && this.viewModel) {
|
|
188
|
+
const scene = this.scenesByApartment[this.selectedUnitId];
|
|
189
|
+
if (scene) {
|
|
190
|
+
this.viewModel.currentScene = scene;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
immediate: true,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
async mounted() {
|
|
198
|
+
let sceneConfig = null;
|
|
199
|
+
try {
|
|
200
|
+
sceneConfig = await this.resourceLoader.loadJson(
|
|
201
|
+
this.cdnFileResolver("/apartmentChooser.json")
|
|
202
|
+
);
|
|
203
|
+
} catch {
|
|
204
|
+
console.info("apartmentChooser.json not found");
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
const scene =
|
|
208
|
+
sceneConfig && sceneConfig.startScene !== undefined
|
|
209
|
+
? sceneConfig.startScene
|
|
210
|
+
: DEFAULT_SCENE;
|
|
211
|
+
this.scenes =
|
|
212
|
+
sceneConfig && sceneConfig.scenes !== undefined
|
|
213
|
+
? sceneConfig.scenes
|
|
214
|
+
: DEFAULT_CARDINAL_FRAMES;
|
|
215
|
+
this.sceneData =
|
|
216
|
+
sceneConfig && sceneConfig.sceneData !== undefined
|
|
217
|
+
? sceneConfig.sceneData.map((it) => ({
|
|
218
|
+
apartmentId: it.apartmentID,
|
|
219
|
+
index: it.index,
|
|
220
|
+
}))
|
|
221
|
+
: this.buildingSceneDataResolver
|
|
222
|
+
? await this.buildingSceneDataResolver()
|
|
223
|
+
: [];
|
|
224
|
+
this.scenesByApartment =
|
|
225
|
+
sceneConfig && sceneConfig.sceneData !== undefined
|
|
226
|
+
? sceneConfig.sceneData
|
|
227
|
+
.map((it) => {
|
|
228
|
+
// Weird conversion to assure back compatibility, needs to be examined and cleaned up
|
|
229
|
+
const bestScene = it.bestScene === 0 ? 4 : it.bestScene;
|
|
230
|
+
return { unitId: it.apartmentID, scene: bestScene };
|
|
231
|
+
})
|
|
232
|
+
.reduce((acc, it) => ({ ...acc, [it.unitId]: it.scene }), {})
|
|
233
|
+
: this.buildingScenesByApartmentResolver
|
|
234
|
+
? await this.buildingScenesByApartmentResolver()
|
|
235
|
+
: [];
|
|
236
|
+
|
|
237
|
+
const unitsSceneSort = (units, key = "unitId") => {
|
|
238
|
+
let startScene = scene;
|
|
239
|
+
let sceneArray = [];
|
|
240
|
+
for (let count = 0; count < SCENE_COUNT; count++) {
|
|
241
|
+
sceneArray.push(startScene);
|
|
242
|
+
startScene = nextScene(startScene);
|
|
243
|
+
}
|
|
244
|
+
units.sort((a, b) => {
|
|
245
|
+
const sceneAIndex = sceneArray.findIndex(
|
|
246
|
+
(s) => s === this.scenesByApartment[a[key]]
|
|
247
|
+
);
|
|
248
|
+
const sceneBIndex = sceneArray.findIndex(
|
|
249
|
+
(s) => s === this.scenesByApartment[b[key]]
|
|
250
|
+
);
|
|
251
|
+
if (sceneAIndex < sceneBIndex) {
|
|
252
|
+
return -1;
|
|
253
|
+
} else if (sceneAIndex > sceneBIndex) {
|
|
254
|
+
return 1;
|
|
255
|
+
} else {
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
return units;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
const initialize = (s) => {
|
|
263
|
+
this.viewModel = new BuildingViewerModel(s);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
this.$emit("initialized", {
|
|
267
|
+
scene,
|
|
268
|
+
scenes: this.scenes,
|
|
269
|
+
sceneData: this.sceneData,
|
|
270
|
+
scenesByApartment: this.scenesByApartment,
|
|
271
|
+
unitsSceneSort,
|
|
272
|
+
initialize,
|
|
273
|
+
});
|
|
274
|
+
},
|
|
275
|
+
methods: {
|
|
276
|
+
onPos(pos) {
|
|
277
|
+
this.pos = pos;
|
|
278
|
+
},
|
|
279
|
+
hoverOver({ hoverApartment, closeHandler }) {
|
|
280
|
+
this.hoverApartment = hoverApartment;
|
|
281
|
+
this.closeHandler = closeHandler;
|
|
282
|
+
this.$emit("hover-over-unit", hoverApartment);
|
|
283
|
+
},
|
|
284
|
+
hoverOut({ hoverApartment, closeHandler }) {
|
|
285
|
+
this.hoverApartment = null;
|
|
286
|
+
this.closeHandler = closeHandler;
|
|
287
|
+
this.$emit("hover-out-unit", hoverApartment);
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
};
|
|
291
|
+
</script>
|
|
292
|
+
|
|
293
|
+
<style scoped>
|
|
294
|
+
.interactive-viewer {
|
|
295
|
+
padding-top: 56.65%;
|
|
296
|
+
position: relative;
|
|
297
|
+
}
|
|
298
|
+
.fill-parent {
|
|
299
|
+
position: absolute;
|
|
300
|
+
top: 0;
|
|
301
|
+
bottom: 0;
|
|
302
|
+
left: 0;
|
|
303
|
+
right: 0;
|
|
304
|
+
}
|
|
305
|
+
.navigation {
|
|
306
|
+
position: absolute;
|
|
307
|
+
width: 100%;
|
|
308
|
+
bottom: 32px;
|
|
309
|
+
z-index: 99;
|
|
310
|
+
padding: 0 20px;
|
|
311
|
+
display: flex;
|
|
312
|
+
justify-content: center;
|
|
313
|
+
}
|
|
314
|
+
@media only screen and (max-width: 600px) {
|
|
315
|
+
.navigation {
|
|
316
|
+
bottom: 12px;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<v-btn
|
|
4
|
+
elevation="1"
|
|
5
|
+
icon="mdi-rotate-right"
|
|
6
|
+
class="black darken-1"
|
|
7
|
+
@click="viewModel.rotateClockwise()"
|
|
8
|
+
>
|
|
9
|
+
</v-btn>
|
|
10
|
+
<v-btn
|
|
11
|
+
elevation="1"
|
|
12
|
+
plain
|
|
13
|
+
icon="mdi-chevron-left"
|
|
14
|
+
class="mr-sm-4 ml-sm-8 mr-3 ml-3 black darken-1"
|
|
15
|
+
:disabled="!prevUnit"
|
|
16
|
+
@click="$emit('prev-unit')"
|
|
17
|
+
>
|
|
18
|
+
</v-btn>
|
|
19
|
+
<v-btn
|
|
20
|
+
color="success darken-2"
|
|
21
|
+
elevation="1"
|
|
22
|
+
rounded
|
|
23
|
+
plain
|
|
24
|
+
:disabled="!selectedUnit || !canGoToUnitCallback(selectedUnit)"
|
|
25
|
+
@click="$emit('go-to-unit', selectedUnit)"
|
|
26
|
+
>
|
|
27
|
+
<span
|
|
28
|
+
v-if="selectedUnit && canGoToUnitCallback(selectedUnit)"
|
|
29
|
+
class="d-none d-md-flex"
|
|
30
|
+
>
|
|
31
|
+
{{ i18n.getLabel("see-apartment") }}
|
|
32
|
+
</span>
|
|
33
|
+
<span>
|
|
34
|
+
{{ selectedUnit && "title" in selectedUnit ? selectedUnit.title : "-" }}
|
|
35
|
+
</span>
|
|
36
|
+
</v-btn>
|
|
37
|
+
<v-btn
|
|
38
|
+
elevation="1"
|
|
39
|
+
plain
|
|
40
|
+
icon="mdi-chevron-right"
|
|
41
|
+
class="mr-sm-8 ml-sm-4 mr-3 ml-3 black darken-1"
|
|
42
|
+
:disabled="!nextUnit"
|
|
43
|
+
@click="$emit('next-unit')"
|
|
44
|
+
>
|
|
45
|
+
</v-btn>
|
|
46
|
+
<v-btn
|
|
47
|
+
elevation="1"
|
|
48
|
+
plain
|
|
49
|
+
icon="mdi-rotate-left"
|
|
50
|
+
class="black darken-1"
|
|
51
|
+
@click="viewModel.rotateCounterClockwise()"
|
|
52
|
+
>
|
|
53
|
+
</v-btn>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
<script>
|
|
57
|
+
export default {
|
|
58
|
+
name: "QiApartmentChooserNavigation",
|
|
59
|
+
inject: ["i18n"],
|
|
60
|
+
props: {
|
|
61
|
+
canGoToUnitCallback: { type: Function, default: () => true },
|
|
62
|
+
selectedUnit: { type: Object, default: null },
|
|
63
|
+
prevUnit: { type: Object, default: null },
|
|
64
|
+
nextUnit: { type: Object, default: null },
|
|
65
|
+
viewModel: { type: Object, required: true },
|
|
66
|
+
},
|
|
67
|
+
mounted() {
|
|
68
|
+
window.addEventListener("keydown", this.keyNavigate);
|
|
69
|
+
},
|
|
70
|
+
beforeUnmount() {
|
|
71
|
+
window.removeEventListener("keydown", this.keyNavigate);
|
|
72
|
+
},
|
|
73
|
+
methods: {
|
|
74
|
+
keyNavigate(e) {
|
|
75
|
+
if (e.keyCode === 37) {
|
|
76
|
+
this.prevUnit && this.$emit("prev-unit");
|
|
77
|
+
} else if (e.keyCode === 39) {
|
|
78
|
+
this.nextUnit && this.$emit("next-unit");
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
</script>
|
|
84
|
+
<style scoped>
|
|
85
|
+
.v-btn {
|
|
86
|
+
background-color: #fff;
|
|
87
|
+
}
|
|
88
|
+
</style>
|