ep-lib-ts 1.0.52 → 1.0.54

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 (146) hide show
  1. package/dist/BgAudio-CjD8rE6L.js +4 -0
  2. package/dist/Details-DodNJLmk.js +4 -0
  3. package/dist/DisplayBox-a9QABBg0.js +4 -0
  4. package/dist/Ep360Image-T9Z_eSbf.js +10 -0
  5. package/dist/Ep360Video-CkVrfj8k.js +10 -0
  6. package/dist/EpAlert-DL2pQmkm.js +4 -0
  7. package/dist/EpAudio-B1eoAvQp.js +4 -0
  8. package/dist/EpAvatar-DUWW5trW.js +4 -0
  9. package/dist/EpBadge-BZZQvAVs.js +4 -0
  10. package/dist/EpBarChart-Bv4LoxxX.js +4 -0
  11. package/dist/EpBtn-BfLGlVXl.js +4 -0
  12. package/dist/EpCard-Crpcs4JY.js +4 -0
  13. package/dist/EpCardLink-MoItEiyt.js +4 -0
  14. package/dist/EpChip-BceMyKjr.js +4 -0
  15. package/dist/EpCodeblock-D87dvIve.js +4 -0
  16. package/dist/EpConclusion-CqJsk0kW.js +4 -0
  17. package/dist/EpContentSlider-W35bm8vM.js +4 -0
  18. package/dist/{EpDarkmode-BmcA1kre.js → EpDarkmode-Kj9ZCege.js} +1 -1
  19. package/dist/EpDescription-CkrMusXA.js +4 -0
  20. package/dist/EpDivider-PDLfxtHT.js +4 -0
  21. package/dist/EpDocument-BDU1ahk8.js +4 -0
  22. package/dist/{EpDraggable-CEqhDHAq.js → EpDraggable-Co8uBigH.js} +1 -1
  23. package/dist/EpEdu-CHRkMMgm.js +4 -0
  24. package/dist/EpFlex-DARmMuRJ.js +4 -0
  25. package/dist/EpFunnelChart-z5FrSEHw.js +4 -0
  26. package/dist/EpHeader-DVN3apTI.js +4 -0
  27. package/dist/EpHover-heeBGubv.js +4 -0
  28. package/dist/EpHoverCard-2rYupP8M.js +4 -0
  29. package/dist/EpIcon-D1hHhkw2.js +4 -0
  30. package/dist/EpIframe-BebJ46m_.js +4 -0
  31. package/dist/EpImg-DLtDRMKo.js +4 -0
  32. package/dist/EpImgCarousel-Sdulf0vy.js +4 -0
  33. package/dist/{EpInput-B2O5ovqX.js → EpInput-BAl9kb_b.js} +1 -1
  34. package/dist/EpInstructions-C4jVOwjT.js +4 -0
  35. package/dist/EpIntroduction-DlDvwvqJ.js +4 -0
  36. package/dist/EpLineChart-CtzLjbJ7.js +4 -0
  37. package/dist/EpLink-42Jwja2Y.js +4 -0
  38. package/dist/EpLinkVersion-DIvWaYUN.js +4 -0
  39. package/dist/{EpList-BQQ6YyEU.js → EpList-B9M5lt1v.js} +1 -1
  40. package/dist/EpModal-BsON1lr3.js +4 -0
  41. package/dist/{EpNothing-D53i__PJ.js → EpNothing-YipAP3oo.js} +1 -1
  42. package/dist/EpObjective-BbUe8GFm.js +4 -0
  43. package/dist/EpPieChart-MLoj6BR_.js +4 -0
  44. package/dist/EpQuestion-BtF1Qgmj.js +4 -0
  45. package/dist/EpQuote-Cibs-LKa.js +4 -0
  46. package/dist/EpRadio-BWLLcGbB.js +4 -0
  47. package/dist/EpRadioSummative-DxivBGqM.js +4 -0
  48. package/dist/EpReading-D_Hpr3ao.js +4 -0
  49. package/dist/EpResource-BE_aXHAi.js +4 -0
  50. package/dist/EpScope-DiXtqmae.js +4 -0
  51. package/dist/EpSection-B3W0ffnN.js +4 -0
  52. package/dist/EpSectionCols-DbM-vHrS.js +4 -0
  53. package/dist/EpSkeleton-CFNm58SZ.js +4 -0
  54. package/dist/EpSoftware-Bob71yqB.js +4 -0
  55. package/dist/EpSpecificObjective-C7tWNHHd.js +4 -0
  56. package/dist/EpSpinner-Do8Jowd9.js +4 -0
  57. package/dist/EpStackedList-sgilE4yA.js +4 -0
  58. package/dist/EpSummativeTable-BJi8VUtB.js +4 -0
  59. package/dist/EpSvg-DqQt1rvC.js +4 -0
  60. package/dist/EpSvgShow-DtDVgeJl.js +4 -0
  61. package/dist/EpTable-DXuHhHqq.js +4 -0
  62. package/dist/EpTerm-jaZtSD0w.js +4 -0
  63. package/dist/EpText-CwvgGSLh.js +4 -0
  64. package/dist/EpTimeLine-CCCyOGBT.js +4 -0
  65. package/dist/EpVideo-EeWrLoqr.js +4 -0
  66. package/dist/EpVideoPanopto-2xqsTrPY.js +4 -0
  67. package/dist/EpWordDef-bqKugyLs.js +4 -0
  68. package/dist/TextMedia-BCE1F2fb.js +4 -0
  69. package/dist/components/interactions/Ep360Image.vue.d.ts +1 -16
  70. package/dist/components/interactions/Ep360Video.vue.d.ts +1 -15
  71. package/dist/components/medias/EpLottieSvg.vue.d.ts +1 -1
  72. package/dist/ep-lib-ts.js +1 -1
  73. package/dist/ep-lib-ts.umd.cjs +91 -4951
  74. package/dist/{index-C4wT5qUE.js → index-Bhy3n4DI.js} +1 -1
  75. package/dist/{index-CxWafW_X.js → index-Cllz2Ia3.js} +61 -48
  76. package/dist/{prism-CgWkMycv.js → prism-CFRbvIsk.js} +1 -1
  77. package/dist/style.css +1 -1
  78. package/package.json +1 -1
  79. package/src/components/educationals/EpBranchingScenario.vue +2 -2
  80. package/src/components/interactions/Ep360Image.vue +130 -157
  81. package/src/components/interactions/Ep360Video.vue +13 -8
  82. package/src/components/interactions/EpSvgShow.vue +29 -18
  83. package/dist/BgAudio-B0h7VdWq.js +0 -4
  84. package/dist/Details-DZKLvF9v.js +0 -4
  85. package/dist/DisplayBox-DDLKnmKJ.js +0 -4
  86. package/dist/Ep360Image-DHK_IWTi.js +0 -241
  87. package/dist/Ep360Video-C4PekHTc.js +0 -242
  88. package/dist/EpAlert-BjUplxWX.js +0 -4
  89. package/dist/EpAudio-CATD1Jbh.js +0 -4
  90. package/dist/EpAvatar-Dfsz07bn.js +0 -4
  91. package/dist/EpBadge-Dvu88JNL.js +0 -4
  92. package/dist/EpBarChart-Cl_SiAvN.js +0 -4
  93. package/dist/EpBtn-HearU7fk.js +0 -4
  94. package/dist/EpCard-DaEFsYjJ.js +0 -4
  95. package/dist/EpCardLink-B7-e3xGJ.js +0 -4
  96. package/dist/EpChip-B3Dl3sbg.js +0 -4
  97. package/dist/EpCodeblock-DhPVKsZw.js +0 -4
  98. package/dist/EpConclusion-DaQXAgp_.js +0 -4
  99. package/dist/EpContentSlider-MgPnsxoZ.js +0 -4
  100. package/dist/EpDescription-DWXlwJEL.js +0 -4
  101. package/dist/EpDivider-BmUwghGw.js +0 -4
  102. package/dist/EpDocument-Bh7tx9Z3.js +0 -4
  103. package/dist/EpEdu-CTUhM5xY.js +0 -4
  104. package/dist/EpFlex-bvQbwBqj.js +0 -4
  105. package/dist/EpFunnelChart-D57Qx8Ns.js +0 -4
  106. package/dist/EpHeader-BeNQdrDL.js +0 -4
  107. package/dist/EpHover-C6xm5kes.js +0 -4
  108. package/dist/EpHoverCard-D27lS9Lu.js +0 -4
  109. package/dist/EpIcon-DYyh_r_t.js +0 -4
  110. package/dist/EpIframe-DbHttqXB.js +0 -4
  111. package/dist/EpImg-DsXQcvsP.js +0 -4
  112. package/dist/EpImgCarousel-CCOYX3Sf.js +0 -4
  113. package/dist/EpInstructions-UzKvuasV.js +0 -4
  114. package/dist/EpIntroduction-DMSd580N.js +0 -4
  115. package/dist/EpLineChart-vIg84kEL.js +0 -4
  116. package/dist/EpLink-ByyNViWv.js +0 -4
  117. package/dist/EpLinkVersion-CcG0KUCD.js +0 -4
  118. package/dist/EpModal-C3eAYkVv.js +0 -4
  119. package/dist/EpObjective-B1T5_B94.js +0 -4
  120. package/dist/EpPieChart-BLup5pM9.js +0 -4
  121. package/dist/EpQuestion-BMmO301I.js +0 -4
  122. package/dist/EpQuote-BA8jGdmn.js +0 -4
  123. package/dist/EpRadio-BHQ8QDek.js +0 -4
  124. package/dist/EpRadioSummative-BSSwzhJH.js +0 -4
  125. package/dist/EpReading-pRs9Mtww.js +0 -4
  126. package/dist/EpResource-DVUh5ZLE.js +0 -4
  127. package/dist/EpScope-DlbXKFok.js +0 -4
  128. package/dist/EpSection-CI_u2BBY.js +0 -4
  129. package/dist/EpSectionCols-CpHJ4ZqV.js +0 -4
  130. package/dist/EpSkeleton-CneeChkb.js +0 -4
  131. package/dist/EpSoftware-wMOFrTQs.js +0 -4
  132. package/dist/EpSpecificObjective-D3-nfcdE.js +0 -4
  133. package/dist/EpSpinner-DHmfsvnE.js +0 -4
  134. package/dist/EpStackedList-DbQ_vuea.js +0 -4
  135. package/dist/EpSummativeTable-DlEEGid2.js +0 -4
  136. package/dist/EpSvg-N-aSiFRB.js +0 -4
  137. package/dist/EpSvgShow-DrenPNTe.js +0 -4
  138. package/dist/EpTable-CqM-ocWg.js +0 -4
  139. package/dist/EpTerm-D9ba8WkL.js +0 -4
  140. package/dist/EpText-BWLZ6D8r.js +0 -4
  141. package/dist/EpTimeLine-CXmdGtrb.js +0 -4
  142. package/dist/EpVideo-Blqwux-i.js +0 -4
  143. package/dist/EpVideoPanopto-DlHfv8Gm.js +0 -4
  144. package/dist/EpWordDef-Dbw7-k75.js +0 -4
  145. package/dist/TextMedia-D5hYAp0w.js +0 -4
  146. package/dist/three.module-B-oqC8Xk.js +0 -33752
@@ -1,214 +1,184 @@
1
1
  <script setup lang="ts">
2
2
  // DO NOT DELETE. IMPORTANT FOR VIDEO NAVIGATION : this.el.object3D.getWorldPosition(position);
3
- import { ref, onMounted } from "vue";
4
- //import * as AFRAME from "aframe";
5
- import "aframe";
6
- import { Object3D, Quaternion, Vector3 } from "three";
3
+ /*import { ref, onMounted } from "vue";
7
4
  import type { Pin, Scene } from "../../types/image360";
8
5
 
9
6
  interface Props {
10
- scenes:Scene[];
11
- id?: string;
7
+ scenes: Scene[];
8
+ id?: string;
12
9
  }
13
10
 
14
11
  const props = defineProps<Props>();
15
12
 
16
-
17
-
18
13
  const currentSceneIndex = ref(0);
19
14
  const hoveredPin = ref<Pin | null>(null);
20
15
  const clickedPin = ref<Pin | null>(null);
21
16
 
22
- const AFRAME = window.AFRAME;
17
+ let AFRAME: any;
18
+ let THREE: any;
23
19
 
20
+ onMounted(async () => {
21
+ // Lazy load aframe and three.js
22
+ const aframeModule = await import('aframe');
23
+ AFRAME = window.AFRAME ?? aframeModule;
24
+ THREE = await import('three');
24
25
 
25
- if (!AFRAME.components["rotation-reader"]) {
26
- AFRAME.registerComponent("rotation-reader", {
27
- schema: {},
28
- tick: createTickFunction(),
29
- });
30
- }
26
+ await checkAndDeleteComponent("rotation-reader", 2000);
27
+ await registerRotationReaderComponent(2000);
28
+ });
31
29
 
32
30
  function handleMarkerClick(pin: Pin, event: Event): void {
33
- if (!pin) return;
34
-
35
- if (pin?.event === "onClick" || !pin.event) {
36
- if (pin.type == "descriptive") {
37
- clickedPin.value = pin;
38
- const target = event.target as HTMLElement;
39
- target.setAttribute("material", "opacity: 0; transparent: true");
40
- console.log("Marker clicked:", pin);
41
- } else if (pin.type == "action") {
42
- const nextSceneIndex = props.scenes.findIndex(
43
- (scene) => scene.id === pin.scene
44
- );
45
- if (nextSceneIndex !== -1) {
46
- currentSceneIndex.value = nextSceneIndex;
47
- }
48
- console.log(
49
- "Action Pin Clicked. Scene switched to:",
50
- currentSceneIndex.value
51
- );
52
- }
31
+ if (!pin) return;
32
+
33
+ if (pin?.event === "onClick" || !pin.event) {
34
+ if (pin.type === "descriptive") {
35
+ clickedPin.value = pin;
36
+ const target = event.target as HTMLElement;
37
+ target.setAttribute("material", "opacity: 0; transparent: true");
38
+ } else if (pin.type === "action") {
39
+ const nextSceneIndex = props.scenes.findIndex(scene => scene.id === pin.scene);
40
+ if (nextSceneIndex !== -1) {
41
+ currentSceneIndex.value = nextSceneIndex;
42
+ }
53
43
  }
44
+ }
54
45
  }
55
46
 
56
47
  function handleMouseEnter(pin: Pin | null, event: Event): void {
57
- if (!pin) return;
48
+ if (!pin) return;
58
49
 
59
- if (pin?.event === "onHover" || !pin?.event) {
60
- hoveredPin.value = pin;
61
- const target = event.target as HTMLElement;
62
- target.setAttribute("material", "opacity: 0; transparent: true");
63
- console.log("Marker hovered:", pin);
64
- }
50
+ if (pin?.event === "onHover" || !pin?.event) {
51
+ hoveredPin.value = pin;
52
+ const target = event.target as HTMLElement;
53
+ target.setAttribute("material", "opacity: 0; transparent: true");
54
+ }
65
55
  }
66
56
 
67
57
  function handleMouseLeave(pin: Pin | null, event: Event): void {
68
- if (!pin) return;
69
-
70
- const relatedTarget = (event as MouseEvent).relatedTarget as HTMLElement;
71
-
72
- if (pin?.event === "onHover" || !pin?.event) {
73
- const target = event.target as HTMLElement;
74
-
75
- console.log("children:", target.children);
76
-
77
- if (clickedPin.value == pin) {
78
- target.setAttribute("material", "opacity: 1; transparent: true");
79
- }
80
- if (
81
- !relatedTarget?.classList.contains("interactive-area") &&
82
- hoveredPin.value?.id === pin?.id
83
- ) {
84
- hoveredPin.value = null;
85
- console.log("Hover cleared:", pin);
86
- }
58
+ if (!pin) return;
59
+
60
+ const relatedTarget = (event as MouseEvent).relatedTarget as HTMLElement;
61
+
62
+ if (pin?.event === "onHover" || !pin?.event) {
63
+ const target = event.target as HTMLElement;
64
+ if (clickedPin.value === pin) {
65
+ target.setAttribute("material", "opacity: 1; transparent: true");
87
66
  }
67
+ if (
68
+ !relatedTarget?.classList.contains("interactive-area") &&
69
+ hoveredPin.value?.id === pin?.id
70
+ ) {
71
+ hoveredPin.value = null;
72
+ }
73
+ }
88
74
  }
89
75
 
90
76
  function convertToPosition(x: number, y: number): string {
91
- return `${x / 10} ${y / 10} -5`;
77
+ return `${x / 10} ${y / 10} -5`;
92
78
  }
93
79
 
94
- onMounted(() => {
95
- (async () => {
96
- await checkAndDeleteComponent("rotation-reader", 2000);
97
- })();
98
- (async () => {
99
- await registerRotationReaderComponent(2000);
100
- })();
101
- });
102
-
103
- async function checkAndDeleteComponent(
104
- componentName: string,
105
- delayMs: number = 1000
106
- ) {
107
- if (AFRAME.components[componentName]) {
108
- await delay(delayMs);
109
- delete AFRAME.components[componentName];
110
- }
80
+ async function checkAndDeleteComponent(componentName: string, delayMs = 1000) {
81
+ if (AFRAME?.components[componentName]) {
82
+ await delay(delayMs);
83
+ delete AFRAME.components[componentName];
84
+ }
111
85
  }
112
86
 
113
87
  function delay(ms: number): Promise<void> {
114
- return new Promise((resolve) => setTimeout(resolve, ms));
88
+ return new Promise((resolve) => setTimeout(resolve, ms));
115
89
  }
116
90
 
117
- async function registerRotationReaderComponent(delayMs: number = 1000) {
118
- await delay(delayMs);
119
- if (AFRAME.components["rotation-reader"]) {
120
- console.warn(
121
- "Existing rotation-reader component found. Re-registering..."
122
- );
123
- delete AFRAME.components["rotation-reader"];
124
- }
125
-
126
- AFRAME.registerComponent("rotation-reader", {
127
- schema: {},
128
- tick: createTickFunction(),
129
- });
91
+ async function registerRotationReaderComponent(delayMs = 1000) {
92
+ await delay(delayMs);
93
+ if (AFRAME.components["rotation-reader"]) {
94
+ console.warn("Existing rotation-reader component found. Re-registering...");
95
+ delete AFRAME.components["rotation-reader"];
96
+ }
97
+
98
+ AFRAME.registerComponent("rotation-reader", {
99
+ schema: {},
100
+ tick: createTickFunction(),
101
+ });
130
102
  }
131
103
 
132
104
  function createTickFunction() {
133
- const quaternion = new Quaternion();
134
- const cameraPosition = new Vector3();
135
- const objectPosition = new Vector3();
136
-
137
- const referenceDistance = 5;
138
- const initialScale = 0.8;
139
-
140
- return function (this: {
141
- el: { object3D: InstanceType<typeof Object3D>; sceneEl: any };
142
- }) {
143
- updateCameraQuaternion(this.el.object3D, quaternion);
144
-
145
- const sceneEl = this.el.sceneEl;
146
- //console.log("scene active", sceneEl.getAttribute("id"));
147
- updatePinsRotation(quaternion, sceneEl);
148
-
149
- this.el.object3D.getWorldPosition(cameraPosition);
150
-
151
- sceneEl.querySelectorAll(".pin-marker").forEach((pinElement: any) => {
152
- const pinObject = (pinElement as any).object3D;
153
- if (pinObject) {
154
- pinObject.getWorldPosition(objectPosition);
155
- const distance = cameraPosition.distanceTo(objectPosition);
156
- const scale = (distance * initialScale) / referenceDistance;
157
- pinObject.scale.set(scale, scale, scale);
158
- }
159
- });
160
-
161
- sceneEl.querySelectorAll(".frame").forEach((frameElement: any) => {
162
- const frameObject = (frameElement as any).object3D;
163
- if (frameObject) {
164
- frameObject.getWorldPosition(objectPosition);
165
- const distance = cameraPosition.distanceTo(objectPosition);
166
- const scale = (distance * initialScale) / referenceDistance;
167
- frameObject.scale.set(scale, scale, scale);
168
- }
169
- });
170
- };
171
- }
105
+ const quaternion = new THREE.Quaternion();
106
+ const cameraPosition = new THREE.Vector3();
107
+ const objectPosition = new THREE.Vector3();
172
108
 
173
- function getPinOpacity(pinId: number): number {
174
- return (hoveredPin.value && hoveredPin.value.id === pinId) ||
175
- (clickedPin.value && clickedPin.value.id === pinId)
176
- ? 0
177
- : 1;
109
+ const referenceDistance = 5;
110
+ const initialScale = 0.8;
111
+
112
+ return function (this: {
113
+ el: { object3D: InstanceType<typeof THREE.Object3D>; sceneEl: any };
114
+ }) {
115
+ updateCameraQuaternion(this.el.object3D, quaternion);
116
+
117
+ const sceneEl = this.el.sceneEl;
118
+ updatePinsRotation(quaternion, sceneEl);
119
+
120
+ this.el.object3D.getWorldPosition(cameraPosition);
121
+
122
+ sceneEl.querySelectorAll(".pin-marker").forEach((pinElement: any) => {
123
+ const pinObject = pinElement.object3D;
124
+ if (pinObject) {
125
+ pinObject.getWorldPosition(objectPosition);
126
+ const distance = cameraPosition.distanceTo(objectPosition);
127
+ const scale = (distance * initialScale) / referenceDistance;
128
+ pinObject.scale.set(scale, scale, scale);
129
+ }
130
+ });
131
+
132
+ sceneEl.querySelectorAll(".frame").forEach((frameElement: any) => {
133
+ const frameObject = frameElement.object3D;
134
+ if (frameObject) {
135
+ frameObject.getWorldPosition(objectPosition);
136
+ const distance = cameraPosition.distanceTo(objectPosition);
137
+ const scale = (distance * initialScale) / referenceDistance;
138
+ frameObject.scale.set(scale, scale, scale);
139
+ }
140
+ });
141
+ };
178
142
  }
179
143
 
180
144
  function updateCameraQuaternion(
181
- object3D: InstanceType<typeof Object3D>,
182
- quaternion: InstanceType<typeof Quaternion>
145
+ object3D: InstanceType<typeof THREE.Object3D>,
146
+ quaternion: InstanceType<typeof THREE.Quaternion>
183
147
  ) {
184
- object3D.getWorldQuaternion(quaternion);
148
+ object3D.getWorldQuaternion(quaternion);
185
149
  }
186
150
 
187
- function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>, sceneEl: any) {
188
- sceneEl.querySelectorAll(".pin-marker").forEach((pinElement: any) => {
189
- const pinObject = (pinElement as any).object3D;
190
- if (pinObject) {
191
- pinObject.setRotationFromQuaternion(quaternion);
192
- }
193
- });
194
- sceneEl.querySelectorAll(".frame").forEach((pinElement: any) => {
195
- const pinObject = (pinElement as any).object3D;
196
- if (pinObject) {
197
- pinObject.setRotationFromQuaternion(quaternion);
198
- }
199
- });
151
+ function updatePinsRotation(quaternion: InstanceType<typeof THREE.Quaternion>, sceneEl: any) {
152
+ sceneEl.querySelectorAll(".pin-marker").forEach((pinElement: any) => {
153
+ const pinObject = pinElement.object3D;
154
+ if (pinObject) {
155
+ pinObject.setRotationFromQuaternion(quaternion);
156
+ }
157
+ });
158
+ sceneEl.querySelectorAll(".frame").forEach((pinElement: any) => {
159
+ const pinObject = pinElement.object3D;
160
+ if (pinObject) {
161
+ pinObject.setRotationFromQuaternion(quaternion);
162
+ }
163
+ });
200
164
  }
201
165
 
202
166
  function removeFrame() {
203
- clickedPin.value = null;
167
+ clickedPin.value = null;
204
168
  }
205
169
 
206
- function getPinColor(pin: Pin): string {
207
- return pin.color || "indigo";
170
+ function getPinOpacity(pinId: number): number {
171
+ return (hoveredPin.value?.id === pinId || clickedPin.value?.id === pinId) ? 0 : 1;
208
172
  }
173
+
174
+ function getPinColor(pin: Pin): string {
175
+ return pin.color || "indigo";
176
+ }*/
209
177
  </script>
210
178
 
179
+
211
180
  <template>
181
+ <!--
212
182
  <div
213
183
  style="
214
184
  width: 800px;
@@ -261,7 +231,7 @@ function getPinColor(pin: Pin): string {
261
231
  @mouseenter="(event: Event) => handleMouseEnter(pin, event)"
262
232
  >
263
233
 
264
- <!-- Cercle intérieur -->
234
+
265
235
  <a-circle
266
236
  position="0 0 0.01"
267
237
  color="#FFF"
@@ -361,5 +331,8 @@ function getPinColor(pin: Pin): string {
361
331
  </a-text>
362
332
  </a-entity>
363
333
  </a-scene>
334
+ </div>-->
335
+ <div>
336
+ La lib aframe et three.js à revoir
364
337
  </div>
365
338
  </template>
@@ -1,7 +1,8 @@
1
1
  <script setup lang="ts">
2
+ /*
2
3
  import { ref, onMounted } from "vue";
3
4
  // import * as AFRAME from "aframe";
4
- import "aframe";
5
+
5
6
  import { Object3D, Quaternion, Vector3 } from "three";
6
7
  import type { Pin, Scene } from "../../types/video360";
7
8
 
@@ -194,10 +195,11 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
194
195
  frameObject.setRotationFromQuaternion(quaternion);
195
196
  }
196
197
  });
197
- }
198
+ }*/
198
199
  </script>
199
200
 
200
201
  <template>
202
+ <!--
201
203
  <div style="width: 1200px; height: 800px; position: relative; margin: auto">
202
204
  <button @click="toggleVideo()">
203
205
  {{ isPlaying ? "Pause" : "Play" }}
@@ -217,7 +219,7 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
217
219
  ></video>
218
220
  </a-assets>
219
221
 
220
- <!-- CAMERA -->
222
+
221
223
  <a-entity camera look-controls id="rig" rotation-reader>
222
224
  <a-cursor
223
225
  id="cursor"
@@ -228,14 +230,14 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
228
230
  ></a-cursor>
229
231
  </a-entity>
230
232
 
231
- <!-- VIDEO SPHERE (CURRENT SCENE) -->
233
+
232
234
  <a-videosphere
233
235
  v-for="scene in props.scenes"
234
236
  :key="scene.id"
235
237
  :src="`#video${props.scenes[currentSceneIndex].id}`"
236
238
  ></a-videosphere>
237
239
 
238
- <!-- PINS -->
240
+
239
241
  <a-entity
240
242
  v-for="pin in props.scenes[currentSceneIndex].pins"
241
243
  :key="pin.id"
@@ -254,7 +256,7 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
254
256
  @mouseenter="(event: Event) => handleMouseEnter(pin, event)"
255
257
  @mouseleave="(event: Event) => handleMouseLeave(pin, event)"
256
258
  >
257
- <!-- Cercle intérieur -->
259
+
258
260
  <a-circle
259
261
  position="0 0 0.01"
260
262
  color="#FFF"
@@ -265,7 +267,7 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
265
267
  </a-circle>
266
268
  </a-entity>
267
269
 
268
- <!-- HOVERED PINS INFO BOX -->
270
+
269
271
  <a-entity
270
272
  v-if="hoveredPin"
271
273
  :position="convertToPosition(hoveredPin.x, hoveredPin.y)"
@@ -301,7 +303,7 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
301
303
  ></a-text>
302
304
  </a-entity>
303
305
 
304
- <!-- CLICKED PINS DIALOG BOX -->
306
+
305
307
  <a-entity
306
308
  v-if="clickedPin"
307
309
  :position="convertToPosition(clickedPin.x, clickedPin.y)"
@@ -347,5 +349,8 @@ function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
347
349
  ></a-text>
348
350
  </a-entity>
349
351
  </a-scene>
352
+ </div>-->
353
+ <div>
354
+ La lib aframe et three.js à revoir
350
355
  </div>
351
356
  </template>
@@ -31,27 +31,38 @@ const animationType = computed(() => {
31
31
 
32
32
  const showScene = (scene: string) => {
33
33
  if (!svgContainer.value) return;
34
- const currentScene = svgContainer.value.querySelector(`[data-scene="${scene}"]`)
35
- if(!currentScene) return;
36
- if(!props.multiple){
37
- hideScenes()
34
+
35
+ const currentScene = svgContainer.value.querySelector(`[data-scene="${scene}"]`);
36
+ if (!currentScene) return;
37
+
38
+ const isVisible = !currentScene.classList.contains('hidden');
39
+
40
+ if (isVisible) {
41
+ // Toggle OFF (hide the scene)
42
+ currentScene.classList.add('hidden');
43
+ currentScene.classList.remove(animationType.value);
44
+
45
+ const sceneElements = svgContainer.value.getElementsByClassName(`scene-${scene}`);
46
+ Array.from(sceneElements).forEach((s) => {
47
+ s.classList.add('hidden');
48
+ s.classList.remove(animationType.value);
49
+ });
50
+ } else {
51
+ // Toggle ON (show scene)
52
+ if (!props.multiple) hideScenes();
53
+
54
+ currentScene.classList.remove('hidden');
55
+ currentScene.classList.add(animationType.value);
56
+
57
+ const sceneElements = svgContainer.value.getElementsByClassName(`scene-${scene}`);
58
+ Array.from(sceneElements).forEach((s) => {
59
+ s.classList.remove('hidden');
60
+ s.classList.add(animationType.value);
61
+ });
38
62
  }
39
- currentScene.classList.remove('hidden', animationType.value)
40
- currentScene.classList.add(animationType.value)
41
- // const scenes = svgContainer.value.getElementsByClassName('scene');
42
- // Array.from(scenes).forEach((s) => {
43
- // if (s.classList.contains(`scene-${scene}`)) {
44
- // s.classList.remove('hidden', animationType.value);
45
- // s.classList.add(animationType.value);
46
- // } else {
47
- // if (!props.multiple && !s.classList.contains('hidden')) {
48
- // s.classList.add('hidden');
49
- // s.classList.remove(animationType.value);
50
- // }
51
- // }
52
- // });
53
63
  };
54
64
 
65
+
55
66
  const hideScenes = () => {
56
67
  if (!svgContainer.value) return;
57
68
  const scenes = svgContainer.value.querySelectorAll('[data-scene]');
@@ -1,4 +0,0 @@
1
- import { a8 as f } from "./index-CxWafW_X.js";
2
- export {
3
- f as default
4
- };
@@ -1,4 +0,0 @@
1
- import { a9 as f } from "./index-CxWafW_X.js";
2
- export {
3
- f as default
4
- };
@@ -1,4 +0,0 @@
1
- import { aa as f } from "./index-CxWafW_X.js";
2
- export {
3
- f as default
4
- };