@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.
Files changed (160) hide show
  1. package/README.md +18 -0
  2. package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts +4 -0
  3. package/dist/components/apartmentChooser/QiApartmentChooser.vue.d.ts.map +1 -0
  4. package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts +4 -0
  5. package/dist/components/apartmentChooser/QiApartmentChooserNavigation.vue.d.ts.map +1 -0
  6. package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts +4 -0
  7. package/dist/components/apartmentChooser/QiApartmentChooserRaster.vue.d.ts.map +1 -0
  8. package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts +4 -0
  9. package/dist/components/apartmentChooser/QiApartmentChooserRotator.vue.d.ts.map +1 -0
  10. package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts +4 -0
  11. package/dist/components/apartmentChooser/QiApartmentChooserSvg.vue.d.ts.map +1 -0
  12. package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts +3 -0
  13. package/dist/components/buildingPicker/QiBuildingChooser.vue.d.ts.map +1 -0
  14. package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts +4 -0
  15. package/dist/components/buildingPicker/QiBuildingChooserRaster.vue.d.ts.map +1 -0
  16. package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts +4 -0
  17. package/dist/components/buildingPicker/QiBuildingChooserRasterOverlay.vue.d.ts.map +1 -0
  18. package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts +4 -0
  19. package/dist/components/buildingPicker/QiBuildingChooserSceneImageStack.vue.d.ts.map +1 -0
  20. package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts +5 -0
  21. package/dist/components/buildingPicker/QiBuildingChooserSunSimControl.vue.d.ts.map +1 -0
  22. package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts +4 -0
  23. package/dist/components/buildingPicker/QiBuildingChooserSvg.vue.d.ts.map +1 -0
  24. package/dist/components/index.d.ts +4 -0
  25. package/dist/components/shared/QiFloatingCard.vue.d.ts +4 -0
  26. package/dist/components/shared/QiFloatingCard.vue.d.ts.map +1 -0
  27. package/dist/components/shared/QiHoverProbe.vue.d.ts +4 -0
  28. package/dist/components/shared/QiHoverProbe.vue.d.ts.map +1 -0
  29. package/dist/components/shared/QiNorthDirection.vue.d.ts +3 -0
  30. package/dist/components/shared/QiNorthDirection.vue.d.ts.map +1 -0
  31. package/dist/components/shared/QiZoomBox.vue.d.ts +4 -0
  32. package/dist/components/shared/QiZoomBox.vue.d.ts.map +1 -0
  33. package/dist/components/virtualTourV2/Disclaimer.vue.d.ts +4 -0
  34. package/dist/components/virtualTourV2/Disclaimer.vue.d.ts.map +1 -0
  35. package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts +3 -0
  36. package/dist/components/virtualTourV2/FullScreenButton.vue.d.ts.map +1 -0
  37. package/dist/components/virtualTourV2/ManualSlideShow.vue.d.ts +4 -0
  38. package/dist/components/virtualTourV2/ManualSlideShow.vue.d.ts.map +1 -0
  39. package/dist/components/virtualTourV2/ManualSlideShowPlayer.vue.d.ts +4 -0
  40. package/dist/components/virtualTourV2/ManualSlideShowPlayer.vue.d.ts.map +1 -0
  41. package/dist/components/virtualTourV2/SingleImage.vue.d.ts +4 -0
  42. package/dist/components/virtualTourV2/SingleImage.vue.d.ts.map +1 -0
  43. package/dist/components/virtualTourV2/SocialShare.vue.d.ts +4 -0
  44. package/dist/components/virtualTourV2/SocialShare.vue.d.ts.map +1 -0
  45. package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts +4 -0
  46. package/dist/components/virtualTourV2/WaypointCarousel.vue.d.ts.map +1 -0
  47. package/dist/lib/virtualTour__/ApartmentConfig.d.ts +27 -0
  48. package/dist/lib/virtualTour__/ApartmentFiles.d.ts +7 -0
  49. package/dist/lib/virtualTour__/MinimapConfig.d.ts +23 -0
  50. package/dist/lib/virtualTour__/impl/HttpApartmentFiles.d.ts +19 -0
  51. package/dist/vue3-player.cjs.js +2 -0
  52. package/dist/vue3-player.esm.js +2992 -0
  53. package/dist/vue3-player.iife.js +3 -0
  54. package/dist/vue3-player.umd.js +3 -0
  55. package/package.json +65 -0
  56. package/src/components/apartmentChooser/QiApartmentChooser.vue +319 -0
  57. package/src/components/apartmentChooser/QiApartmentChooserNavigation.vue +88 -0
  58. package/src/components/apartmentChooser/QiApartmentChooserRaster.vue +408 -0
  59. package/src/components/apartmentChooser/QiApartmentChooserRotator.vue +202 -0
  60. package/src/components/apartmentChooser/QiApartmentChooserSvg.vue +257 -0
  61. package/src/components/apartmentChooser/index.js +5 -0
  62. package/src/components/buildingPicker/QiBuildingChooser.vue +61 -0
  63. package/src/components/buildingPicker/QiBuildingChooserRaster.vue +312 -0
  64. package/src/components/buildingPicker/QiBuildingChooserRasterOverlay.vue +96 -0
  65. package/src/components/buildingPicker/QiBuildingChooserSceneImageStack.vue +89 -0
  66. package/src/components/buildingPicker/QiBuildingChooserSunSimControl.vue +257 -0
  67. package/src/components/buildingPicker/QiBuildingChooserSvg.vue +414 -0
  68. package/src/components/buildingPicker/index.js +6 -0
  69. package/src/components/index.ts +4 -0
  70. package/src/components/shared/QiFloatingCard.vue +76 -0
  71. package/src/components/shared/QiHoverProbe.vue +22 -0
  72. package/src/components/shared/QiNorthDirection.vue +27 -0
  73. package/src/components/shared/QiZoomBox.vue +322 -0
  74. package/src/components/shared/index.js +4 -0
  75. package/src/components/virtualTourV2/Compass.vue +37 -0
  76. package/src/components/virtualTourV2/Disclaimer.vue +41 -0
  77. package/src/components/virtualTourV2/FloorLevel.vue +73 -0
  78. package/src/components/virtualTourV2/FullScreenButton.vue +23 -0
  79. package/src/components/virtualTourV2/InteriorSelector.vue +90 -0
  80. package/src/components/virtualTourV2/ManualSlideShow.vue +198 -0
  81. package/src/components/virtualTourV2/ManualSlideShowPlayer.vue +159 -0
  82. package/src/components/virtualTourV2/PlayerV2.vue +300 -0
  83. package/src/components/virtualTourV2/ScrollHelper.vue +74 -0
  84. package/src/components/virtualTourV2/SettingsUI.vue +355 -0
  85. package/src/components/virtualTourV2/SingleImage.vue +36 -0
  86. package/src/components/virtualTourV2/SocialShare.vue +163 -0
  87. package/src/components/virtualTourV2/TimeOfDay.vue +50 -0
  88. package/src/components/virtualTourV2/Tutorial.vue +690 -0
  89. package/src/components/virtualTourV2/ViewModeToggle.vue +24 -0
  90. package/src/components/virtualTourV2/VirtualTourV2.vue +876 -0
  91. package/src/components/virtualTourV2/WaypointCarousel.vue +162 -0
  92. package/src/components/virtualTourV2/index.js +1 -0
  93. package/src/components/virtualTourV2/minimapv2/MiniMapMap.vue +262 -0
  94. package/src/components/virtualTourV2/minimapv2/MiniMapV2.vue +110 -0
  95. package/src/components/virtualTourV2/minimapv2/MinimapCompass.vue +39 -0
  96. package/src/components/virtualTourV2/minimapv2/Moveable.vue +208 -0
  97. package/src/components/virtualTourV2/minimapv2/RotationMarkerV2.vue +79 -0
  98. package/src/components/virtualTourV2/minimapv2/SunsimulationSlider.vue +203 -0
  99. package/src/components/virtualTourV2/minimapv2/index.js +1 -0
  100. package/src/entry.esm.js +17 -0
  101. package/src/entry.js +13 -0
  102. package/src/entry.ts_ +17 -0
  103. package/src/lib/apartmentChooser/BuildingViewerModel.js +60 -0
  104. package/src/lib/apartmentChooser/CircularSlideshow.js +66 -0
  105. package/src/lib/apartmentChooser/RotationStep.js +31 -0
  106. package/src/lib/apartmentChooser/SceneRotator.js +25 -0
  107. package/src/lib/apartmentChooser/index.js +3 -0
  108. package/src/lib/apartmentChooser/throttle.js +15 -0
  109. package/src/lib/buildingPicker/BuildingMap.js +24 -0
  110. package/src/lib/buildingPicker/BuildingPickerResourceProvider.js +97 -0
  111. package/src/lib/buildingPicker/CanvasRaster.js +29 -0
  112. package/src/lib/buildingPicker/DayOfYearSelector.js +36 -0
  113. package/src/lib/buildingPicker/SampleRaster.js +14 -0
  114. package/src/lib/buildingPicker/index.js +5 -0
  115. package/src/lib/index.js +4 -0
  116. package/src/lib/shared/BatchLoadTracker.js +52 -0
  117. package/src/lib/shared/I18N.js +65 -0
  118. package/src/lib/shared/ResourceLoader.js +33 -0
  119. package/src/lib/shared/index.js +3 -0
  120. package/src/lib/virtualTour/CameraSnapshot.js +42 -0
  121. package/src/lib/virtualTour/FullscreenModel.js +69 -0
  122. package/src/lib/virtualTour/textures/arrow.png +0 -0
  123. package/src/lib/virtualTour/textures/compass-bg.png +0 -0
  124. package/src/lib/virtualTour/textures/compass-needle.png +0 -0
  125. package/src/lib/virtualTour/textures/compass-north.png +0 -0
  126. package/src/lib/virtualTour/textures/floor-1.svg +4 -0
  127. package/src/lib/virtualTour/textures/floor-2.svg +4 -0
  128. package/src/lib/virtualTour/textures/marker.png +0 -0
  129. package/src/lib/virtualTour/textures/tod-sun.png +0 -0
  130. package/src/lib/virtualTour__/ApartmentConfig.ts +80 -0
  131. package/src/lib/virtualTour__/ApartmentFiles.ts +8 -0
  132. package/src/lib/virtualTour__/CameraNavigator.js_ +74 -0
  133. package/src/lib/virtualTour__/CameraSnapshot.js +42 -0
  134. package/src/lib/virtualTour__/CoordConversions.js +43 -0
  135. package/src/lib/virtualTour__/FullscreenModel.js +69 -0
  136. package/src/lib/virtualTour__/MinimapConfig.ts +46 -0
  137. package/src/lib/virtualTour__/PlayerViewModel.js +423 -0
  138. package/src/lib/virtualTour__/config/ApartmentConfig.js +92 -0
  139. package/src/lib/virtualTour__/config/CameraConfig.js +97 -0
  140. package/src/lib/virtualTour__/config/Interaction.js +393 -0
  141. package/src/lib/virtualTour__/config/Panorama.js +78 -0
  142. package/src/lib/virtualTour__/config/PlayerConfig.js +812 -0
  143. package/src/lib/virtualTour__/config/rawinflate.export.js +833 -0
  144. package/src/lib/virtualTour__/config/shaders.js +24 -0
  145. package/src/lib/virtualTour__/impl/HttpApartmentFiles.ts +57 -0
  146. package/src/lib/virtualTour__/index.js +1 -0
  147. package/src/lib/virtualTour__/textures/arrow.png +0 -0
  148. package/src/lib/virtualTour__/textures/compass-bg.png +0 -0
  149. package/src/lib/virtualTour__/textures/compass-needle.png +0 -0
  150. package/src/lib/virtualTour__/textures/compass-north.png +0 -0
  151. package/src/lib/virtualTour__/textures/floor-1.svg +4 -0
  152. package/src/lib/virtualTour__/textures/floor-2.svg +4 -0
  153. package/src/lib/virtualTour__/textures/marker.png +0 -0
  154. package/src/lib/virtualTour__/textures/tod-sun.png +0 -0
  155. package/src/main.ts_ +24 -0
  156. package/src/shims-png.d.ts +4 -0
  157. package/src/shims-tsx.d.ts +11 -0
  158. package/src/shims-vue.d.ts +4 -0
  159. package/src/style.css +0 -0
  160. package/src/vite-env.d.ts +5 -0
@@ -0,0 +1,162 @@
1
+ <template>
2
+ <div class="waypoint-carousel">
3
+ <v-slide-group
4
+ v-model="activeIndex"
5
+ active-class="active-apt"
6
+ selected-class="active-apt"
7
+ show-arrows
8
+ center-active
9
+ mandatory
10
+ >
11
+ <template #prev>
12
+ <v-hover v-slot="{ hover }">
13
+ <v-btn
14
+ elevation="0"
15
+ class="carousel-button"
16
+ :class="{ mobile: isMobile }"
17
+ @click="$emit('previous')"
18
+ >
19
+ <v-icon :color="hover ? '#999' : '#d2d2d2'" x-large>
20
+ mdi-chevron-left
21
+ </v-icon>
22
+ </v-btn>
23
+ </v-hover>
24
+ </template>
25
+ <template #next>
26
+ <v-hover v-slot="{ hover }">
27
+ <v-btn
28
+ elevation="0"
29
+ class="carousel-button"
30
+ :class="{ mobile: isMobile }"
31
+ @click="$emit('next')"
32
+ >
33
+ <v-icon :color="hover ? '#999' : '#d2d2d2'" x-large>
34
+ mdi-chevron-right
35
+ </v-icon>
36
+ </v-btn>
37
+ </v-hover>
38
+ </template>
39
+ <v-slide-group-item
40
+ v-for="thumb in thumbnails"
41
+ :key="thumb.id"
42
+ v-slot="{ toggle, selectedClass }"
43
+ >
44
+ <v-card
45
+ :class="['ma-2', selectedClass]"
46
+ align="center"
47
+ justify="center"
48
+ :height="isMobile ? 50 : 100"
49
+ :width="isMobile ? 80 : 160"
50
+ elevation="0"
51
+ style="overflow: hidden"
52
+ @click="goToCamera(thumb.id, toggle)"
53
+ >
54
+ <v-img max-height="100" max-width="160" :src="thumb.thumbnailUrl" />
55
+ </v-card>
56
+ </v-slide-group-item>
57
+ </v-slide-group>
58
+ </div>
59
+ </template>
60
+
61
+ <script>
62
+ const KEY_ARROW_LEFT = 37;
63
+ const KEY_ARROW_RIGHT = 39;
64
+
65
+ export default {
66
+ name: "WaypointCarousel",
67
+ props: {
68
+ thumbnails: { type: Array, required: true },
69
+ active: { type: Number, required: true },
70
+ },
71
+ data() {
72
+ return {
73
+ activeThumb: 0,
74
+ };
75
+ },
76
+ computed: {
77
+ activeIndex: {
78
+ get() {
79
+ return this.active;
80
+ },
81
+ set(value) {
82
+ this.activeThumb = value;
83
+ },
84
+ },
85
+ isMobile() {
86
+ return /Android|webOS|iPhone|iPad|BlackBerry|Windows Phone|Opera Mini|IEMobile|Mobile/i.test(
87
+ window.navigator.userAgent
88
+ );
89
+ },
90
+ },
91
+ mounted() {
92
+ window.addEventListener("keydown", this.keyNavigate);
93
+ },
94
+ beforeUnmount() {
95
+ window.removeEventListener("keydown", this.keyNavigate);
96
+ },
97
+ methods: {
98
+ keyNavigate(e) {
99
+ switch (e.keyCode) {
100
+ case e.keyCode === KEY_ARROW_LEFT:
101
+ this.$emit("previous");
102
+ case e.keyCode === KEY_ARROW_RIGHT:
103
+ this.$emit("next");
104
+ default:
105
+ return;
106
+ }
107
+ },
108
+ goToCamera(cameraId, toggleEvent) {
109
+ toggleEvent();
110
+ this.$emit("goto", cameraId);
111
+ },
112
+ },
113
+ };
114
+ </script>
115
+
116
+ <style scoped>
117
+ .v-card {
118
+ transition: box-shadow 0.3s ease-in-out;
119
+ border: 2px solid transparent;
120
+ }
121
+ :deep(.v-slide-group__content) {
122
+ justify-content: center;
123
+ }
124
+ :deep(.v-slide-group__next--disabled) {
125
+ pointer-events: all !important;
126
+ }
127
+
128
+ :deep(.v-slide-group__prev--disabled) {
129
+ pointer-events: all !important;
130
+ }
131
+
132
+ .carousel-button {
133
+ height: 108px !important;
134
+ min-width: 54px !important;
135
+ padding: 0 !important;
136
+ z-index: 2;
137
+ background-color: #fff !important;
138
+ border: 2px solid #d2d2d2;
139
+ color: #d2d2d2 !important;
140
+ }
141
+ .carousel-button.mobile {
142
+ height: 58px !important;
143
+ min-width: 38px !important;
144
+ }
145
+ .carousel-button:hover {
146
+ border: 2px solid #999 !important;
147
+ color: #999 !important;
148
+ }
149
+ .carousel-button:hover:before,
150
+ .carousel-button:hover:after {
151
+ background-color: #fff !important;
152
+ }
153
+ .align-baseline {
154
+ align-items: baseline;
155
+ }
156
+ .active-apt {
157
+ border: 4px solid #4caf50 !important;
158
+ }
159
+ .v-image {
160
+ border-radius: 0 !important;
161
+ }
162
+ </style>
@@ -0,0 +1 @@
1
+ export { default as ManualSlideShow } from './ManualSlideShow.vue'
@@ -0,0 +1,262 @@
1
+ <template>
2
+ <div class="minimap-wrapper d-flex align-stretch justify-space-between">
3
+ <div class="minimap-container">
4
+ <div class="web-minimap" :style="transformStyle">
5
+ <div class="minimap-background-image" :style="backgroundStyle"></div>
6
+ <div class="center-pivot" :style="centerPivotStyle">
7
+ <div
8
+ v-for="oneCamera in camerasWithRelativePosition"
9
+ :key="oneCamera.id"
10
+ >
11
+ <div
12
+ v-if="currentCameraObject.floorLevel === oneCamera.floorLevel"
13
+ class="single-camera-marker"
14
+ :style="cameraPositionStyle(oneCamera)"
15
+ ></div>
16
+ <rotation-marker-v2
17
+ v-if="currentCameraObject.id === oneCamera.id"
18
+ class="rotation-marker-component"
19
+ :rotation="rotationAngle"
20
+ :style="{ ...cameraPositionStyle(oneCamera) }"
21
+ />
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ </template>
28
+
29
+ <script>
30
+ import * as THREE from "three";
31
+ import RotationMarkerV2 from "./RotationMarkerV2.vue";
32
+
33
+ function _rad(n) {
34
+ return THREE.MathUtils.degToRad(n);
35
+ }
36
+
37
+ export default {
38
+ name: "MiniMapMap",
39
+ components: { RotationMarkerV2 },
40
+ props: {
41
+ backgroundImage: {
42
+ type: String,
43
+ required: true,
44
+ },
45
+ allCameras: {
46
+ type: Array,
47
+ required: true,
48
+ },
49
+ minimapCamera: {
50
+ type: Object,
51
+ required: true,
52
+ },
53
+ currentCamera: {
54
+ type: String,
55
+ required: true,
56
+ },
57
+ rotation: {
58
+ type: Number,
59
+ required: true,
60
+ },
61
+ transformAngle: {
62
+ type: Number,
63
+ required: true,
64
+ },
65
+ },
66
+ data() {
67
+ return {
68
+ planeWidth: 512,
69
+ planeHeight: 384,
70
+ topLeftCorner: new THREE.Vector3(),
71
+ centerPivot: new THREE.Object3D(),
72
+ centerPivotStyle: {},
73
+ scale: 1,
74
+ resizeOverver: undefined,
75
+ };
76
+ },
77
+ computed: {
78
+ apartmentCameras() {
79
+ return this.allCameras;
80
+ },
81
+ currentCameraObject() {
82
+ return this.allCameras.find((item) => {
83
+ return item.id === this.currentCamera;
84
+ });
85
+ },
86
+ rotationAngle() {
87
+ return this.rotation;
88
+ },
89
+ minimapCameraPositionVector() {
90
+ return new THREE.Vector3(
91
+ this.minimapCamera.position.x,
92
+ this.minimapCamera.position.y,
93
+ this.minimapCamera.position.z
94
+ );
95
+ },
96
+ floorVerticalPosition() {
97
+ return parseFloat(this.currentCameraObject.floor_vertical_position);
98
+ },
99
+ camerasWithRelativePosition() {
100
+ return this.apartmentCameras.map((oneCamera) => {
101
+ const cameraPosition = oneCamera.uposition.split(",");
102
+
103
+ const position = new THREE.Vector3(
104
+ cameraPosition[0] - this.minimapCameraPositionVector.x,
105
+ 0,
106
+ cameraPosition[2] - this.minimapCameraPositionVector.z
107
+ );
108
+
109
+ const toReturn = {
110
+ ...oneCamera,
111
+ ...this.relativePosition(this.topLeftCorner, position),
112
+ };
113
+
114
+ return toReturn;
115
+ });
116
+ },
117
+ backgroundStyle() {
118
+ return `background-image: url(${this.backgroundImage});`;
119
+ },
120
+ transformStyle() {
121
+ let actualScale = this.scale > 1 ? 1 : this.scale;
122
+ if (actualScale < 0.8) actualScale = 0.4;
123
+
124
+ return `scale: ${actualScale > 1 ? 1 : actualScale}; transform: rotate(${
125
+ this.transformAngle
126
+ }deg);`;
127
+ },
128
+ },
129
+ mounted() {
130
+ this.calculateRelativeValues();
131
+ this.upadteCenterPivot();
132
+ this.calcualteScale();
133
+
134
+ const element = document.getElementById("moveableDiv");
135
+ if (element)
136
+ this.resizeOverver = new ResizeObserver(this.calcualteScale).observe(
137
+ element
138
+ );
139
+ },
140
+ beforeUpdate() {
141
+ this.calculateRelativeValues();
142
+ this.upadteCenterPivot();
143
+ },
144
+ beforeUnmount() {
145
+ if (this.resizeOverver) {
146
+ this.resizeOverver.unobserve(document.getElementById("moveableDiv"));
147
+ }
148
+ },
149
+ methods: {
150
+ upadteCenterPivot() {
151
+ this.centerPivot.rotation.x = 180;
152
+ this.centerPivot.rotation.y = this.minimapCamera.rotation.y * -1;
153
+
154
+ this.centerPivotStyle = {
155
+ transform: `rotateZ(${this.centerPivot.rotation.y}deg) rotateX(${this.centerPivot.rotation.x}deg)`,
156
+ };
157
+ },
158
+ cameraPositionStyle(camera) {
159
+ return {
160
+ top: `${Math.abs(camera.top)}%`,
161
+ left: `${Math.abs(camera.left)}%`,
162
+ };
163
+ },
164
+ relativePosition(topLeftCorner, position) {
165
+ var direction = new THREE.Vector3();
166
+ const relativePosition = direction.subVectors(topLeftCorner, position);
167
+
168
+ return {
169
+ relativePosition,
170
+ left: (relativePosition.x / this.planeWidth) * 100,
171
+ top: (relativePosition.z / this.planeHeight) * 100,
172
+ };
173
+ },
174
+ calculateRelativeValues() {
175
+ const cameraHeight =
176
+ this.minimapCamera.position.y - this.floorVerticalPosition;
177
+ this.planeHeight =
178
+ 2 * (cameraHeight * Math.tan(_rad(this.minimapCamera.fovY / 2)));
179
+ this.planeWidth = (512 / 384) * this.planeHeight;
180
+
181
+ const halfHeight = this.planeHeight / 2;
182
+ const halfWidth = this.planeWidth / 2;
183
+ const topLeftCorner = new THREE.Vector3(
184
+ halfWidth * -1,
185
+ 0,
186
+ halfHeight * -1
187
+ );
188
+ this.topLeftCorner = topLeftCorner;
189
+ },
190
+ calcualteScale() {
191
+ const parentElement = document.getElementById("moveableDiv");
192
+
193
+ if (!parentElement) return;
194
+
195
+ const heightScale = (parentElement.offsetHeight / 384) * 0.8;
196
+ const widthScale = (parentElement.offsetWidth / 512) * 0.8;
197
+
198
+ if (parentElement.offsetHeight > parentElement.offsetWidth) {
199
+ this.scale = widthScale * 0.5;
200
+ } else {
201
+ this.scale = heightScale * 0.9;
202
+ }
203
+ },
204
+ },
205
+ };
206
+ </script>
207
+ <style scoped>
208
+ .minimap-container {
209
+ position: relative;
210
+ }
211
+
212
+ .web-minimap {
213
+ position: relative;
214
+ width: 512px;
215
+ height: 385px;
216
+ overflow: hidden;
217
+ transition: transform 0.5s ease-in;
218
+ }
219
+
220
+ @media (max-width: 650px) {
221
+ .web-minimap {
222
+ scale: 0.7;
223
+ }
224
+ }
225
+
226
+ @media (max-width: 480px) {
227
+ .web-minimap {
228
+ scale: 0.5;
229
+ }
230
+ }
231
+
232
+ .minimap-background-image {
233
+ position: absolute;
234
+ width: 100%;
235
+ height: 100%;
236
+ }
237
+
238
+ .single-camera-marker {
239
+ position: absolute;
240
+ width: 7px;
241
+ height: 7px;
242
+ background: #fff;
243
+ border-radius: 50%;
244
+ z-index: 2;
245
+ transform: translate(-50%, -50%);
246
+ border: 0px;
247
+ }
248
+
249
+ .rotation-marker-component {
250
+ z-index: 3;
251
+ position: absolute;
252
+ width: 80px;
253
+ height: 80px;
254
+ transform: translate(-50%, -50%);
255
+ }
256
+
257
+ .center-pivot {
258
+ position: absolute;
259
+ width: 100%;
260
+ height: 100%;
261
+ }
262
+ </style>
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <moveable @close="$emit('close')" @transform="transform">
3
+ <template v-slot:body>
4
+ <minimap-compass
5
+ :scale="scale"
6
+ :minimapCamera="minimapCamera"
7
+ :transformAngle="transformAngle"
8
+ />
9
+ <div>
10
+ <mini-map-map
11
+ :transformAngle="transformAngle"
12
+ :allCameras="allCameras"
13
+ :backgroundImage="backgroundImage"
14
+ :rotation="rotation"
15
+ :currentCamera="currentCamera"
16
+ :minimapCamera="minimapCamera"
17
+ />
18
+ </div>
19
+ </template>
20
+ <template v-slot:footer>
21
+ <sunsimulation-slider
22
+ :minimapJSON="minimapJSON"
23
+ :root="`${rootUrl}/minimap/`"
24
+ :level="level"
25
+ @set-background-image="setBackgroundImage"
26
+ />
27
+ </template>
28
+ </moveable>
29
+ </template>
30
+ <script>
31
+ import MiniMapMap from './MiniMapMap.vue'
32
+ import Moveable from './Moveable.vue'
33
+ import MinimapCompass from './MinimapCompass.vue'
34
+ import SunsimulationSlider from './SunsimulationSlider.vue'
35
+
36
+ export default {
37
+ components: { MiniMapMap, Moveable, MinimapCompass, SunsimulationSlider },
38
+ name: 'MiniMapV2',
39
+ emits: ['close', 'set-background-image'],
40
+ props: {
41
+ minimapJSON: {
42
+ type: Array,
43
+ required: true,
44
+ },
45
+ rootUrl: {
46
+ type: String,
47
+ required: true,
48
+ },
49
+ backgroundImage: {
50
+ type: String,
51
+ required: true,
52
+ },
53
+ allCameras: {
54
+ type: Array,
55
+ required: true,
56
+ },
57
+ minimapCamera: {
58
+ type: Object,
59
+ required: true,
60
+ },
61
+ currentCamera: {
62
+ type: String,
63
+ required: true,
64
+ },
65
+ level: {
66
+ type: Number,
67
+ required: true,
68
+ },
69
+ rotation: {
70
+ type: Number,
71
+ required: true,
72
+ },
73
+ },
74
+ data() {
75
+ return {
76
+ transformAngle: 0,
77
+ }
78
+ },
79
+ computed: {
80
+ scale() {
81
+ let scale = 1
82
+ if (this.transformAngle !== 0) {
83
+ if (Math.abs(this.transformAngle) % 180 === 0) {
84
+ scale = 1
85
+ } else {
86
+ scale = -1
87
+ }
88
+ }
89
+
90
+ return scale
91
+ },
92
+ },
93
+ methods: {
94
+ setBackgroundImage(image) {
95
+ this.$emit('set-background-image', image)
96
+ },
97
+ transform() {
98
+ this.transformAngle = this.transformAngle + 90
99
+ },
100
+ },
101
+ }
102
+ </script>
103
+ <style scoped>
104
+ .minimap-compass {
105
+ position: absolute;
106
+ right: 5px;
107
+ top: 50px;
108
+ z-index: 11;
109
+ }
110
+ </style>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <div class="minimap-compass" :style="{ scale: scale }">
3
+ <qi-north-direction class="north-indicator" :longitude="northDirection" />
4
+ </div>
5
+ </template>
6
+ <script>
7
+ import QiNorthDirection from '../../shared/QiNorthDirection.vue'
8
+
9
+ export default {
10
+ name: 'MinimapCompass',
11
+ components: { QiNorthDirection },
12
+ props: {
13
+ scale: {
14
+ type: Number,
15
+ required: true,
16
+ },
17
+ minimapCamera: {
18
+ type: Object,
19
+ required: true,
20
+ },
21
+ transformAngle: {
22
+ type: Number,
23
+ required: true,
24
+ },
25
+ },
26
+ computed: {
27
+ northDirection() {
28
+ return this.minimapCamera.rotation
29
+ ? this.minimapCamera.rotation.y + this.transformAngle - 90
30
+ : 0
31
+ },
32
+ },
33
+ }
34
+ </script>
35
+ <style scoped>
36
+ .minimap-compass {
37
+ width: 50px;
38
+ }
39
+ </style>