@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,414 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="error"
|
|
4
|
+
style="height: 50vh"
|
|
5
|
+
class="d-flex justify-center align-center blue-grey lighten-5"
|
|
6
|
+
>
|
|
7
|
+
<v-icon x-large>mdi-alert-circle-outline</v-icon>
|
|
8
|
+
</div>
|
|
9
|
+
<div
|
|
10
|
+
v-else-if="pickerData"
|
|
11
|
+
:style="`height: ${canvasDimensions.height}px; position: relative`"
|
|
12
|
+
class="image-container"
|
|
13
|
+
>
|
|
14
|
+
<qi-zoom-box :desktop="interactiveDesktop" :mobile="interactiveMobile">
|
|
15
|
+
<div class="image-instances">
|
|
16
|
+
<qi-building-chooser-scene-image-stack
|
|
17
|
+
:image-urls="daysOfYear.imageUrls"
|
|
18
|
+
:active-index="halfHourMark"
|
|
19
|
+
@resize="resizeScene"
|
|
20
|
+
@preloaded="sceneState.preloaded = true"
|
|
21
|
+
@ready="sceneState.ready = true"
|
|
22
|
+
@reset="sceneReset"
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<div v-if="svgObjects" v-show="sceneState.preloaded">
|
|
26
|
+
<div class="svg-container">
|
|
27
|
+
<svg :viewBox="svgViewBox">
|
|
28
|
+
<g
|
|
29
|
+
v-for="({ id, svg }, index) of svgObjects"
|
|
30
|
+
:key="index"
|
|
31
|
+
v-html="svg"
|
|
32
|
+
:data-building-id="id"
|
|
33
|
+
:class="getGClass(id)"
|
|
34
|
+
:style="getGStyle(id)"
|
|
35
|
+
@mouseover="onBuildingMouseOver($event, id)"
|
|
36
|
+
@mouseout="onBuildingMouseOut($event, id)"
|
|
37
|
+
@mousemove="onBuildingMouseMove($event, id)"
|
|
38
|
+
@click="onBuildingClick(id)"
|
|
39
|
+
/>
|
|
40
|
+
</svg>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
v-show="sceneState.preloaded"
|
|
45
|
+
class="custom-overlay-layer"
|
|
46
|
+
v-html="customOverlayContent"
|
|
47
|
+
></div>
|
|
48
|
+
</div>
|
|
49
|
+
</qi-zoom-box>
|
|
50
|
+
<div v-show="sceneState.preloaded">
|
|
51
|
+
<qi-north-direction
|
|
52
|
+
v-if="pickerData.sceneLongitude"
|
|
53
|
+
class="north-indicator"
|
|
54
|
+
:longitude="pickerData.sceneLongitude"
|
|
55
|
+
/>
|
|
56
|
+
<qi-building-chooser-sun-sim-control
|
|
57
|
+
v-model="halfHourMark"
|
|
58
|
+
:date-selector="daysOfYear"
|
|
59
|
+
:is-loading="!sceneState.ready"
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
<template v-if="showCards && hoverBuilding">
|
|
63
|
+
<qi-floating-card
|
|
64
|
+
:is-hoverable="isHoverable"
|
|
65
|
+
:pos="pos"
|
|
66
|
+
@outside="() => (hoverBuildingId = undefined)"
|
|
67
|
+
>
|
|
68
|
+
<slot
|
|
69
|
+
:building="hoverBuilding"
|
|
70
|
+
:can-go-to-building="canGoToBuildingCallback(hoverBuilding)"
|
|
71
|
+
:go-to-building="
|
|
72
|
+
() =>
|
|
73
|
+
canGoToBuildingCallback(hoverBuilding) &&
|
|
74
|
+
$emit('go-to-building', hoverBuilding)
|
|
75
|
+
"
|
|
76
|
+
:pos="pos"
|
|
77
|
+
:is-hoverable="isHoverable"
|
|
78
|
+
:close="() => (hoverBuildingId = undefined)"
|
|
79
|
+
/>
|
|
80
|
+
</qi-floating-card>
|
|
81
|
+
</template>
|
|
82
|
+
<qi-hover-probe ref="hoverProbe" />
|
|
83
|
+
</div>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
import { defineComponent, ref } from "vue";
|
|
88
|
+
import QiNorthDirection from "@/components/shared/QiNorthDirection.vue";
|
|
89
|
+
import QiBuildingChooserSunSimControl from "./QiBuildingChooserSunSimControl.vue";
|
|
90
|
+
import QiBuildingChooserSceneImageStack from "./QiBuildingChooserSceneImageStack.vue";
|
|
91
|
+
import QiFloatingCard from "@/components/shared/QiFloatingCard.vue";
|
|
92
|
+
import QiHoverProbe from "@/components/shared/QiHoverProbe.vue";
|
|
93
|
+
import QiZoomBox from "@/components/shared/QiZoomBox.vue";
|
|
94
|
+
import { ResourceLoader } from "@/lib/shared/ResourceLoader.js";
|
|
95
|
+
import { BuildingPickerResourceProvider } from "@/lib/buildingPicker/BuildingPickerResourceProvider.js";
|
|
96
|
+
import { BuildingMap } from "@/lib/buildingPicker/BuildingMap.js";
|
|
97
|
+
import { CanvasRaster } from "@/lib/buildingPicker/CanvasRaster.js";
|
|
98
|
+
import { DayOfYearSelector } from "@/lib/buildingPicker/DayOfYearSelector.js";
|
|
99
|
+
import { I18N } from "@/lib/shared/I18N";
|
|
100
|
+
|
|
101
|
+
export default defineComponent({
|
|
102
|
+
setup() {
|
|
103
|
+
const daysOfYear = ref({});
|
|
104
|
+
},
|
|
105
|
+
name: "QiBuildingChooserSvg",
|
|
106
|
+
components: {
|
|
107
|
+
QiBuildingChooserSunSimControl,
|
|
108
|
+
QiBuildingChooserSceneImageStack,
|
|
109
|
+
QiNorthDirection,
|
|
110
|
+
QiFloatingCard,
|
|
111
|
+
QiHoverProbe,
|
|
112
|
+
QiZoomBox,
|
|
113
|
+
},
|
|
114
|
+
emits: ["go-to-building", "hover-over-building", "hover-out-building"],
|
|
115
|
+
provide() {
|
|
116
|
+
const localizer = this.i18n
|
|
117
|
+
? new I18N(this.i18n.labels, this.i18n.language)
|
|
118
|
+
: new I18N();
|
|
119
|
+
return {
|
|
120
|
+
i18n: localizer,
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
props: {
|
|
124
|
+
showCards: { type: Boolean, default: () => true },
|
|
125
|
+
colorCallback: {
|
|
126
|
+
type: Function,
|
|
127
|
+
default: () => ({ r: 108, g: 0, b: 108, a: 144, s: 2 }),
|
|
128
|
+
},
|
|
129
|
+
buildingCallback: { type: Function, default: (buildingId) => buildingId },
|
|
130
|
+
canGoToBuildingCallback: { type: Function, default: () => true },
|
|
131
|
+
buildingChooserTimeOfDay: { type: String, default: null },
|
|
132
|
+
cdnFileResolver: { type: Function, required: true },
|
|
133
|
+
i18n: { type: Object, default: undefined },
|
|
134
|
+
interactiveDesktop: { type: Boolean, default: true },
|
|
135
|
+
interactiveMobile: { type: Boolean, default: true },
|
|
136
|
+
customOverlayContent: { type: String, default: "" },
|
|
137
|
+
},
|
|
138
|
+
data() {
|
|
139
|
+
return {
|
|
140
|
+
sceneState: { preloaded: false, ready: false },
|
|
141
|
+
canvasDimensions: { width: 0, height: 0 },
|
|
142
|
+
pos: { x: 0, y: 0, width: 0, height: 0 },
|
|
143
|
+
pickerData: undefined,
|
|
144
|
+
hoverBuildingId: undefined,
|
|
145
|
+
halfHourMark:
|
|
146
|
+
new Date().getHours() * 2 + (new Date().getMinutes() < 30 ? 0 : 1),
|
|
147
|
+
error: false,
|
|
148
|
+
resourceLoader: new ResourceLoader(),
|
|
149
|
+
svgObjects: undefined,
|
|
150
|
+
svgViewBox: "0 0 0 0",
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
computed: {
|
|
154
|
+
isHoverable() {
|
|
155
|
+
return this.$refs.hoverProbe.isHoverEnabled;
|
|
156
|
+
},
|
|
157
|
+
hoverBuilding() {
|
|
158
|
+
return this.getBuildingData(this.hoverBuildingId);
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
watch: {
|
|
162
|
+
buildingChooserTimeOfDay: {
|
|
163
|
+
handler() {
|
|
164
|
+
if (this.buildingChooserTimeOfDay) {
|
|
165
|
+
const [_, hour, minutes] = /^(\d\d):(\d\d)$/.exec(
|
|
166
|
+
this.buildingChooserTimeOfDay
|
|
167
|
+
);
|
|
168
|
+
const ms = parseInt(minutes);
|
|
169
|
+
this.halfHourMark =
|
|
170
|
+
parseInt(hour) * 2 + (ms < 15 ? 0 : ms > 45 ? 2 : 1);
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
immediate: true,
|
|
174
|
+
},
|
|
175
|
+
hoverBuildingId(current, prev) {
|
|
176
|
+
if (current) {
|
|
177
|
+
this.$emit("hover-over-building", this.getBuildingData(current));
|
|
178
|
+
} else {
|
|
179
|
+
this.$emit("hover-out-building", this.getBuildingData(prev));
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
async mounted() {
|
|
184
|
+
const resourceProvider = new BuildingPickerResourceProvider(
|
|
185
|
+
this.cdnFileResolver
|
|
186
|
+
);
|
|
187
|
+
const configData = await resourceProvider.loadBuildingChooser();
|
|
188
|
+
|
|
189
|
+
if (configData) {
|
|
190
|
+
this.canvasRaster = new CanvasRaster(configData.mapImage);
|
|
191
|
+
this.buildingMap = new BuildingMap(configData.buildingIds);
|
|
192
|
+
this.daysOfYear = new DayOfYearSelector(configData.backgrounds);
|
|
193
|
+
this.pickerData = {
|
|
194
|
+
buildingOverlays: configData.buildingOverlays,
|
|
195
|
+
sceneLongitude: configData.viewLongitude,
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const svgObjects = [];
|
|
199
|
+
for (let { id, url } of configData.buildingOverlays) {
|
|
200
|
+
this.resourceLoader
|
|
201
|
+
.loadJson(url.replace(".png", ".svg"))
|
|
202
|
+
.then((markup) => {
|
|
203
|
+
const parser = new DOMParser();
|
|
204
|
+
const dom = parser
|
|
205
|
+
.parseFromString(markup, "image/svg+xml")
|
|
206
|
+
.getElementsByTagName("svg")[0];
|
|
207
|
+
this.svgViewBox = dom.getAttribute("viewBox");
|
|
208
|
+
svgObjects.push({
|
|
209
|
+
id,
|
|
210
|
+
svg: dom.innerHTML,
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
this.svgObjects = svgObjects;
|
|
215
|
+
} else {
|
|
216
|
+
this.error = true;
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
methods: {
|
|
220
|
+
resizeScene({ width, height }) {
|
|
221
|
+
this.canvasDimensions.width = width;
|
|
222
|
+
this.canvasDimensions.height = height;
|
|
223
|
+
},
|
|
224
|
+
sceneReset() {
|
|
225
|
+
this.sceneState = { preloaded: false, ready: false };
|
|
226
|
+
},
|
|
227
|
+
getBuildingData(buildingId) {
|
|
228
|
+
return this.buildingCallback
|
|
229
|
+
? this.buildingCallback(buildingId)
|
|
230
|
+
: buildingId;
|
|
231
|
+
},
|
|
232
|
+
getColor(buildingId) {
|
|
233
|
+
return this.colorCallback(
|
|
234
|
+
this.getBuildingData(buildingId),
|
|
235
|
+
buildingId === this.hoverBuildingId ? "hover" : "idle"
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
getGClass(buildingId) {
|
|
239
|
+
const building = this.getBuildingData(buildingId);
|
|
240
|
+
const color = this.colorCallback(
|
|
241
|
+
building,
|
|
242
|
+
buildingId === this.hoverBuildingId ? "hover" : "idle"
|
|
243
|
+
);
|
|
244
|
+
const classes = [];
|
|
245
|
+
if (buildingId === this.hoverBuildingId) {
|
|
246
|
+
classes.push("hover");
|
|
247
|
+
} else {
|
|
248
|
+
classes.push("idle");
|
|
249
|
+
}
|
|
250
|
+
if (color && this.canGoToBuildingCallback(building)) {
|
|
251
|
+
classes.push("clickable");
|
|
252
|
+
} else {
|
|
253
|
+
classes.push("restricted");
|
|
254
|
+
}
|
|
255
|
+
return classes.join(" ");
|
|
256
|
+
},
|
|
257
|
+
getGStyle(buildingId) {
|
|
258
|
+
const building = this.getBuildingData(buildingId);
|
|
259
|
+
const color = this.colorCallback(
|
|
260
|
+
building,
|
|
261
|
+
buildingId === this.hoverBuildingId ? "hover" : "idle"
|
|
262
|
+
);
|
|
263
|
+
if (color) {
|
|
264
|
+
const { r, g, b, a, s } = color;
|
|
265
|
+
return {
|
|
266
|
+
strokeWidth: s !== undefined ? s : 2,
|
|
267
|
+
stroke: `rgb(${r}, ${g}, ${b})`,
|
|
268
|
+
strokeOpacity: 1,
|
|
269
|
+
fill: `rgb(${r}, ${g}, ${b})`,
|
|
270
|
+
fillOpacity: a / 255,
|
|
271
|
+
cursor: `${
|
|
272
|
+
this.canGoToBuildingCallback(building) ? "cursor" : "default"
|
|
273
|
+
} !important`,
|
|
274
|
+
};
|
|
275
|
+
} else {
|
|
276
|
+
return {
|
|
277
|
+
strokeWidth: 0,
|
|
278
|
+
stroke: "white",
|
|
279
|
+
strokeOpacity: 0,
|
|
280
|
+
fill: "white",
|
|
281
|
+
fillOpacity: 0,
|
|
282
|
+
cursor: "default !important",
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
onBuildingMouseOver(event, id) {
|
|
287
|
+
if (this.isHoverable) {
|
|
288
|
+
this.pos = {
|
|
289
|
+
x: event.layerX,
|
|
290
|
+
y: event.layerY,
|
|
291
|
+
width: this.canvasDimensions.width,
|
|
292
|
+
height: this.canvasDimensions.height,
|
|
293
|
+
};
|
|
294
|
+
this.hoverBuildingId = id;
|
|
295
|
+
this.$emit("hover-over-building", this.getBuildingData(id));
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
onBuildingMouseOut(event, id) {
|
|
299
|
+
if (this.isHoverable) {
|
|
300
|
+
this.pos = {
|
|
301
|
+
x: event.layerX,
|
|
302
|
+
y: event.layerY,
|
|
303
|
+
width: this.canvasDimensions.width,
|
|
304
|
+
height: this.canvasDimensions.height,
|
|
305
|
+
};
|
|
306
|
+
this.hoverBuildingId = undefined;
|
|
307
|
+
this.$emit("hover-out-building", this.getBuildingData(id));
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
onBuildingMouseMove(event) {
|
|
311
|
+
if (this.isHoverable) {
|
|
312
|
+
this.pos = {
|
|
313
|
+
x: event.layerX,
|
|
314
|
+
y: event.layerY,
|
|
315
|
+
width: this.canvasDimensions.width,
|
|
316
|
+
height: this.canvasDimensions.height,
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
onBuildingClick(id) {
|
|
321
|
+
this.hoverBuildingId = id;
|
|
322
|
+
if (
|
|
323
|
+
this.isHoverable &&
|
|
324
|
+
this.hoverBuilding &&
|
|
325
|
+
this.canGoToBuildingCallback(this.hoverBuilding)
|
|
326
|
+
) {
|
|
327
|
+
this.$emit("go-to-building", this.hoverBuilding);
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
</script>
|
|
333
|
+
|
|
334
|
+
<style scoped>
|
|
335
|
+
.north-indicator {
|
|
336
|
+
position: absolute;
|
|
337
|
+
right: 0;
|
|
338
|
+
top: 0;
|
|
339
|
+
height: 42px;
|
|
340
|
+
width: 42px;
|
|
341
|
+
margin-top: 12px;
|
|
342
|
+
margin-right: 8px;
|
|
343
|
+
}
|
|
344
|
+
.image-container {
|
|
345
|
+
position: relative;
|
|
346
|
+
}
|
|
347
|
+
.image-instances {
|
|
348
|
+
position: relative;
|
|
349
|
+
width: 100%;
|
|
350
|
+
height: 100%;
|
|
351
|
+
}
|
|
352
|
+
canvas {
|
|
353
|
+
position: absolute;
|
|
354
|
+
left: 0;
|
|
355
|
+
top: 0;
|
|
356
|
+
z-index: 2;
|
|
357
|
+
opacity: 0;
|
|
358
|
+
}
|
|
359
|
+
.fill-parent {
|
|
360
|
+
position: absolute;
|
|
361
|
+
top: 0;
|
|
362
|
+
bottom: 0;
|
|
363
|
+
left: 0;
|
|
364
|
+
right: 0;
|
|
365
|
+
}
|
|
366
|
+
.svg-container {
|
|
367
|
+
transition-property: opacity;
|
|
368
|
+
transition-duration: 250ms;
|
|
369
|
+
transition-timing-function: ease-in-out;
|
|
370
|
+
}
|
|
371
|
+
.svg-container,
|
|
372
|
+
svg {
|
|
373
|
+
position: absolute;
|
|
374
|
+
left: 0;
|
|
375
|
+
top: 0;
|
|
376
|
+
width: 100%;
|
|
377
|
+
height: 100%;
|
|
378
|
+
z-index: 10000;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
svg g :deep(path) {
|
|
382
|
+
cursor: pointer;
|
|
383
|
+
stroke-width: inherit !important;
|
|
384
|
+
stroke-opacity: inherit !important;
|
|
385
|
+
stroke: inherit !important;
|
|
386
|
+
fill: inherit !important;
|
|
387
|
+
fill-opacity: inherit !important;
|
|
388
|
+
transition-property: fill-opacity, fill;
|
|
389
|
+
transition-duration: 250ms;
|
|
390
|
+
transition-timing-function: ease-in-out;
|
|
391
|
+
}
|
|
392
|
+
svg g.restricted :deep(path) {
|
|
393
|
+
cursor: default !important;
|
|
394
|
+
}
|
|
395
|
+
@media only screen and (max-width: 980px) and (min-width: 500px) and (orientation: landscape) {
|
|
396
|
+
div.image-container {
|
|
397
|
+
margin-top: 44px;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
@media only screen and (max-width: 500px) {
|
|
401
|
+
div.image-container {
|
|
402
|
+
margin-top: 44px;
|
|
403
|
+
margin-bottom: 44px;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* .custom-overlay-layer {
|
|
408
|
+
position: absolute;
|
|
409
|
+
top: 0;
|
|
410
|
+
left: 0;
|
|
411
|
+
width: 100%;
|
|
412
|
+
height: 100%;
|
|
413
|
+
} */
|
|
414
|
+
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as QiBuildingChooser } from './QiBuildingChooser.vue'
|
|
2
|
+
export { default as QiBuildingChooserRasterOverlay } from './QiBuildingChooserRasterOverlay.vue'
|
|
3
|
+
export { default as QiBuildingChooserRaster } from './QiBuildingChooserRaster.vue'
|
|
4
|
+
export { default as QiBuildingChooserSceneImageStack } from './QiBuildingChooserSceneImageStack.vue'
|
|
5
|
+
export { default as QiBuildingChooserSunSimControl } from './QiBuildingChooserSunSimControl.vue'
|
|
6
|
+
export { default as QiBuildingChooserSvg } from './QiBuildingChooserSvg.vue'
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-fade-transition :origin="q.replace('-', ' ') + ' ' + pos.x + ' ' + pos.y">
|
|
3
|
+
<div
|
|
4
|
+
v-if="isHoverable"
|
|
5
|
+
:class="['floating-card', q]"
|
|
6
|
+
:style="{ left: `${pos.x}px`, top: `${pos.y}px`, pointerEvents: 'none' }"
|
|
7
|
+
>
|
|
8
|
+
<slot :is-hoverable="isHoverable" />
|
|
9
|
+
</div>
|
|
10
|
+
<v-dialog
|
|
11
|
+
v-else
|
|
12
|
+
:value="true"
|
|
13
|
+
width="auto"
|
|
14
|
+
@click:outside="$emit('outside', $event)"
|
|
15
|
+
>
|
|
16
|
+
<slot :is-hoverable="isHoverable" />
|
|
17
|
+
</v-dialog>
|
|
18
|
+
</v-fade-transition>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: 'FloatingCard',
|
|
24
|
+
props: {
|
|
25
|
+
pos: { type: Object, required: true },
|
|
26
|
+
isHoverable: Boolean,
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
q() {
|
|
30
|
+
const qh = this.pos.x <= this.pos.width / 2 ? 'left' : 'right'
|
|
31
|
+
const qv = this.pos.y <= this.pos.height / 2 ? 'top' : 'bottom'
|
|
32
|
+
return `${qv}-${qh}`
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style scoped>
|
|
39
|
+
.floating-card {
|
|
40
|
+
position: absolute;
|
|
41
|
+
left: 0;
|
|
42
|
+
top: 0;
|
|
43
|
+
z-index: 10;
|
|
44
|
+
display: flex;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.is-not-hoverable {
|
|
48
|
+
position: relative;
|
|
49
|
+
width: 100%;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.top-left {
|
|
53
|
+
transform-origin: top left;
|
|
54
|
+
transform: translateX(8px) translateY(8px) scale(0.9);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.top-right {
|
|
58
|
+
transform-origin: top right;
|
|
59
|
+
transform: translateX(-100%) translateX(-8px) translateY(8px) scale(0.9);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.bottom-left {
|
|
63
|
+
transform-origin: bottom left;
|
|
64
|
+
transform: translateY(-100%) translateX(8px) translateY(-8px) scale(0.9);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.bottom-right {
|
|
68
|
+
transform-origin: bottom right;
|
|
69
|
+
transform: translateY(-100%) translateX(-100%) translateX(-8px)
|
|
70
|
+
translateY(-8px) scale(0.9);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.v-dialog__content {
|
|
74
|
+
align-items: flex-start;
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="hoverCheck" class="hover-check" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
export default {
|
|
7
|
+
name: 'QiHoverProbe',
|
|
8
|
+
computed: {
|
|
9
|
+
isHoverEnabled() {
|
|
10
|
+
return window.getComputedStyle(this.$refs.hoverCheck).display === 'none'
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
@media (hover: hover) {
|
|
18
|
+
.hover-check {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-img :src="compassNeedle" :style="needleRotation" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import compassNeedle from '@/lib/virtualTour/textures/compass-north.png'
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
name: 'QiNorthDirection',
|
|
10
|
+
props: {
|
|
11
|
+
longitude: { type: Number, default: () => 0 },
|
|
12
|
+
},
|
|
13
|
+
data() {
|
|
14
|
+
return {
|
|
15
|
+
compassNeedle: compassNeedle,
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
needleRotation() {
|
|
20
|
+
return {
|
|
21
|
+
transform: `rotate(${90 - this.longitude}deg)`,
|
|
22
|
+
transition: ` transform 0.5s ease-in`,
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
</script>
|