@qispace/vue3-player 0.0.15 → 0.1.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.
- package/dist/vue-components/config/vite.config.d.ts +2 -0
- package/dist/vue-components/config/vite.config.dev.d.ts +2 -0
- package/dist/vue-components/config/vite.config.web-components.d.ts +2 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooser.vue.d.ts +129 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserNavigation.vue.d.ts +46 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserRaster.vue.d.ts +77 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserRotator.vue.d.ts +43 -0
- package/dist/vue-components/src/components/apartmentChooser/VApartmentChooserSvg.vue.d.ts +77 -0
- package/dist/vue-components/src/components/apartmentChooser/index.d.ts +5 -0
- package/dist/vue-components/src/components/apartmentChooser/types.d.ts +13 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooser.vue.d.ts +93 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserRaster.vue.d.ts +97 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserRasterOverlay.vue.d.ts +46 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSceneImageStack.vue.d.ts +27 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSunSimControl.vue.d.ts +37 -0
- package/dist/vue-components/src/components/buildingPicker/VBuildingChooserSvg.vue.d.ts +102 -0
- package/dist/vue-components/src/components/buildingPicker/index.d.ts +6 -0
- package/dist/vue-components/src/components/buildingPicker/types.d.ts +11 -0
- package/dist/{components → vue-components/src/components}/index.d.ts +1 -1
- package/dist/vue-components/src/components/shared/VFloatingCard.vue.d.ts +30 -0
- package/dist/vue-components/src/components/shared/VHoverProbe.vue.d.ts +4 -0
- package/dist/vue-components/src/components/shared/VNorthDirection.vue.d.ts +15 -0
- package/dist/vue-components/src/components/shared/VZoomBox.vue.d.ts +60 -0
- package/dist/vue-components/src/components/shared/index.d.ts +4 -0
- package/dist/vue-components/src/components/virtualTour/VCompass.vue.d.ts +15 -0
- package/dist/vue-components/src/components/virtualTour/VDisclaimer.vue.d.ts +2 -0
- package/dist/vue-components/src/components/virtualTour/VFloorLevel.vue.d.ts +38 -0
- package/dist/vue-components/src/components/virtualTour/VFullScreenButton.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VInteriorSelector.vue.d.ts +21 -0
- package/dist/vue-components/src/components/virtualTour/VPlayer.vue.d.ts +74 -0
- package/dist/vue-components/src/components/virtualTour/VSettingsUI.vue.d.ts +23 -0
- package/dist/vue-components/src/components/virtualTour/VSingleImage.vue.d.ts +31 -0
- package/dist/vue-components/src/components/virtualTour/VSocialShare.vue.d.ts +2 -0
- package/dist/vue-components/src/components/virtualTour/VTimeOfDay.vue.d.ts +34 -0
- package/dist/vue-components/src/components/virtualTour/VTutorial.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VViewModeToggle.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/VVirtualTour.vue.d.ts +156 -0
- package/dist/vue-components/src/components/virtualTour/VWaypointCarousel.vue.d.ts +25 -0
- package/dist/vue-components/src/components/virtualTour/index.d.ts +1 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMiniMap.vue.d.ts +35 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMiniMapMap.vue.d.ts +25 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMinimapCompass.vue.d.ts +19 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VMoveable.vue.d.ts +18 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VRotationMarker.vue.d.ts +15 -0
- package/dist/vue-components/src/components/virtualTour/minimap/VSunSimulationSlider.vue.d.ts +23 -0
- package/dist/vue-components/src/components/virtualTour/minimap/index.d.ts +1 -0
- package/dist/vue-components/src/lib/apartmentChooser/BuildingViewerModel.d.ts +18 -0
- package/dist/vue-components/src/lib/apartmentChooser/RotationStep.d.ts +10 -0
- package/dist/vue-components/src/lib/apartmentChooser/SceneRotator.d.ts +10 -0
- package/dist/vue-components/src/lib/apartmentChooser/index.d.ts +3 -0
- package/dist/vue-components/src/lib/buildingPicker/BuildingMap.d.ts +7 -0
- package/dist/vue-components/src/lib/buildingPicker/BuildingPickerResourceProvider.d.ts +27 -0
- package/dist/vue-components/src/lib/buildingPicker/CanvasRaster.d.ts +8 -0
- package/dist/vue-components/src/lib/buildingPicker/DayOfYearSelector.d.ts +12 -0
- package/dist/vue-components/src/lib/buildingPicker/SampleRaster.d.ts +5 -0
- package/dist/vue-components/src/lib/buildingPicker/index.d.ts +5 -0
- package/dist/vue-components/src/lib/shared/BatchLoadTracker.d.ts +17 -0
- package/dist/vue-components/src/lib/shared/I18N.d.ts +7 -0
- package/dist/vue-components/src/lib/shared/ResourceLoader.d.ts +5 -0
- package/dist/vue-components/src/lib/shared/index.d.ts +3 -0
- package/dist/vue-components/src/lib/virtualTour/CameraSnapshot.d.ts +5 -0
- package/dist/vue-components/src/lib/virtualTour/FullscreenModel.d.ts +13 -0
- package/dist/vue-components/src/vue-components.d.ts +2 -0
- package/dist/vue-components/src/vue-components.esm.d.ts +4 -0
- package/dist/vue-components/src/web-components.d.ts +11 -0
- package/dist/vue-components/style.css +1 -0
- package/dist/vue-components/vue3-player.js +4744 -0
- package/dist/vue-components/vue3-player.umd.cjs +1 -0
- package/package.json +25 -15
- package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts +0 -2
- package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts +0 -51
- package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts +0 -2
- package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts +0 -65
- package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts +0 -2
- package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts +0 -121
- package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts +0 -2
- package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts +0 -53
- package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts +0 -32
- package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts +0 -42
- package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts +0 -2
- package/dist/components/shared/QiFloatingCard.vue.d.ts +0 -18
- package/dist/components/shared/QiHoverProbe.vue.d.ts +0 -4
- package/dist/components/shared/QiNorthDirection.vue.d.ts +0 -21
- package/dist/components/shared/QiZoomBox.vue.d.ts +0 -83
- package/dist/components/virtualTourV2/Compass.vue.d.ts +0 -22
- package/dist/components/virtualTourV2/Disclaimer.vue.d.ts +0 -4
- package/dist/components/virtualTourV2/FloorLevel.vue.d.ts +0 -27
- package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts +0 -14
- package/dist/components/virtualTourV2/InteriorSelector.vue.d.ts +0 -24
- package/dist/components/virtualTourV2/Player.vue.d.ts +0 -82
- package/dist/components/virtualTourV2/SettingsUI.vue.d.ts +0 -105
- package/dist/components/virtualTourV2/SingleImage.vue.d.ts +0 -26
- package/dist/components/virtualTourV2/SocialShare.vue.d.ts +0 -10
- package/dist/components/virtualTourV2/TimeOfDay.vue.d.ts +0 -27
- package/dist/components/virtualTourV2/Tutorial.vue.d.ts +0 -23
- package/dist/components/virtualTourV2/ViewModeToggle.vue.d.ts +0 -16
- package/dist/components/virtualTourV2/VirtualTourV2.vue.d.ts +0 -322
- package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts +0 -31
- package/dist/components/virtualTourV2/index.d.ts +0 -1
- package/dist/components/virtualTourV2/minimapv2/MiniMapMap.vue.d.ts +0 -82
- package/dist/components/virtualTourV2/minimapv2/MiniMapV2.vue.d.ts +0 -78
- package/dist/components/virtualTourV2/minimapv2/MinimapCompass.vue.d.ts +0 -30
- package/dist/components/virtualTourV2/minimapv2/Moveable.vue.d.ts +0 -8
- package/dist/components/virtualTourV2/minimapv2/RotationMarkerV2.vue.d.ts +0 -12
- package/dist/components/virtualTourV2/minimapv2/SunsimulationSlider.vue.d.ts +0 -48
- package/dist/components/virtualTourV2/minimapv2/index.d.ts +0 -1
- package/dist/style.css +0 -1
- package/dist/vue3-player.js +0 -5414
- package/dist/vue3-player.umd.cjs +0 -1
- package/src/components/apartmentChooser/QiApartmentChooser.vue +0 -319
- package/src/components/apartmentChooser/QiApartmentChooserNavigation.vue +0 -88
- package/src/components/apartmentChooser/QiApartmentChooserRaster.vue +0 -408
- package/src/components/apartmentChooser/QiApartmentChooserRotator.vue +0 -202
- package/src/components/apartmentChooser/QiApartmentChooserSvg.vue +0 -257
- package/src/components/apartmentChooser/index.js +0 -5
- package/src/components/buildingPicker/QiBuildingChooser.vue +0 -61
- package/src/components/buildingPicker/QiBuildingChooserRaster.vue +0 -312
- package/src/components/buildingPicker/QiBuildingChooserRasterOverlay.vue +0 -96
- package/src/components/buildingPicker/QiBuildingChooserSceneImageStack.vue +0 -89
- package/src/components/buildingPicker/QiBuildingChooserSunSimControl.vue +0 -257
- package/src/components/buildingPicker/QiBuildingChooserSvg.vue +0 -414
- package/src/components/buildingPicker/index.js +0 -6
- package/src/components/index.ts +0 -4
- package/src/components/shared/QiFloatingCard.vue +0 -76
- package/src/components/shared/QiHoverProbe.vue +0 -22
- package/src/components/shared/QiNorthDirection.vue +0 -27
- package/src/components/shared/QiZoomBox.vue +0 -322
- package/src/components/shared/index.js +0 -4
- package/src/components/virtualTourV2/Compass.vue +0 -37
- package/src/components/virtualTourV2/Disclaimer.vue +0 -41
- package/src/components/virtualTourV2/FloorLevel.vue +0 -73
- package/src/components/virtualTourV2/FullScreenButton.vue +0 -23
- package/src/components/virtualTourV2/InteriorSelector.vue +0 -90
- package/src/components/virtualTourV2/ManualSlideShow.vue +0 -198
- package/src/components/virtualTourV2/ManualSlideShowPlayer.vue +0 -159
- package/src/components/virtualTourV2/Player.vue +0 -300
- package/src/components/virtualTourV2/ScrollHelper.vue +0 -74
- package/src/components/virtualTourV2/SettingsUI.vue +0 -355
- package/src/components/virtualTourV2/SingleImage.vue +0 -36
- package/src/components/virtualTourV2/SocialShare.vue +0 -163
- package/src/components/virtualTourV2/TimeOfDay.vue +0 -50
- package/src/components/virtualTourV2/Tutorial.vue +0 -690
- package/src/components/virtualTourV2/ViewModeToggle.vue +0 -24
- package/src/components/virtualTourV2/VirtualTourV2.vue +0 -875
- package/src/components/virtualTourV2/WaypointCarousel.vue +0 -162
- package/src/components/virtualTourV2/index.ts +0 -20
- package/src/components/virtualTourV2/minimapv2/MiniMapMap.vue +0 -262
- package/src/components/virtualTourV2/minimapv2/MiniMapV2.vue +0 -110
- package/src/components/virtualTourV2/minimapv2/MinimapCompass.vue +0 -39
- package/src/components/virtualTourV2/minimapv2/Moveable.vue +0 -208
- package/src/components/virtualTourV2/minimapv2/RotationMarkerV2.vue +0 -79
- package/src/components/virtualTourV2/minimapv2/SunsimulationSlider.vue +0 -203
- package/src/components/virtualTourV2/minimapv2/index.ts +0 -1
- /package/dist/{lib → vue-components/src/lib}/index.d.ts +0 -0
|
@@ -1,875 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="virtual-tour-v2-wrapper">
|
|
3
|
-
<div v-if="error" class="player-error">Error loading the player!!</div>
|
|
4
|
-
<div class="player-and-components-wrapper">
|
|
5
|
-
<mini-map-v-2
|
|
6
|
-
v-if="
|
|
7
|
-
!fullScreen.isActive &&
|
|
8
|
-
minimapJSON &&
|
|
9
|
-
playerCamera &&
|
|
10
|
-
minimapCamera &&
|
|
11
|
-
displayMinimap
|
|
12
|
-
"
|
|
13
|
-
:allCameras="allCameras"
|
|
14
|
-
:rootUrl="rootUrl"
|
|
15
|
-
:level="storey"
|
|
16
|
-
:backgroundImage="refinedMinimapBackgroundImage"
|
|
17
|
-
:minimapJSON="minimapJSON.storeys"
|
|
18
|
-
:rotation="rotation"
|
|
19
|
-
:currentCamera="playerCamera"
|
|
20
|
-
:minimapCamera="minimapCamera"
|
|
21
|
-
@close="displayMinimap = false"
|
|
22
|
-
@set-background-image="setMinimapBackgroundImage"
|
|
23
|
-
/>
|
|
24
|
-
<div v-if="interiorId && currentCameraId">
|
|
25
|
-
<player
|
|
26
|
-
ref="player"
|
|
27
|
-
:file-loader="fileLoader"
|
|
28
|
-
:style="{ zIndex: showStaticImage ? 1 : 2 }"
|
|
29
|
-
:showStaticImage="showStaticImage"
|
|
30
|
-
:isFullScreen="fullScreen.isActive"
|
|
31
|
-
:rootUrl="rootUrl"
|
|
32
|
-
:currentCameraId="currentCameraId"
|
|
33
|
-
:mouse-sensitivity="mouseSensitivity"
|
|
34
|
-
:is-in-iframe="isInIframe"
|
|
35
|
-
@new-camera-callback="newCameraCallback"
|
|
36
|
-
@new-rotation-callback="newRotationCallback"
|
|
37
|
-
@new-floor-callback="newfloorCallback"
|
|
38
|
-
@new-fov-callback="newFoVCallback"
|
|
39
|
-
@new-size-callback="newSizeCallback"
|
|
40
|
-
@playerApi-callback="playerApiCallback"
|
|
41
|
-
>
|
|
42
|
-
<template v-slot:slideshow-image>
|
|
43
|
-
<single-image v-if="showStaticImage" :image="staticImage" />
|
|
44
|
-
</template>
|
|
45
|
-
<template v-slot:top-left>
|
|
46
|
-
<v-btn
|
|
47
|
-
v-show="showUI"
|
|
48
|
-
v-if="adminMode"
|
|
49
|
-
density="comfortable"
|
|
50
|
-
icon="mdi-cog-outline"
|
|
51
|
-
elevation="3"
|
|
52
|
-
class="mr-2"
|
|
53
|
-
@click="showSettings = !showSettings"
|
|
54
|
-
>
|
|
55
|
-
</v-btn>
|
|
56
|
-
<v-btn
|
|
57
|
-
v-if="minimapJSON && currentCameraId && minimapCamera"
|
|
58
|
-
v-show="showUI"
|
|
59
|
-
density="comfortable"
|
|
60
|
-
elevation="3"
|
|
61
|
-
icon="mdi-floor-plan"
|
|
62
|
-
class="mr-2"
|
|
63
|
-
@click="displayMinimap = !displayMinimap"
|
|
64
|
-
>
|
|
65
|
-
</v-btn>
|
|
66
|
-
|
|
67
|
-
<floor-level
|
|
68
|
-
v-if="showUI && showFloorLevel && floorLevels.length > 1"
|
|
69
|
-
:level="floorLevel"
|
|
70
|
-
:floor-levels="floorLevels"
|
|
71
|
-
/>
|
|
72
|
-
|
|
73
|
-
<div
|
|
74
|
-
v-if="showUI && adminMode && showSettings"
|
|
75
|
-
class="settings-panel"
|
|
76
|
-
>
|
|
77
|
-
<settings-u-i
|
|
78
|
-
:project-slug="projectSlug"
|
|
79
|
-
:initialSettings="playerSettings"
|
|
80
|
-
@update-settings="updateSetting"
|
|
81
|
-
@save-settings="saveSettings"
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
</template>
|
|
85
|
-
<template v-slot:top-center>
|
|
86
|
-
<disclaimer v-if="showUI" :return-url="websiteUrl" />
|
|
87
|
-
</template>
|
|
88
|
-
<template v-slot:top-right>
|
|
89
|
-
<div
|
|
90
|
-
v-if="apartmentJSON && showCompass"
|
|
91
|
-
v-show="showUI"
|
|
92
|
-
class="compass-wrapper"
|
|
93
|
-
>
|
|
94
|
-
<compass :rotation="rotation" />
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<time-of-day
|
|
98
|
-
v-if="showUI && apartmentJSON && hasTimeofDay && showTimeOfDay"
|
|
99
|
-
:hours="timeOfDay.hours"
|
|
100
|
-
:minutes="timeOfDay.minutes"
|
|
101
|
-
/>
|
|
102
|
-
</template>
|
|
103
|
-
<template v-slot:center-left>
|
|
104
|
-
<transition name="slide-x-transition">
|
|
105
|
-
<v-btn
|
|
106
|
-
v-if="showStaticImage"
|
|
107
|
-
density="comfortable"
|
|
108
|
-
elevation="3"
|
|
109
|
-
icon="mdi-chevron-left"
|
|
110
|
-
@click="previousCamera"
|
|
111
|
-
>
|
|
112
|
-
</v-btn>
|
|
113
|
-
</transition>
|
|
114
|
-
</template>
|
|
115
|
-
<template v-slot:center-center>
|
|
116
|
-
<tutorial :project="projectRoot" @closeTutorial="showUI = true" />
|
|
117
|
-
<mini-map-v-2
|
|
118
|
-
v-if="
|
|
119
|
-
fullScreen.isActive &&
|
|
120
|
-
minimapJSON &&
|
|
121
|
-
playerCamera &&
|
|
122
|
-
minimapCamera &&
|
|
123
|
-
displayMinimap
|
|
124
|
-
"
|
|
125
|
-
:allCameras="allCameras"
|
|
126
|
-
:rootUrl="rootUrl"
|
|
127
|
-
:minimapJSON="minimapJSON.storeys"
|
|
128
|
-
:backgroundImage="refinedMinimapBackgroundImage"
|
|
129
|
-
:rotation="rotation"
|
|
130
|
-
:currentCamera="playerCamera"
|
|
131
|
-
:minimapCamera="minimapCamera"
|
|
132
|
-
:level="storey"
|
|
133
|
-
@close="displayMinimap = false"
|
|
134
|
-
@set-background-image="setMinimapBackgroundImage"
|
|
135
|
-
/>
|
|
136
|
-
</template>
|
|
137
|
-
<template v-slot:center-right>
|
|
138
|
-
<transition name="slide-x-reverse-transition">
|
|
139
|
-
<v-btn
|
|
140
|
-
v-if="showStaticImage"
|
|
141
|
-
density="comfortable"
|
|
142
|
-
elevation="3"
|
|
143
|
-
icon="mdi-chevron-right"
|
|
144
|
-
@click="nextCamera"
|
|
145
|
-
>
|
|
146
|
-
</v-btn>
|
|
147
|
-
</transition>
|
|
148
|
-
</template>
|
|
149
|
-
<template v-slot:bottom-left>
|
|
150
|
-
<full-screen-button
|
|
151
|
-
v-if="showUI && showFullScreen"
|
|
152
|
-
:isFullScreen="fullScreen.isActive"
|
|
153
|
-
class="btn-fullscreen"
|
|
154
|
-
@toggle-fullscreen="toggleFullscreen"
|
|
155
|
-
/>
|
|
156
|
-
<div v-if="showUI && showSnapshot" class="btn-placeholder mr-2">
|
|
157
|
-
<v-btn
|
|
158
|
-
density="comfortable"
|
|
159
|
-
elevation="3"
|
|
160
|
-
icon="mdi-camera"
|
|
161
|
-
@click="takeSnapshot"
|
|
162
|
-
>
|
|
163
|
-
</v-btn>
|
|
164
|
-
</div>
|
|
165
|
-
<div
|
|
166
|
-
v-if="showUI && showShare && !fullScreen.isActive"
|
|
167
|
-
class="btn-placeholder"
|
|
168
|
-
>
|
|
169
|
-
<social-share />
|
|
170
|
-
</div>
|
|
171
|
-
</template>
|
|
172
|
-
<template v-slot:bottom-center>
|
|
173
|
-
<div v-if="showUI && showCarousel">
|
|
174
|
-
<view-mode-toggle
|
|
175
|
-
v-if="displayViewModeSwitch"
|
|
176
|
-
:show-static-image="showStaticImage"
|
|
177
|
-
@toggle="toggleViewMode"
|
|
178
|
-
/>
|
|
179
|
-
<waypoint-carousel
|
|
180
|
-
v-if="showUI && fullScreen.isActive"
|
|
181
|
-
:class="[fullScreen.isActive ? 'full-screen' : '']"
|
|
182
|
-
:thumbnails="thumbnails"
|
|
183
|
-
:active="currentThumbnailIndex"
|
|
184
|
-
@next="nextCamera"
|
|
185
|
-
@previous="previousCamera"
|
|
186
|
-
@goto="goToCamera"
|
|
187
|
-
/>
|
|
188
|
-
</div>
|
|
189
|
-
</template>
|
|
190
|
-
<template v-slot:bottom-right>
|
|
191
|
-
<interior-selector
|
|
192
|
-
v-if="showUI && showInteriorOptions && interiorsWithImage"
|
|
193
|
-
:availableArchetypes="interiorsWithImage"
|
|
194
|
-
:selectedIndex="selectedInteriorIndex"
|
|
195
|
-
@select-interior="updateSelectedInterior"
|
|
196
|
-
/>
|
|
197
|
-
</template>
|
|
198
|
-
</player>
|
|
199
|
-
|
|
200
|
-
<waypoint-carousel
|
|
201
|
-
v-if="showCarousel && thumbsJSON"
|
|
202
|
-
:thumbnails="thumbnails"
|
|
203
|
-
:active="currentThumbnailIndex"
|
|
204
|
-
@next="nextCamera"
|
|
205
|
-
@previous="previousCamera"
|
|
206
|
-
@goto="goToCamera"
|
|
207
|
-
/>
|
|
208
|
-
</div>
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
</template>
|
|
212
|
-
<script>
|
|
213
|
-
import axios from "axios";
|
|
214
|
-
import Player from "./Player.vue";
|
|
215
|
-
import WaypointCarousel from "./WaypointCarousel.vue";
|
|
216
|
-
import FloorLevel from "./FloorLevel.vue";
|
|
217
|
-
import SocialShare from "./SocialShare.vue";
|
|
218
|
-
import InteriorSelector from "./InteriorSelector.vue";
|
|
219
|
-
import { I18N } from "@/lib/shared/I18N";
|
|
220
|
-
import Compass from "./Compass.vue";
|
|
221
|
-
import SingleImage from "./SingleImage.vue";
|
|
222
|
-
import TimeOfDay from "./TimeOfDay.vue";
|
|
223
|
-
import { FullscreenModel } from "@/lib/virtualTour/FullscreenModel";
|
|
224
|
-
import { CameraSnapshot } from "@/lib/virtualTour/CameraSnapshot";
|
|
225
|
-
import FullScreenButton from "./FullScreenButton.vue";
|
|
226
|
-
import ViewModeToggle from "./ViewModeToggle.vue";
|
|
227
|
-
import Disclaimer from "./Disclaimer.vue";
|
|
228
|
-
import Tutorial from "./Tutorial.vue";
|
|
229
|
-
import SettingsUI from "./SettingsUI.vue";
|
|
230
|
-
import MiniMapV2 from "./minimapv2/MiniMapV2.vue";
|
|
231
|
-
|
|
232
|
-
const DEFAULT_PLAYER_SETTINGS = {
|
|
233
|
-
temperature: 6500,
|
|
234
|
-
targetLuminance: 1,
|
|
235
|
-
exposureFovScale: 0.3,
|
|
236
|
-
UNREAL_BLOOM_ENABLED: true,
|
|
237
|
-
sharpenFilter_amount: 0.6,
|
|
238
|
-
UNREAL_BLOOOM_STRENGTH: 0.3,
|
|
239
|
-
TRANSITION_MOVEMENT_SCALE: 1.3,
|
|
240
|
-
whitePoint: [1, 1, 1],
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
export default {
|
|
244
|
-
name: "VirtualTourV2",
|
|
245
|
-
emits: [
|
|
246
|
-
"on-snapshot",
|
|
247
|
-
"save-settings",
|
|
248
|
-
"on-interior-update",
|
|
249
|
-
"on-camera-update",
|
|
250
|
-
],
|
|
251
|
-
components: {
|
|
252
|
-
Player,
|
|
253
|
-
WaypointCarousel,
|
|
254
|
-
InteriorSelector,
|
|
255
|
-
Compass,
|
|
256
|
-
SingleImage,
|
|
257
|
-
TimeOfDay,
|
|
258
|
-
FloorLevel,
|
|
259
|
-
SocialShare,
|
|
260
|
-
FullScreenButton,
|
|
261
|
-
ViewModeToggle,
|
|
262
|
-
MiniMapV2,
|
|
263
|
-
Disclaimer,
|
|
264
|
-
Tutorial,
|
|
265
|
-
SettingsUI,
|
|
266
|
-
},
|
|
267
|
-
props: {
|
|
268
|
-
fileLoader: {
|
|
269
|
-
type: Object,
|
|
270
|
-
default: undefined,
|
|
271
|
-
},
|
|
272
|
-
cdnRoot: {
|
|
273
|
-
type: String,
|
|
274
|
-
required: true,
|
|
275
|
-
},
|
|
276
|
-
projectSlug: {
|
|
277
|
-
type: String,
|
|
278
|
-
required: true,
|
|
279
|
-
},
|
|
280
|
-
apartmentId: {
|
|
281
|
-
type: String,
|
|
282
|
-
required: true,
|
|
283
|
-
},
|
|
284
|
-
defaultInteriorId: {
|
|
285
|
-
type: String,
|
|
286
|
-
default: () => undefined,
|
|
287
|
-
},
|
|
288
|
-
validInteriorIds: { type: Array, default: () => [] },
|
|
289
|
-
viewModes: { type: Array, default: () => ["virtualTour", "slideShow"] },
|
|
290
|
-
displayViewModeSwitch: { type: Boolean, default: () => true },
|
|
291
|
-
websiteUrl: { type: String, default: () => undefined },
|
|
292
|
-
i18n: { type: Object, default: undefined },
|
|
293
|
-
showCarousel: { type: Boolean, default: () => true },
|
|
294
|
-
showTimeOfDay: { type: Boolean, default: () => true },
|
|
295
|
-
showCompass: { type: Boolean, default: () => true },
|
|
296
|
-
showFullScreen: { type: Boolean, default: () => true },
|
|
297
|
-
showSnapshot: { type: Boolean, default: () => true },
|
|
298
|
-
showShare: { type: Boolean, default: () => true },
|
|
299
|
-
showInteriorOptions: { type: Boolean, default: () => true },
|
|
300
|
-
showMiniMap: { type: Boolean, default: () => true },
|
|
301
|
-
showFloorLevel: { type: Boolean, default: () => true },
|
|
302
|
-
defaultWaypointIndex: { type: Number, default: () => 0 },
|
|
303
|
-
defaultViewMode: { type: String, default: () => "virtualTour" },
|
|
304
|
-
mouseSensitivity: { type: Number, default: () => 1 },
|
|
305
|
-
isInIframe: { type: Boolean, default: () => false },
|
|
306
|
-
adminMode: { type: Boolean, default: () => false },
|
|
307
|
-
playerSettings: {
|
|
308
|
-
type: Object,
|
|
309
|
-
default: () => {
|
|
310
|
-
return DEFAULT_PLAYER_SETTINGS;
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
},
|
|
314
|
-
data() {
|
|
315
|
-
return {
|
|
316
|
-
showSettings: false,
|
|
317
|
-
loading: true,
|
|
318
|
-
error: false,
|
|
319
|
-
configJSON: undefined,
|
|
320
|
-
apartmentJSON: undefined,
|
|
321
|
-
thumbsJSON: undefined,
|
|
322
|
-
minimapJSON: undefined,
|
|
323
|
-
playerApi: undefined,
|
|
324
|
-
currentThumbnailIndex: 0,
|
|
325
|
-
selectedInteriorId: undefined,
|
|
326
|
-
currentCameraId: undefined,
|
|
327
|
-
playerCamera: undefined,
|
|
328
|
-
rotation: 0,
|
|
329
|
-
floorLevel: 0,
|
|
330
|
-
fov: 0,
|
|
331
|
-
showStaticImage: false,
|
|
332
|
-
displayMinimap: false,
|
|
333
|
-
minimapBackgroundImage: undefined,
|
|
334
|
-
showUI: false,
|
|
335
|
-
fullScreen: new FullscreenModel(document, "player-wrapper"),
|
|
336
|
-
};
|
|
337
|
-
},
|
|
338
|
-
provide() {
|
|
339
|
-
const localizer = this.i18n
|
|
340
|
-
? new I18N(this.i18n.labels, this.i18n.language)
|
|
341
|
-
: new I18N();
|
|
342
|
-
|
|
343
|
-
return {
|
|
344
|
-
localMode: this.localMode,
|
|
345
|
-
fileLoader: this.fileLoader,
|
|
346
|
-
i18n: localizer,
|
|
347
|
-
};
|
|
348
|
-
},
|
|
349
|
-
computed: {
|
|
350
|
-
localMode() {
|
|
351
|
-
return !!this.fileLoader;
|
|
352
|
-
},
|
|
353
|
-
projectRoot() {
|
|
354
|
-
let pRoot = `${this.cdnRoot}/${this.projectSlug}`;
|
|
355
|
-
if (this.fileLoader) {
|
|
356
|
-
pRoot = "";
|
|
357
|
-
}
|
|
358
|
-
return removeTrailingSlashes(pRoot);
|
|
359
|
-
},
|
|
360
|
-
rootUrl() {
|
|
361
|
-
return `${this.projectRoot}/${this.interiorId}/${this.apartmentId}`;
|
|
362
|
-
},
|
|
363
|
-
interiorId() {
|
|
364
|
-
return this.selectedInteriorId;
|
|
365
|
-
},
|
|
366
|
-
allCameras() {
|
|
367
|
-
if (this.apartmentJSON) return this.apartmentJSON.cameras;
|
|
368
|
-
return [];
|
|
369
|
-
},
|
|
370
|
-
currentCamera() {
|
|
371
|
-
if (this.apartmentJSON && this.currentCameraId) {
|
|
372
|
-
return this.apartmentJSON.cameras.find(
|
|
373
|
-
(item) => item.id === this.cameraId
|
|
374
|
-
);
|
|
375
|
-
}
|
|
376
|
-
},
|
|
377
|
-
floorLevels() {
|
|
378
|
-
if (this.apartmentJSON) {
|
|
379
|
-
const allFloorLevels = this.apartmentJSON.cameras.map(
|
|
380
|
-
(item) => item.floorLevel
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
let uniqueFloorLevels = [...new Set(allFloorLevels)];
|
|
384
|
-
uniqueFloorLevels = uniqueFloorLevels.sort();
|
|
385
|
-
return uniqueFloorLevels;
|
|
386
|
-
} else {
|
|
387
|
-
return [];
|
|
388
|
-
}
|
|
389
|
-
},
|
|
390
|
-
storey() {
|
|
391
|
-
let storey = 0;
|
|
392
|
-
if (this.apartmentJSON) {
|
|
393
|
-
const allFloorLevels = this.apartmentJSON.cameras.map(
|
|
394
|
-
(item) => item.floorLevel
|
|
395
|
-
);
|
|
396
|
-
|
|
397
|
-
let uniqueFloorLevels = [...new Set(allFloorLevels)];
|
|
398
|
-
uniqueFloorLevels = uniqueFloorLevels.sort();
|
|
399
|
-
|
|
400
|
-
const index = uniqueFloorLevels.findIndex(
|
|
401
|
-
(item) => item === this.floorLevel
|
|
402
|
-
);
|
|
403
|
-
if (index !== -1) {
|
|
404
|
-
storey = index;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
return storey;
|
|
409
|
-
},
|
|
410
|
-
selectedInteriorIndex() {
|
|
411
|
-
return this.interiors.findIndex(
|
|
412
|
-
(item) => item.archetypeID === this.selectedInteriorId
|
|
413
|
-
);
|
|
414
|
-
},
|
|
415
|
-
thumbnails() {
|
|
416
|
-
if (!this.thumbsJSON) {
|
|
417
|
-
return [];
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
return this.thumbsJSON.cameras.map((item) => {
|
|
421
|
-
return {
|
|
422
|
-
...item,
|
|
423
|
-
thumbnailUrl: this.getURL(
|
|
424
|
-
`${this.projectRoot}/${this.interiorId}/${this.apartmentId}/thumbs/200/${item.id}.jpg`
|
|
425
|
-
),
|
|
426
|
-
imageUrl: this.getURL(
|
|
427
|
-
`${this.projectRoot}/${this.interiorId}/${this.apartmentId}/images/1600/${item.id}.jpg`
|
|
428
|
-
),
|
|
429
|
-
};
|
|
430
|
-
});
|
|
431
|
-
},
|
|
432
|
-
staticImage() {
|
|
433
|
-
if (!this.thumbnails) return "";
|
|
434
|
-
if (!this.thumbnails[this.currentThumbnailIndex]) return "";
|
|
435
|
-
|
|
436
|
-
return this.thumbnails[this.currentThumbnailIndex].imageUrl;
|
|
437
|
-
},
|
|
438
|
-
interiors() {
|
|
439
|
-
let interiors = [];
|
|
440
|
-
|
|
441
|
-
if (this.configJSON) {
|
|
442
|
-
interiors = this.configJSON.archetypes;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
if (this.validInteriorIds.length) {
|
|
446
|
-
return interiors.filter((item) =>
|
|
447
|
-
this.validInteriorIds.includes(item.archetypeID)
|
|
448
|
-
);
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
return interiors;
|
|
452
|
-
},
|
|
453
|
-
interiorIds() {
|
|
454
|
-
return this.interiors.map((item) => item.archetypeID);
|
|
455
|
-
},
|
|
456
|
-
interiorsWithImage() {
|
|
457
|
-
if (!this.thumbsJSON) {
|
|
458
|
-
return [];
|
|
459
|
-
}
|
|
460
|
-
return this.interiors.map((item) => {
|
|
461
|
-
return {
|
|
462
|
-
...item,
|
|
463
|
-
url: `${this.projectRoot}/${item.archetypeID}/${
|
|
464
|
-
this.apartmentId
|
|
465
|
-
}/thumbs/200/${this.thumbnails[this.currentThumbnailIndex].id}.jpg`,
|
|
466
|
-
};
|
|
467
|
-
});
|
|
468
|
-
},
|
|
469
|
-
minimapCamera() {
|
|
470
|
-
if (this.minimapJSON) {
|
|
471
|
-
return this.minimapJSON.storeys[this.storey];
|
|
472
|
-
}
|
|
473
|
-
return undefined;
|
|
474
|
-
},
|
|
475
|
-
hasTimeofDay() {
|
|
476
|
-
return this.apartmentJSON && this.apartmentJSON.timeInHours;
|
|
477
|
-
},
|
|
478
|
-
timeOfDay() {
|
|
479
|
-
if (
|
|
480
|
-
this.apartmentJSON &&
|
|
481
|
-
this.apartmentJSON.timeInHours &&
|
|
482
|
-
this.showTimeOfDay
|
|
483
|
-
)
|
|
484
|
-
return parseTimeOfDay(this.apartmentJSON.timeInHours);
|
|
485
|
-
},
|
|
486
|
-
refinedMinimapBackgroundImage() {
|
|
487
|
-
return this.minimapBackgroundImage
|
|
488
|
-
? this.minimapBackgroundImage
|
|
489
|
-
: `${this.projectRoot}/${this.interiorId}/${this.apartmentId}/minimap/sunsim0_13.jpg`;
|
|
490
|
-
},
|
|
491
|
-
},
|
|
492
|
-
watch: {
|
|
493
|
-
async cdnRoot() {
|
|
494
|
-
await this.loadProjectFiles();
|
|
495
|
-
this.selectInititalInterior();
|
|
496
|
-
await this.loadUnitFiles();
|
|
497
|
-
},
|
|
498
|
-
async projectSlug() {
|
|
499
|
-
await this.loadProjectFiles();
|
|
500
|
-
this.selectInititalInterior();
|
|
501
|
-
await this.loadUnitFiles();
|
|
502
|
-
},
|
|
503
|
-
defaultViewMode: {
|
|
504
|
-
handler(viewMode) {
|
|
505
|
-
if (viewMode === "virtualTour") {
|
|
506
|
-
this.showStaticImage = false;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
if (viewMode === "slideShow") {
|
|
510
|
-
this.showStaticImage = true;
|
|
511
|
-
this.showUI = true;
|
|
512
|
-
}
|
|
513
|
-
},
|
|
514
|
-
immediate: true,
|
|
515
|
-
},
|
|
516
|
-
minimapJSON(newMinimapJSON) {
|
|
517
|
-
if (newMinimapJSON.storeys[this.storey]) {
|
|
518
|
-
const defaultBackgroundImage =
|
|
519
|
-
newMinimapJSON.storeys[this.storey].defaultSunsimFile;
|
|
520
|
-
|
|
521
|
-
this.minimapBackgroundImage = `${this.projectRoot}/${this.interiorId}/${this.apartmentId}/minimap/${defaultBackgroundImage}`;
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
},
|
|
525
|
-
async mounted() {
|
|
526
|
-
try {
|
|
527
|
-
await this.loadProjectFiles();
|
|
528
|
-
this.selectInititalInterior();
|
|
529
|
-
await this.loadUnitFiles();
|
|
530
|
-
this.fullScreen.setup();
|
|
531
|
-
this.setupScrollevents();
|
|
532
|
-
} catch (e) {
|
|
533
|
-
this.error = true;
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
methods: {
|
|
537
|
-
async loadProjectFiles() {
|
|
538
|
-
this.configJSON = await this.loadConfigJSON(this.projectRoot);
|
|
539
|
-
},
|
|
540
|
-
async loadUnitFiles() {
|
|
541
|
-
this.apartmentJSON = await this.loadApartmentJSON(
|
|
542
|
-
this.projectRoot,
|
|
543
|
-
this.interiorId,
|
|
544
|
-
this.apartmentId
|
|
545
|
-
);
|
|
546
|
-
if (this.apartmentJSON) {
|
|
547
|
-
this.currentCameraId = this.apartmentJSON.cameras.find(() => true).id;
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
this.thumbsJSON = await this.loadThumbsJSON(
|
|
551
|
-
this.projectRoot,
|
|
552
|
-
this.interiorId,
|
|
553
|
-
this.apartmentId
|
|
554
|
-
);
|
|
555
|
-
|
|
556
|
-
if (this.thumbsJSON) {
|
|
557
|
-
let defaultWaypointIndex =
|
|
558
|
-
this.defaultWaypointIndex !== null ? this.defaultWaypointIndex : 0;
|
|
559
|
-
|
|
560
|
-
this.currentThumbnailIndex = defaultWaypointIndex;
|
|
561
|
-
this.currentCameraId = this.thumbsJSON.cameras[defaultWaypointIndex].id;
|
|
562
|
-
this.playerCamera = this.thumbsJSON.cameras[defaultWaypointIndex].id;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
if (this.showMiniMap) {
|
|
566
|
-
this.minimapJSON = await this.loadminimapJSON(
|
|
567
|
-
this.projectRoot,
|
|
568
|
-
this.interiorId,
|
|
569
|
-
this.apartmentId
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
|
-
selectInititalInterior() {
|
|
574
|
-
let initialInteriorId = this.defaultInteriorId;
|
|
575
|
-
|
|
576
|
-
if (!initialInteriorId) {
|
|
577
|
-
initialInteriorId = this.configJSON.defaultArchetypeID;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
if (
|
|
581
|
-
this.validInteriorIds.length &&
|
|
582
|
-
!this.validInteriorIds.includes(initialInteriorId)
|
|
583
|
-
) {
|
|
584
|
-
initialInteriorId = this.validInteriorIds[0];
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
if (!initialInteriorId) {
|
|
588
|
-
initialInteriorId = this.configJSON.archetypes[0].archetypeID;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
this.selectedInteriorId = initialInteriorId;
|
|
592
|
-
},
|
|
593
|
-
setupScrollevents() {
|
|
594
|
-
const canvas = document.getElementById("main-canvas");
|
|
595
|
-
|
|
596
|
-
canvas.addEventListener("touchmove", handleTouchMove, { passive: false });
|
|
597
|
-
function handleTouchMove(event) {
|
|
598
|
-
event.preventDefault();
|
|
599
|
-
window.scrollBy(0, 0);
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
canvas.addEventListener(
|
|
603
|
-
"mouseenter",
|
|
604
|
-
() => {
|
|
605
|
-
document.addEventListener("wheel", handleMouseWheel, {
|
|
606
|
-
passive: false,
|
|
607
|
-
});
|
|
608
|
-
},
|
|
609
|
-
{ passive: false }
|
|
610
|
-
);
|
|
611
|
-
|
|
612
|
-
canvas.addEventListener(
|
|
613
|
-
"mouseleave",
|
|
614
|
-
() => {
|
|
615
|
-
document.removeEventListener("wheel", handleMouseWheel, {
|
|
616
|
-
passive: false,
|
|
617
|
-
});
|
|
618
|
-
},
|
|
619
|
-
{ passive: false }
|
|
620
|
-
);
|
|
621
|
-
|
|
622
|
-
function handleMouseWheel(event) {
|
|
623
|
-
event.preventDefault();
|
|
624
|
-
window.scrollBy(0, 0);
|
|
625
|
-
}
|
|
626
|
-
},
|
|
627
|
-
async loadConfigJSON(projectRoot) {
|
|
628
|
-
try {
|
|
629
|
-
const config = await this.loadFile(`${projectRoot}/config.json`);
|
|
630
|
-
return config;
|
|
631
|
-
} catch (e) {
|
|
632
|
-
console.error(
|
|
633
|
-
"Error loading config.json - ",
|
|
634
|
-
`${projectRoot}/config.json`,
|
|
635
|
-
e
|
|
636
|
-
);
|
|
637
|
-
return undefined;
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
async loadApartmentJSON(projectRoot, interiorId, apartmentId) {
|
|
641
|
-
try {
|
|
642
|
-
const apartmentJSON = await this.loadFile(
|
|
643
|
-
`${projectRoot}/${interiorId}/${apartmentId}/apartment.json`
|
|
644
|
-
);
|
|
645
|
-
return apartmentJSON;
|
|
646
|
-
} catch (e) {
|
|
647
|
-
console.error(
|
|
648
|
-
"Error loading apartment.json - ",
|
|
649
|
-
`${projectRoot}/${interiorId}/${apartmentId}/apartment.json`,
|
|
650
|
-
e
|
|
651
|
-
);
|
|
652
|
-
return undefined;
|
|
653
|
-
}
|
|
654
|
-
},
|
|
655
|
-
async loadThumbsJSON(projectRoot, interiorId, apartmentId) {
|
|
656
|
-
try {
|
|
657
|
-
const thumbsJSON = await this.loadFile(
|
|
658
|
-
`${projectRoot}/${interiorId}/${apartmentId}/thumbs.json`
|
|
659
|
-
);
|
|
660
|
-
return thumbsJSON;
|
|
661
|
-
} catch (e) {
|
|
662
|
-
console.error(
|
|
663
|
-
"Error loading thumbs.json - ",
|
|
664
|
-
`${projectRoot}/${interiorId}/${apartmentId}/thumbs.json`
|
|
665
|
-
);
|
|
666
|
-
return undefined;
|
|
667
|
-
}
|
|
668
|
-
},
|
|
669
|
-
async loadminimapJSON(projectRoot, interiorId, apartmentId) {
|
|
670
|
-
try {
|
|
671
|
-
const minimapJSON = await this.loadFile(
|
|
672
|
-
`${projectRoot}/${interiorId}/${apartmentId}/minimap/minimap.json`
|
|
673
|
-
);
|
|
674
|
-
return minimapJSON;
|
|
675
|
-
} catch (e) {
|
|
676
|
-
console.error(
|
|
677
|
-
"Error loading minimap.json - ",
|
|
678
|
-
`${projectRoot}/${interiorId}/${apartmentId}/minimap/minimap.json`
|
|
679
|
-
);
|
|
680
|
-
return undefined;
|
|
681
|
-
}
|
|
682
|
-
},
|
|
683
|
-
selectInterior() {
|
|
684
|
-
if (this.defaultInteriorId) {
|
|
685
|
-
this.selectedInteriorId = this.defaultInteriorId;
|
|
686
|
-
} else {
|
|
687
|
-
this.selectedInteriorId = this.configJSON.defaultArchetypeID;
|
|
688
|
-
}
|
|
689
|
-
},
|
|
690
|
-
nextCamera() {
|
|
691
|
-
let newIndex = this.currentThumbnailIndex + 1;
|
|
692
|
-
if (newIndex >= this.thumbnails.length) newIndex = 0;
|
|
693
|
-
this.currentThumbnailIndex = newIndex;
|
|
694
|
-
this.setCurrentCamera(this.thumbnails[this.currentThumbnailIndex].id);
|
|
695
|
-
},
|
|
696
|
-
previousCamera() {
|
|
697
|
-
let newIndex = this.currentThumbnailIndex - 1;
|
|
698
|
-
if (newIndex < 0) newIndex = this.thumbnails.length - 1;
|
|
699
|
-
this.currentThumbnailIndex = newIndex;
|
|
700
|
-
this.setCurrentCamera(this.thumbnails[this.currentThumbnailIndex].id);
|
|
701
|
-
},
|
|
702
|
-
goToCamera(cameraId, updatePlayerCamera = true) {
|
|
703
|
-
let newIndex = this.thumbnails.findIndex((item) => item.id === cameraId);
|
|
704
|
-
|
|
705
|
-
if (newIndex != -1) {
|
|
706
|
-
this.currentThumbnailIndex = newIndex;
|
|
707
|
-
if (updatePlayerCamera) {
|
|
708
|
-
this.setCurrentCamera(cameraId);
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
setCurrentCamera(cameraId) {
|
|
713
|
-
this.currentCameraId = cameraId;
|
|
714
|
-
},
|
|
715
|
-
updateSelectedInterior(value) {
|
|
716
|
-
this.selectedInteriorId = value;
|
|
717
|
-
this.$emit("on-interior-update", value);
|
|
718
|
-
this.$emit("on-camera-update", this.playerCamera, this.apartmentJSON);
|
|
719
|
-
},
|
|
720
|
-
newCameraCallback(cameraId) {
|
|
721
|
-
this.goToCamera(cameraId, false);
|
|
722
|
-
this.playerCamera = cameraId;
|
|
723
|
-
this.$emit("on-camera-update", cameraId, this.apartmentJSON);
|
|
724
|
-
},
|
|
725
|
-
newRotationCallback(rotation) {
|
|
726
|
-
this.rotation = rotation;
|
|
727
|
-
},
|
|
728
|
-
newfloorCallback(floor) {
|
|
729
|
-
this.floorLevel = floor;
|
|
730
|
-
},
|
|
731
|
-
newFoVCallback(fov) {
|
|
732
|
-
this.fov = fov;
|
|
733
|
-
},
|
|
734
|
-
newSizeCallback(width, height) {
|
|
735
|
-
// console.log('new size - ', width, height)
|
|
736
|
-
},
|
|
737
|
-
playerApiCallback(api) {
|
|
738
|
-
this.playerApi = api;
|
|
739
|
-
|
|
740
|
-
if (this.playerSettings) {
|
|
741
|
-
this.playerApi.updateSettings(this.playerSettings);
|
|
742
|
-
}
|
|
743
|
-
},
|
|
744
|
-
toggleFullscreen() {
|
|
745
|
-
this.fullScreen.toggle();
|
|
746
|
-
window.scrollTo({ top: 150, behavior: "smooth" });
|
|
747
|
-
},
|
|
748
|
-
toggleViewMode() {
|
|
749
|
-
this.showStaticImage = !this.showStaticImage;
|
|
750
|
-
},
|
|
751
|
-
setMinimapBackgroundImage(image) {
|
|
752
|
-
this.minimapBackgroundImage = image;
|
|
753
|
-
},
|
|
754
|
-
async takeSnapshot() {
|
|
755
|
-
const radiansToDegrees = 180 / Math.PI;
|
|
756
|
-
|
|
757
|
-
const photo = await this.playerApi.takePhoto();
|
|
758
|
-
const rotationEuler = this.playerApi.getRotationEuler();
|
|
759
|
-
const currentCamera = this.playerApi.getCurrentCamera();
|
|
760
|
-
const snapshot = new CameraSnapshot(photo, currentCamera);
|
|
761
|
-
const rotation = [
|
|
762
|
-
rotationEuler.x * radiansToDegrees,
|
|
763
|
-
rotationEuler.y * radiansToDegrees,
|
|
764
|
-
rotationEuler.z * radiansToDegrees,
|
|
765
|
-
];
|
|
766
|
-
|
|
767
|
-
this.$emit("on-snapshot", snapshot, rotation);
|
|
768
|
-
return snapshot;
|
|
769
|
-
},
|
|
770
|
-
getURL(url) {
|
|
771
|
-
let returnUrl = url;
|
|
772
|
-
if (this.localMode) {
|
|
773
|
-
returnUrl = `${this.fileLoader.getURL(url)}`;
|
|
774
|
-
} else {
|
|
775
|
-
if (this.adminMode) {
|
|
776
|
-
returnUrl = returnUrl + `?v=${Date.now()}`;
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
return returnUrl;
|
|
781
|
-
},
|
|
782
|
-
async loadFile(path) {
|
|
783
|
-
const url = this.getURL(path);
|
|
784
|
-
return await loadFile(url);
|
|
785
|
-
},
|
|
786
|
-
updateSetting(settings) {
|
|
787
|
-
this.playerApi.updateSettings(settings);
|
|
788
|
-
},
|
|
789
|
-
saveSettings(settings) {
|
|
790
|
-
this.$emit("save-settings", settings);
|
|
791
|
-
},
|
|
792
|
-
},
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
function parseTimeOfDay(floatValue) {
|
|
796
|
-
if (floatValue === undefined) return null;
|
|
797
|
-
|
|
798
|
-
const hours = Math.floor(floatValue);
|
|
799
|
-
const minutes = Math.floor((hours - floatValue) * 60);
|
|
800
|
-
return { hours, minutes };
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
async function loadFile(url) {
|
|
804
|
-
try {
|
|
805
|
-
const file = await axios.get(url);
|
|
806
|
-
return file.data;
|
|
807
|
-
} catch (e) {
|
|
808
|
-
console.error(e);
|
|
809
|
-
throw new Error(e);
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
|
|
813
|
-
function removeTrailingSlashes(site) {
|
|
814
|
-
return site.replace(/\/$/, "");
|
|
815
|
-
}
|
|
816
|
-
</script>
|
|
817
|
-
<style scoped>
|
|
818
|
-
.compass-wrapper {
|
|
819
|
-
width: 50px;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
.player-and-components-wrapper {
|
|
823
|
-
position: relative;
|
|
824
|
-
}
|
|
825
|
-
|
|
826
|
-
.static-image {
|
|
827
|
-
position: absolute;
|
|
828
|
-
top: 0;
|
|
829
|
-
left: 0;
|
|
830
|
-
width: 100%;
|
|
831
|
-
height: auto;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
button.v-btn {
|
|
835
|
-
background: #fff;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.waypoint-carousel.full-screen {
|
|
839
|
-
scale: 0.5;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
div#controls-bottom-center > div {
|
|
843
|
-
display: flex;
|
|
844
|
-
flex-direction: column;
|
|
845
|
-
align-items: center;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
.player-error {
|
|
849
|
-
min-height: 400px;
|
|
850
|
-
display: flex;
|
|
851
|
-
align-items: center;
|
|
852
|
-
justify-content: space-around;
|
|
853
|
-
background: #ededed;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
@media only screen and (max-width: 600px) {
|
|
857
|
-
#btn-fullscreen {
|
|
858
|
-
display: none;
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
@media all and (orientation: landscape) and (max-height: 499px) {
|
|
862
|
-
#btn-fullscreen {
|
|
863
|
-
display: none;
|
|
864
|
-
}
|
|
865
|
-
}
|
|
866
|
-
.settings-panel {
|
|
867
|
-
position: absolute;
|
|
868
|
-
top: 0px;
|
|
869
|
-
left: 0px;
|
|
870
|
-
z-index: 10;
|
|
871
|
-
width: 500px;
|
|
872
|
-
transform: scale(0.8);
|
|
873
|
-
transform-origin: left;
|
|
874
|
-
}
|
|
875
|
-
</style>
|