ep-lib-ts 1.0.36 → 1.0.39
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/BgAudio-BDO4Ln5y.js +4 -0
- package/dist/DisplayBox-Diko7_uH.js +4 -0
- package/dist/Ep360Image-Dmwx7NrY.js +228 -0
- package/dist/Ep360Video-b_stvC2Z.js +235 -0
- package/dist/EpAlert-iWXSHupC.js +4 -0
- package/dist/EpAudio-Bnb1MIw6.js +4 -0
- package/dist/EpAvatar-DTfkDxUP.js +4 -0
- package/dist/{EpAvatar-Dmpg0PFj.js → EpAvatar.vue_vue_type_script_setup_true_lang-IeQ9W4tD.js} +11 -11
- package/dist/EpBadge-BcVkBKJK.js +4 -0
- package/dist/{EpBadge-DqmSNdbi.js → EpBadge-CWIq_C51.js} +2 -2
- package/dist/EpBarChart-D42B3a97.js +4 -0
- package/dist/EpBranchingScenario-dEapAg2r.js +151 -0
- package/dist/EpBtn-BtyunWne.js +4 -0
- package/dist/EpCard--mtof8hL.js +4 -0
- package/dist/{EpCheckbox-_Nt9Bvq3.js → EpCheckbox-D-AiG1k1.js} +10 -10
- package/dist/EpChip-DitreF_J.js +4 -0
- package/dist/EpCodeblock-nBOawE0H.js +4 -0
- package/dist/EpConclusion-CcOvoC8e.js +4 -0
- package/dist/EpContentSlider-DpIiJmPt.js +4 -0
- package/dist/{EpDarkmode-fMMNJbJs.js → EpDarkmode-DV-fRn1K.js} +5 -5
- package/dist/EpDescription-DeVW7LNL.js +4 -0
- package/dist/EpDivider-vEs9W9Km.js +4 -0
- package/dist/EpEdu-BC4BxjYR.js +4 -0
- package/dist/EpFlex-xdVOYg4a.js +4 -0
- package/dist/EpFunnelChart-CF1CM2id.js +4 -0
- package/dist/EpHeader-BMoXpQdW.js +4 -0
- package/dist/{EpHotsPot-DFz_Du9o.js → EpHotsPot-nT87sUMT.js} +6 -6
- package/dist/EpHover-CwOc7bvn.js +4 -0
- package/dist/EpHover.vue_vue_type_script_setup_true_lang-DDLIDTha.js +36 -0
- package/dist/EpHoverCard-BTWsiA2z.js +84 -0
- package/dist/EpIcon-Cektqqle.js +4 -0
- package/dist/EpIframe-CFLSXU7z.js +4 -0
- package/dist/EpImg-Ct-KfkRp.js +4 -0
- package/dist/EpInput-c9THhDCs.js +1095 -0
- package/dist/EpInstructions-BCFWkov8.js +4 -0
- package/dist/EpIntroduction-Cx1Tc920.js +4 -0
- package/dist/EpLineChart-BffNNoNj.js +4 -0
- package/dist/EpLink-Bx_E9Gjz.js +4 -0
- package/dist/EpLinkVersion-6CTPFhT5.js +4 -0
- package/dist/{EpList-B6Q3fXGj.js → EpList-CM3b-mLc.js} +3 -3
- package/dist/{EpListitem-DzQrc-k2.js → EpListitem-DXh4Kniu.js} +4 -4
- package/dist/EpLottieSvg-NNSQLDpl.js +1971 -0
- package/dist/EpModal-DLG_mddB.js +4 -0
- package/dist/EpNothing-DVY_GKL6.js +10 -0
- package/dist/EpObjective-DIWMrap_.js +4 -0
- package/dist/EpPieChart-CTDL07vZ.js +4 -0
- package/dist/EpQuestion-RzrZk_Op.js +4 -0
- package/dist/EpQuote-SaMcAmmL.js +4 -0
- package/dist/EpRadio-w5IkZmj5.js +4 -0
- package/dist/EpRadioSummative-BeZecHlR.js +4 -0
- package/dist/EpReading-CVgr9TGN.js +4 -0
- package/dist/EpResource-BEql6U6K.js +4 -0
- package/dist/EpScope-BAuTDV_B.js +4 -0
- package/dist/EpSection-CESMVDna.js +4 -0
- package/dist/EpSectionCols-CacYX-v3.js +4 -0
- package/dist/{EpSelect-FIb6SyJU.js → EpSelect-kjH_wTXb.js} +3 -3
- package/dist/EpSkeleton-CuvqT7PL.js +4 -0
- package/dist/EpSoftware-LK_nIUJY.js +4 -0
- package/dist/EpSpecificObjective-BTavyAY9.js +4 -0
- package/dist/EpSpinner-CZo0f9Nx.js +4 -0
- package/dist/EpStackedList-DWkLmrqI.js +75 -0
- package/dist/EpSummativeTable-Dlhhgq1A.js +4 -0
- package/dist/EpSvg-CG-uua_J.js +4 -0
- package/dist/{EpSwitch-hdXyzuR1.js → EpSwitch-DtQon_hm.js} +2 -2
- package/dist/EpTable-DsXZI8Hm.js +4 -0
- package/dist/EpTerm-DGTKAJqq.js +4 -0
- package/dist/EpText-kB0vb1Da.js +4 -0
- package/dist/{EpTextarea-D8UCQuga.js → EpTextarea-VJ4pdPV_.js} +2 -2
- package/dist/EpTimeLine-DK_bzCen.js +4 -0
- package/dist/{EpToggle-BDp54LpY.js → EpToggle-BTkTNVEz.js} +2 -2
- package/dist/{EpTooltip-B4s0_PvZ.js → EpTooltip-J6UMMP3d.js} +2 -2
- package/dist/EpVideo-CPN6M6cs.js +4 -0
- package/dist/EpVideoPanopto-UZckfqS1.js +4 -0
- package/dist/EpWordDef-dSnuxRtl.js +4 -0
- package/dist/components/basics/EpHover.vue.d.ts +12 -10
- package/dist/components/basics/EpHoverCard.vue.d.ts +86 -0
- package/dist/components/basics/EpStackedList.vue.d.ts +50 -0
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +45 -0
- package/dist/components/educationals/EpCodeblock.vue.d.ts +1 -1
- package/dist/components/interactions/Ep360Image.vue.d.ts +16 -0
- package/dist/components/interactions/Ep360Video.vue.d.ts +16 -0
- package/dist/components/medias/EpLottieSvg.vue.d.ts +58 -0
- package/dist/ep-lib-ts.js +23 -23
- package/dist/ep-lib-ts.umd.cjs +5158 -109
- package/dist/{index-D4ekzRdY.js → index-Bw4yzGuc.js} +3999 -3114
- package/dist/{index-7_RFK7FL.js → index-CPs4nmaJ.js} +4684 -4549
- package/dist/index-IdtPmXeP.js +3483 -0
- package/dist/{prism-CZvJL8HS.js → prism-DM8vlN3d.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/testImg.jpg +0 -0
- package/dist/testMaria.jpg +0 -0
- package/dist/three.module-laS36oD-.js +48903 -0
- package/dist/types/Aframe.d.ts +1 -0
- package/dist/types/Component.d.ts +10 -0
- package/dist/types/Hover.d.ts +3 -0
- package/dist/types/StackedList.d.ts +37 -0
- package/dist/types/Three.d.ts +1 -0
- package/dist/types/image360.d.ts +16 -0
- package/dist/types/video360.d.ts +16 -0
- package/package.json +10 -5
- package/src/components/basics/EpHover.vue +32 -28
- package/src/components/basics/EpHoverCard.vue +123 -0
- package/src/components/basics/EpImg.vue +1 -1
- package/src/components/basics/EpListitem.vue +41 -59
- package/src/components/basics/EpStackedList.vue +83 -0
- package/src/components/educationals/EpBranchingScenario.vue +239 -0
- package/src/components/educationals/EpCodeblock.vue +1 -1
- package/src/components/educationals/EpEdu.vue +4 -4
- package/src/components/interactions/Ep360Image.vue +344 -0
- package/src/components/interactions/Ep360Video.vue +339 -0
- package/src/components/medias/EpLottieSvg.vue +79 -0
- package/dist/BgAudio-BpeNw9L4.js +0 -4
- package/dist/DisplayBox-aSVYrDHI.js +0 -4
- package/dist/EpAlert-x0STjaqD.js +0 -4
- package/dist/EpAudio-D7LIG4mf.js +0 -4
- package/dist/EpBadge-Du6v1vQL.js +0 -4
- package/dist/EpBarChart-BoINXvhV.js +0 -4
- package/dist/EpBtn-DE6qTHlW.js +0 -4
- package/dist/EpCard-CNcn4RbZ.js +0 -4
- package/dist/EpChip-DHgdqDEX.js +0 -4
- package/dist/EpCodeblock-CR2LGKR-.js +0 -4
- package/dist/EpConclusion-B9DhTuTc.js +0 -4
- package/dist/EpContentSlider-BdS_KctY.js +0 -4
- package/dist/EpDescription-D1TbwNrX.js +0 -4
- package/dist/EpDivider-DjTTwzGb.js +0 -4
- package/dist/EpEdu-CuI1_N9M.js +0 -4
- package/dist/EpFlex-Dx5C4Gc8.js +0 -4
- package/dist/EpFunnelChart-C6_M1nag.js +0 -4
- package/dist/EpHeader-B5jyGMDA.js +0 -4
- package/dist/EpHover-3fnZrdD6.js +0 -31
- package/dist/EpIcon-DDm9gGfm.js +0 -4
- package/dist/EpIframe-BNz3cawg.js +0 -4
- package/dist/EpImg-CxjLfziE.js +0 -4
- package/dist/EpInput-HmLHpLYh.js +0 -1168
- package/dist/EpInstructions-C0reDzIV.js +0 -4
- package/dist/EpIntroduction-C92mD-hu.js +0 -4
- package/dist/EpLineChart-Cm4W9z14.js +0 -4
- package/dist/EpLink-CGVS8yjO.js +0 -4
- package/dist/EpLinkVersion-CsGN9YS9.js +0 -4
- package/dist/EpModal-DuIZeI6V.js +0 -4
- package/dist/EpNothing-BDqIuSB9.js +0 -10
- package/dist/EpObjective-R1tWBwTe.js +0 -4
- package/dist/EpPieChart-CoTBcaaf.js +0 -4
- package/dist/EpQuestion-DmEcATq1.js +0 -4
- package/dist/EpQuote-BPCJBVbM.js +0 -4
- package/dist/EpRadio-TsUBsVoj.js +0 -4
- package/dist/EpRadioSummative-Cl9dVMJD.js +0 -4
- package/dist/EpReading-vOjzuYW7.js +0 -4
- package/dist/EpResource-Dbq_41hb.js +0 -4
- package/dist/EpScope-DIc4HvYy.js +0 -4
- package/dist/EpSection-Cb18CHq0.js +0 -4
- package/dist/EpSectionCols-B1P8ujg-.js +0 -4
- package/dist/EpSkeleton-vw7gDYoi.js +0 -4
- package/dist/EpSoftware-BAKbJhZg.js +0 -4
- package/dist/EpSpecificObjective-B5L6-OCN.js +0 -4
- package/dist/EpSpinner-rQzI6_Pe.js +0 -4
- package/dist/EpSummativeTable-Djg4DVSn.js +0 -4
- package/dist/EpSvg-DggY9PtW.js +0 -4
- package/dist/EpTable-CvhrvBOq.js +0 -4
- package/dist/EpTerm-C6HSHM0J.js +0 -4
- package/dist/EpText-CftDXaM-.js +0 -4
- package/dist/EpTimeLine-D7ks1LH_.js +0 -4
- package/dist/EpVideo-3MO0ao4H.js +0 -4
- package/dist/EpVideoPanopto-C-hIsXtV.js +0 -4
- package/dist/EpWordDef-BkwqmvfJ.js +0 -4
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, onMounted } from "vue";
|
|
3
|
+
import * as AFRAME from "aframe";
|
|
4
|
+
import { Object3D, Quaternion, Vector3 } from "three";
|
|
5
|
+
import type { Pin, Scene } from "../../types/video360";
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
scenes:Scene[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = defineProps<Props>();
|
|
12
|
+
|
|
13
|
+
const currentSceneIndex = ref(0);
|
|
14
|
+
const hoveredPin = ref<Pin | null>(null);
|
|
15
|
+
const clickedPin = ref<Pin | null>(null);
|
|
16
|
+
const isPlaying = ref(false);
|
|
17
|
+
|
|
18
|
+
if (!AFRAME.components["rotation-reader"]) {
|
|
19
|
+
AFRAME.registerComponent("rotation-reader", {
|
|
20
|
+
schema: {},
|
|
21
|
+
tick: createTickFunction(),
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function handleMarkerClick(pin: Pin, event: Event): void {
|
|
26
|
+
if (!pin) return;
|
|
27
|
+
|
|
28
|
+
if (pin?.event === "onClick") {
|
|
29
|
+
if (pin.type === "descriptive") {
|
|
30
|
+
clickedPin.value = pin;
|
|
31
|
+
const target = event.target as HTMLElement;
|
|
32
|
+
target.setAttribute("material", "opacity: 0; transparent: true");
|
|
33
|
+
console.log("Marker clicked:", pin);
|
|
34
|
+
} else if (pin.type === "action") {
|
|
35
|
+
const nextSceneIndex = props.scenes.findIndex(
|
|
36
|
+
(scene) => scene.id === pin.scene
|
|
37
|
+
);
|
|
38
|
+
if (nextSceneIndex !== -1) {
|
|
39
|
+
currentSceneIndex.value = nextSceneIndex;
|
|
40
|
+
}
|
|
41
|
+
console.log(
|
|
42
|
+
"Action Pin Clicked. Scene switched to:",
|
|
43
|
+
currentSceneIndex.value
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function handleMouseEnter(pin: Pin | null, event: Event): void {
|
|
50
|
+
if (!pin) return;
|
|
51
|
+
if (pin.event === "onHover" || !pin.event) {
|
|
52
|
+
hoveredPin.value = pin;
|
|
53
|
+
console.log("Marker hovered:", pin);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function handleMouseLeave(pin: Pin | null, event: Event): void {
|
|
58
|
+
if (!pin) return;
|
|
59
|
+
const relatedTarget = (event as MouseEvent).relatedTarget as HTMLElement;
|
|
60
|
+
if (pin.event === "onHover" || !pin?.event) {
|
|
61
|
+
if (
|
|
62
|
+
!relatedTarget?.classList.contains("interactive-area") &&
|
|
63
|
+
hoveredPin.value?.id === pin.id
|
|
64
|
+
) {
|
|
65
|
+
hoveredPin.value = null;
|
|
66
|
+
console.log("Hover cleared:", pin);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function convertToPosition(x: number, y: number): string {
|
|
72
|
+
return `${x / 10} ${y / 10} -5`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function removeFrame() {
|
|
76
|
+
clickedPin.value = null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function getPinColor(pin: Pin): string {
|
|
80
|
+
return pin.color || "indigo";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getPinOpacity(pinId: number): number {
|
|
84
|
+
return (hoveredPin.value && hoveredPin.value.id === pinId) ||
|
|
85
|
+
(clickedPin.value && clickedPin.value.id === pinId)
|
|
86
|
+
? 0
|
|
87
|
+
: 1;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function toggleVideo() {
|
|
91
|
+
isPlaying.value = !isPlaying.value;
|
|
92
|
+
const videoElements = document.querySelectorAll<HTMLVideoElement>(".video");
|
|
93
|
+
videoElements.forEach((video) => {
|
|
94
|
+
isPlaying.value ? video.play() : video.pause();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
(async () => {
|
|
100
|
+
await checkAndDeleteComponent("rotation-reader", 2000);
|
|
101
|
+
})();
|
|
102
|
+
(async () => {
|
|
103
|
+
await registerRotationReaderComponent(2000);
|
|
104
|
+
})();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
async function checkAndDeleteComponent(
|
|
108
|
+
componentName: string,
|
|
109
|
+
delayMs: number = 1000
|
|
110
|
+
) {
|
|
111
|
+
if (AFRAME.components[componentName]) {
|
|
112
|
+
await delay(delayMs);
|
|
113
|
+
delete AFRAME.components[componentName];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function delay(ms: number): Promise<void> {
|
|
118
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function registerRotationReaderComponent(delayMs: number = 1000) {
|
|
122
|
+
await delay(delayMs);
|
|
123
|
+
if (AFRAME.components["rotation-reader"]) {
|
|
124
|
+
console.warn("Existing rotation-reader found. Re-registering...");
|
|
125
|
+
delete AFRAME.components["rotation-reader"];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
AFRAME.registerComponent("rotation-reader", {
|
|
129
|
+
schema: {},
|
|
130
|
+
tick: createTickFunction(),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function createTickFunction() {
|
|
135
|
+
const quaternion = new Quaternion();
|
|
136
|
+
const cameraPosition = new Vector3();
|
|
137
|
+
const objectPosition = new Vector3();
|
|
138
|
+
|
|
139
|
+
const referenceDistance = 5;
|
|
140
|
+
const initialScale = 0.8;
|
|
141
|
+
|
|
142
|
+
return function (this: {
|
|
143
|
+
el: { object3D: InstanceType<typeof Object3D>; sceneEl: any };
|
|
144
|
+
}) {
|
|
145
|
+
updateCameraQuaternion(this.el.object3D, quaternion);
|
|
146
|
+
updatePinsRotation(quaternion);
|
|
147
|
+
|
|
148
|
+
this.el.object3D.getWorldPosition(cameraPosition);
|
|
149
|
+
|
|
150
|
+
document.querySelectorAll(".pin-marker").forEach((pinElement) => {
|
|
151
|
+
const pinObject = (pinElement as any).object3D;
|
|
152
|
+
if (pinObject) {
|
|
153
|
+
pinObject.getWorldPosition(objectPosition);
|
|
154
|
+
const distance = cameraPosition.distanceTo(objectPosition);
|
|
155
|
+
const scale = (distance * initialScale) / referenceDistance;
|
|
156
|
+
pinObject.scale.set(scale, scale, scale);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
document.querySelectorAll(".frame").forEach((frameElement) => {
|
|
161
|
+
const frameObject = (frameElement as any).object3D;
|
|
162
|
+
if (frameObject) {
|
|
163
|
+
frameObject.getWorldPosition(objectPosition);
|
|
164
|
+
const distance = cameraPosition.distanceTo(objectPosition);
|
|
165
|
+
const scale = (distance * initialScale) / referenceDistance;
|
|
166
|
+
frameObject.scale.set(scale, scale, scale);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function updateCameraQuaternion(
|
|
173
|
+
object3D: InstanceType<typeof Object3D>,
|
|
174
|
+
quaternion: InstanceType<typeof Quaternion>
|
|
175
|
+
) {
|
|
176
|
+
object3D.getWorldQuaternion(quaternion);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
|
|
180
|
+
|
|
181
|
+
document.querySelectorAll(".pin-marker").forEach((pinElement) => {
|
|
182
|
+
const pinObject = (pinElement as any).object3D;
|
|
183
|
+
if (pinObject) {
|
|
184
|
+
pinObject.setRotationFromQuaternion(quaternion);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
document.querySelectorAll(".frame").forEach((frameElement) => {
|
|
189
|
+
const frameObject = (frameElement as any).object3D;
|
|
190
|
+
if (frameObject) {
|
|
191
|
+
frameObject.setRotationFromQuaternion(quaternion);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
</script>
|
|
196
|
+
|
|
197
|
+
<template>
|
|
198
|
+
<div style="width: 1200px; height: 800px; position: relative; margin: auto">
|
|
199
|
+
<button @click="toggleVideo()">
|
|
200
|
+
{{ isPlaying ? "Pause" : "Play" }}
|
|
201
|
+
</button>
|
|
202
|
+
|
|
203
|
+
<a-scene embedded>
|
|
204
|
+
<a-assets>
|
|
205
|
+
<video
|
|
206
|
+
v-for="scene in props.scenes"
|
|
207
|
+
:id="`video${scene.id}`"
|
|
208
|
+
:src="scene.skyVideo"
|
|
209
|
+
muted
|
|
210
|
+
class="video"
|
|
211
|
+
playsinline
|
|
212
|
+
loop
|
|
213
|
+
crossorigin="anonymous"
|
|
214
|
+
></video>
|
|
215
|
+
</a-assets>
|
|
216
|
+
|
|
217
|
+
<!-- CAMERA -->
|
|
218
|
+
<a-entity camera look-controls id="rig" rotation-reader>
|
|
219
|
+
<a-cursor
|
|
220
|
+
id="cursor"
|
|
221
|
+
cursor="rayOrigin: mouse"
|
|
222
|
+
raycaster="objects: none"
|
|
223
|
+
geometry="primitive: ring; radiusInner: 0; radiusOuter: 0"
|
|
224
|
+
material="opacity: 0; transparent: true"
|
|
225
|
+
></a-cursor>
|
|
226
|
+
</a-entity>
|
|
227
|
+
|
|
228
|
+
<!-- VIDEO SPHERE (CURRENT SCENE) -->
|
|
229
|
+
<a-videosphere
|
|
230
|
+
v-for="scene in props.scenes"
|
|
231
|
+
:key="scene.id"
|
|
232
|
+
:src="`#video${props.scenes[currentSceneIndex].id}`"
|
|
233
|
+
></a-videosphere>
|
|
234
|
+
|
|
235
|
+
<!-- PINS -->
|
|
236
|
+
<a-entity
|
|
237
|
+
v-for="pin in props.scenes[currentSceneIndex].pins"
|
|
238
|
+
:key="pin.id"
|
|
239
|
+
:position="convertToPosition(pin.x, pin.y)"
|
|
240
|
+
cursor="rayOrigin: mouse"
|
|
241
|
+
>
|
|
242
|
+
<a-circle
|
|
243
|
+
class="pin-marker"
|
|
244
|
+
:color="getPinColor(pin)"
|
|
245
|
+
radius="0.25"
|
|
246
|
+
shader="flat"
|
|
247
|
+
:material="`opacity: ${getPinOpacity(
|
|
248
|
+
pin.id
|
|
249
|
+
)}; transparent: true`"
|
|
250
|
+
@click="(event: Event) => handleMarkerClick(pin, event)"
|
|
251
|
+
@mouseenter="(event: Event) => handleMouseEnter(pin, event)"
|
|
252
|
+
@mouseleave="(event: Event) => handleMouseLeave(pin, event)"
|
|
253
|
+
></a-circle>
|
|
254
|
+
</a-entity>
|
|
255
|
+
|
|
256
|
+
<!-- HOVERED PINS INFO BOX -->
|
|
257
|
+
<a-entity
|
|
258
|
+
v-if="hoveredPin"
|
|
259
|
+
:position="convertToPosition(hoveredPin.x, hoveredPin.y)"
|
|
260
|
+
class="frame interactive-area"
|
|
261
|
+
cursor="rayOrigin: mouse"
|
|
262
|
+
@mouseleave="(event: Event) => handleMouseLeave(hoveredPin, event)"
|
|
263
|
+
>
|
|
264
|
+
<a-plane
|
|
265
|
+
color="white"
|
|
266
|
+
:opacity="1"
|
|
267
|
+
width="4"
|
|
268
|
+
height="1.5"
|
|
269
|
+
material="shader: standard; side: double;"
|
|
270
|
+
position="0 0 0"
|
|
271
|
+
geometry="primitive: plane; height: 1.5; width: 4;"
|
|
272
|
+
></a-plane>
|
|
273
|
+
|
|
274
|
+
<a-text
|
|
275
|
+
:value="hoveredPin.title"
|
|
276
|
+
color="#2c3e50"
|
|
277
|
+
font="dejavu"
|
|
278
|
+
align="center"
|
|
279
|
+
width="3.8"
|
|
280
|
+
position="0 0.3 0.01"
|
|
281
|
+
></a-text>
|
|
282
|
+
<a-text
|
|
283
|
+
:value="hoveredPin.description"
|
|
284
|
+
color="#34495e"
|
|
285
|
+
font="dejavu"
|
|
286
|
+
align="center"
|
|
287
|
+
width="3.5"
|
|
288
|
+
position="0 -0.3 0.01"
|
|
289
|
+
></a-text>
|
|
290
|
+
</a-entity>
|
|
291
|
+
|
|
292
|
+
<!-- CLICKED PINS DIALOG BOX -->
|
|
293
|
+
<a-entity
|
|
294
|
+
v-if="clickedPin"
|
|
295
|
+
:position="convertToPosition(clickedPin.x, clickedPin.y)"
|
|
296
|
+
class="frame interactive-area"
|
|
297
|
+
cursor="rayOrigin: mouse"
|
|
298
|
+
>
|
|
299
|
+
<a-plane
|
|
300
|
+
color="white"
|
|
301
|
+
:opacity="1"
|
|
302
|
+
width="4"
|
|
303
|
+
height="1.5"
|
|
304
|
+
material="shader: standard; side: double;"
|
|
305
|
+
position="0 0 0"
|
|
306
|
+
geometry="primitive: plane; height: 1.5; width: 4;"
|
|
307
|
+
></a-plane>
|
|
308
|
+
|
|
309
|
+
<a-plane
|
|
310
|
+
class="close-frame"
|
|
311
|
+
color="red"
|
|
312
|
+
width="0.4"
|
|
313
|
+
height="0.4"
|
|
314
|
+
position="1.8 0.55 0.01"
|
|
315
|
+
material="shader: flat; side: double; transparent: true;"
|
|
316
|
+
geometry="primitive: plane; height: 0.4; width: 0.4;"
|
|
317
|
+
@click="removeFrame"
|
|
318
|
+
></a-plane>
|
|
319
|
+
|
|
320
|
+
<a-text
|
|
321
|
+
:value="clickedPin.title"
|
|
322
|
+
color="#2c3e50"
|
|
323
|
+
font="dejavu"
|
|
324
|
+
align="center"
|
|
325
|
+
width="3.8"
|
|
326
|
+
position="0 0.3 0.01"
|
|
327
|
+
></a-text>
|
|
328
|
+
<a-text
|
|
329
|
+
:value="clickedPin.description"
|
|
330
|
+
color="#34495e"
|
|
331
|
+
font="dejavu"
|
|
332
|
+
align="center"
|
|
333
|
+
width="3.5"
|
|
334
|
+
position="0 -0.3 0.01"
|
|
335
|
+
></a-text>
|
|
336
|
+
</a-entity>
|
|
337
|
+
</a-scene>
|
|
338
|
+
</div>
|
|
339
|
+
</template>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { DotLottieVue } from '@lottiefiles/dotlottie-vue';
|
|
3
|
+
|
|
4
|
+
import { ref, watchEffect } from 'vue';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
src: string;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
speed?: number | string;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
pauseOnClick?: boolean;
|
|
14
|
+
pauseButton?: boolean;
|
|
15
|
+
playOnHover?: boolean;
|
|
16
|
+
onComplete?: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
21
|
+
autoPlay: false,
|
|
22
|
+
loop: false,
|
|
23
|
+
speed: 1,
|
|
24
|
+
width: 150,
|
|
25
|
+
height: 150,
|
|
26
|
+
pauseOnClick: false,
|
|
27
|
+
pauseButton: false,
|
|
28
|
+
playOnHover: false
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const buttonText = ref((props.autoPlay) ? "Arrêter" : "Jouer");
|
|
32
|
+
|
|
33
|
+
const playerRef = ref<any | null>(null);
|
|
34
|
+
|
|
35
|
+
const managePlayState = () => {
|
|
36
|
+
|
|
37
|
+
if(playerRef.value) {
|
|
38
|
+
if(playerRef.value.getDotLottieInstance().isPlaying) {
|
|
39
|
+
playerRef.value.getDotLottieInstance().pause();
|
|
40
|
+
buttonText.value = "Jouer";
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
playerRef.value.getDotLottieInstance().play();
|
|
44
|
+
buttonText.value = "Arrêter";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
watchEffect(() => {
|
|
50
|
+
if(playerRef.value) {
|
|
51
|
+
playerRef.value.getDotLottieInstance().addEventListener('complete', () => {
|
|
52
|
+
if(props.onComplete) {
|
|
53
|
+
props.onComplete();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<div class="flex flex-col items-center">
|
|
65
|
+
<DotLottieVue
|
|
66
|
+
:src="src"
|
|
67
|
+
:loop="loop"
|
|
68
|
+
:autoplay="autoPlay"
|
|
69
|
+
:style="`width: ${width}px; height: ${height}px;`"
|
|
70
|
+
:speed="Number(speed)"
|
|
71
|
+
:play-on-hover="playOnHover"
|
|
72
|
+
ref="playerRef"
|
|
73
|
+
@click="(pauseOnClick)? managePlayState() : ''"
|
|
74
|
+
/>
|
|
75
|
+
<button class="rounded bg-blue-500 text-white py-2 px-4 min-w-28 my-3" v-if="pauseButton" @click="managePlayState">{{ buttonText }}</button>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
</template>
|
|
79
|
+
|
package/dist/BgAudio-BpeNw9L4.js
DELETED
package/dist/EpAlert-x0STjaqD.js
DELETED
package/dist/EpAudio-D7LIG4mf.js
DELETED
package/dist/EpBadge-Du6v1vQL.js
DELETED
package/dist/EpBtn-DE6qTHlW.js
DELETED
package/dist/EpCard-CNcn4RbZ.js
DELETED
package/dist/EpChip-DHgdqDEX.js
DELETED
package/dist/EpEdu-CuI1_N9M.js
DELETED
package/dist/EpFlex-Dx5C4Gc8.js
DELETED
package/dist/EpHover-3fnZrdD6.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { defineComponent as c, computed as t, openBlock as i, createElementBlock as u, renderSlot as f, createElementVNode as d, normalizeClass as p, toDisplayString as m } from "vue";
|
|
2
|
-
import { u as o } from "./index-7_RFK7FL.js";
|
|
3
|
-
const v = { class: "relative max-w-xs overflow-hidden bg-cover bg-no-repeat" }, h = /* @__PURE__ */ c({
|
|
4
|
-
__name: "EpHover",
|
|
5
|
-
props: {
|
|
6
|
-
bg_color: { default: "black" },
|
|
7
|
-
text_color: { default: "white" },
|
|
8
|
-
text: { default: "" },
|
|
9
|
-
animation: { default: "" }
|
|
10
|
-
},
|
|
11
|
-
setup(r) {
|
|
12
|
-
const e = r, l = t(() => {
|
|
13
|
-
if (e.bg_color)
|
|
14
|
-
return `${o("bg", e.bg_color)}`;
|
|
15
|
-
}), a = t(() => {
|
|
16
|
-
if (e.text_color)
|
|
17
|
-
return `${o("text", e.text_color)}`;
|
|
18
|
-
}), n = t(() => e.animation == "scale" ? "hover:scale-110 hover:opacity-100 " : "hover:opacity-100");
|
|
19
|
-
return (s, x) => (i(), u("div", v, [
|
|
20
|
-
f(s.$slots, "default"),
|
|
21
|
-
d("div", {
|
|
22
|
-
class: p(`absolute bottom-0 left-0 right-0 top-0 h-full w-full overflow-hidden ${l.value}
|
|
23
|
-
font-bold flex justify-center items-center bg-fixed opacity-0 transition duration-300 ease-in-out
|
|
24
|
-
text-4xl ${n.value} ${a.value}`)
|
|
25
|
-
}, m(e.text), 3)
|
|
26
|
-
]));
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
export {
|
|
30
|
-
h as default
|
|
31
|
-
};
|
package/dist/EpIcon-DDm9gGfm.js
DELETED
package/dist/EpImg-CxjLfziE.js
DELETED