ep-lib-ts 1.0.43 → 1.0.44
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-ByQMjvpb.js +4 -0
- package/dist/DisplayBox-5KOzK-T1.js +4 -0
- package/dist/Ep360Image-CQJBPImD.js +241 -0
- package/dist/{Ep360Video-b_stvC2Z.js → Ep360Video-CL_7mOiQ.js} +84 -77
- package/dist/EpAlert-9n3eGOzn.js +4 -0
- package/dist/EpAudio-DN-khrPL.js +4 -0
- package/dist/EpAvatar-CXQP2wql.js +4 -0
- package/dist/EpBadge-4MOToF_Q.js +4 -0
- package/dist/EpBarChart-D7YNa6L1.js +4 -0
- package/dist/EpBranchingScenario-vDe8SVyF.js +160 -0
- package/dist/EpBtn-CodZ5WkT.js +4 -0
- package/dist/EpCard-bxcDoveo.js +4 -0
- package/dist/EpCardLink-BpRg37fb.js +4 -0
- package/dist/EpChip-DyPsThQ7.js +4 -0
- package/dist/EpCodeblock-CTVen6ok.js +4 -0
- package/dist/EpConclusion-CZSpnFN3.js +4 -0
- package/dist/EpContentSlider-0KrwEp3v.js +4 -0
- package/dist/{EpDarkmode-Bechg1uo.js → EpDarkmode-CM5E89Mq.js} +1 -1
- package/dist/EpDescription-BqAK-19p.js +4 -0
- package/dist/EpDivider-Cz2UczzO.js +4 -0
- package/dist/EpDraggable-DihYnwD-.js +1676 -0
- package/dist/EpEdu-Cb0syukg.js +4 -0
- package/dist/EpFlex-C9FQK2SA.js +4 -0
- package/dist/EpFunnelChart-DCiSFsse.js +4 -0
- package/dist/EpHeader-CzSF69pa.js +4 -0
- package/dist/EpHover-RZmDKnaw.js +4 -0
- package/dist/EpHoverCard-D6G0baOv.js +4 -0
- package/dist/EpIcon-Av0-zy17.js +4 -0
- package/dist/EpIframe-DW9zyLQo.js +4 -0
- package/dist/EpImg-CSHuR6qU.js +4 -0
- package/dist/EpImgCarousel-cIC103wg.js +4 -0
- package/dist/{EpInput-CoSeoa1t.js → EpInput-DHrHSXzx.js} +29 -29
- package/dist/EpInstructions-K-kkygx5.js +4 -0
- package/dist/EpIntroduction-CQlFolxF.js +4 -0
- package/dist/EpLineChart-mWEJNhfP.js +4 -0
- package/dist/EpLink-ByArsF1O.js +4 -0
- package/dist/EpLinkVersion-D0l0gER1.js +4 -0
- package/dist/{EpList-DTN7D9wV.js → EpList-c0SMP53E.js} +1 -1
- package/dist/EpModal-CnTSNH-6.js +4 -0
- package/dist/{EpNothing-ChLi44xn.js → EpNothing-CT8_zyfI.js} +1 -1
- package/dist/EpObjective-CFUl1myw.js +4 -0
- package/dist/EpPieChart-D4gofeCO.js +4 -0
- package/dist/EpQuestion-DpEP1I3J.js +4 -0
- package/dist/EpQuote-D_a9FXrQ.js +4 -0
- package/dist/EpRadio-BPGeCsln.js +4 -0
- package/dist/EpRadioSummative-2GRkKBZC.js +4 -0
- package/dist/EpReading-b0gkhYIF.js +4 -0
- package/dist/EpResource-B1pFABU5.js +4 -0
- package/dist/EpScope-BQWyrqjD.js +4 -0
- package/dist/EpSection-CkXDsnuU.js +4 -0
- package/dist/EpSectionCols-BwC-XklV.js +4 -0
- package/dist/EpSkeleton-CfhwJtyP.js +4 -0
- package/dist/EpSoftware-c8ntWUO-.js +4 -0
- package/dist/EpSpecificObjective-D3mba6ZZ.js +4 -0
- package/dist/EpSpinner-G3e-rq8T.js +4 -0
- package/dist/EpStackedList-Bo0PTfJP.js +4 -0
- package/dist/EpSummativeTable-BumOFuw9.js +4 -0
- package/dist/EpSvg-D1zVHuRF.js +4 -0
- package/dist/EpSvgShow-CDYlL1_A.js +54 -0
- package/dist/EpTable-gr45PRwp.js +4 -0
- package/dist/EpTerm-CNfRoEdY.js +4 -0
- package/dist/EpText-DKuz6gcn.js +4 -0
- package/dist/EpTimeLine-O-XSTUsa.js +4 -0
- package/dist/EpVideo-DB3Kgada.js +4 -0
- package/dist/EpVideoPanopto-Vta3OP2y.js +4 -0
- package/dist/EpWordDef-CYOQAmor.js +4 -0
- package/dist/components/basics/EpImgCarousel.vue.d.ts +77 -0
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +1 -0
- package/dist/components/interactions/Ep360Image.vue.d.ts +1 -0
- package/dist/components/interactions/EpDraggable.vue.d.ts +26 -0
- package/dist/components/interactions/EpSvgShow.vue.d.ts +33 -1
- package/dist/components/medias/EpCarousel.vue.d.ts +5 -0
- package/dist/ep-lib-ts.js +30 -30
- package/dist/ep-lib-ts.umd.cjs +4600 -4766
- package/dist/{index-D-GKNNDO.js → index-DtabYqi-.js} +1 -1
- package/dist/{index-BFsz449L.js → index-hjRiaRG8.js} +3752 -3589
- package/dist/{prism-iP2cUnBs.js → prism-DpfMvZqf.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/three.module-CWLs6nMo.js +33752 -0
- package/dist/types/Draggable.d.ts +15 -0
- package/dist/types/Image.d.ts +5 -0
- package/package.json +4 -2
- package/src/components/basics/EpImg.vue +1 -1
- package/src/components/basics/EpImgCarousel.vue +145 -0
- package/src/components/basics/EpText.vue +20 -18
- package/src/components/educationals/EpBranchingScenario.vue +15 -6
- package/src/components/educationals/EpReading.vue +3 -3
- package/src/components/interactions/Ep360Image.vue +32 -11
- package/src/components/interactions/Ep360Video.vue +15 -3
- package/src/components/interactions/EpDraggable.vue +192 -0
- package/src/components/interactions/EpSvgShow.vue +91 -38
- package/src/components/medias/EpCarousel.vue +74 -11
- package/dist/BgAudio-BxmV-0cC.js +0 -4
- package/dist/DisplayBox-CUpEsLPU.js +0 -4
- package/dist/Ep360Image-Dmwx7NrY.js +0 -228
- package/dist/EpAlert-DZRwC-hR.js +0 -4
- package/dist/EpAudio-DWUaCLxZ.js +0 -4
- package/dist/EpAvatar-CB_8dpH1.js +0 -4
- package/dist/EpBadge-D2rYlVX2.js +0 -4
- package/dist/EpBarChart-20DIx08w.js +0 -4
- package/dist/EpBranchingScenario-CMBEwqVe.js +0 -151
- package/dist/EpBtn-D4Sib9BE.js +0 -4
- package/dist/EpCard-DJQezxQs.js +0 -4
- package/dist/EpCardLink-CZ10BP3M.js +0 -4
- package/dist/EpChip-BrlNEof-.js +0 -4
- package/dist/EpCodeblock-C-DQR2do.js +0 -4
- package/dist/EpConclusion-Cd2gP1Wh.js +0 -4
- package/dist/EpContentSlider-zQ7TcQlI.js +0 -4
- package/dist/EpDescription-Tbo3BFV2.js +0 -4
- package/dist/EpDivider-DVkzWELv.js +0 -4
- package/dist/EpEdu-B7If0gdy.js +0 -4
- package/dist/EpFlex-e5sNF2bY.js +0 -4
- package/dist/EpFunnelChart-DVJ_6KdY.js +0 -4
- package/dist/EpHeader-DNGWRkmf.js +0 -4
- package/dist/EpHover-_jWsMPY8.js +0 -4
- package/dist/EpHoverCard-C-BojFhi.js +0 -4
- package/dist/EpIcon-8MS-eLaB.js +0 -4
- package/dist/EpIframe-ClKZ7eIe.js +0 -4
- package/dist/EpImg-ZxP-DCOC.js +0 -4
- package/dist/EpInstructions-0UvWFAAP.js +0 -4
- package/dist/EpIntroduction-kwTAl-2S.js +0 -4
- package/dist/EpLineChart-DrqtLuL_.js +0 -4
- package/dist/EpLink-Be86I9U6.js +0 -4
- package/dist/EpLinkVersion-B4pxWTOZ.js +0 -4
- package/dist/EpModal-rL51M47q.js +0 -4
- package/dist/EpObjective-CDmtLCil.js +0 -4
- package/dist/EpPieChart--F20jSnB.js +0 -4
- package/dist/EpQuestion-B3bl3ED0.js +0 -4
- package/dist/EpQuote-WsTNUXP3.js +0 -4
- package/dist/EpRadio-5wRevOhg.js +0 -4
- package/dist/EpRadioSummative-Bhuk0G-D.js +0 -4
- package/dist/EpReading-DqNY4agb.js +0 -4
- package/dist/EpResource-CKx-Sm7H.js +0 -4
- package/dist/EpScope-CAGu6ain.js +0 -4
- package/dist/EpSection-Cs8w0x7y.js +0 -4
- package/dist/EpSectionCols-nBUK8VK3.js +0 -4
- package/dist/EpSkeleton-DBJIz_Yb.js +0 -4
- package/dist/EpSoftware-l7_8diQ_.js +0 -4
- package/dist/EpSpecificObjective-D2Sz35-I.js +0 -4
- package/dist/EpSpinner-BnfTBKN1.js +0 -4
- package/dist/EpStackedList-CtkpLHrV.js +0 -4
- package/dist/EpSummativeTable-CgQiZKos.js +0 -4
- package/dist/EpSvg-DDlhssE7.js +0 -4
- package/dist/EpSvgShow-DNKVoqjv.js +0 -84
- package/dist/EpTable-DriGGo4l.js +0 -4
- package/dist/EpTerm-DNfBy49u.js +0 -4
- package/dist/EpText-CrfoaXl_.js +0 -4
- package/dist/EpTimeLine-CRwBWqNV.js +0 -4
- package/dist/EpVideo-DV8hETkp.js +0 -4
- package/dist/EpVideoPanopto-588sRcMP.js +0 -4
- package/dist/EpWordDef-BuZFiK1M.js +0 -4
- package/dist/three.module-laS36oD-.js +0 -48903
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { defineComponent as T, ref as p, onMounted as $, createElementBlock as u, openBlock as d, createElementVNode as r, createCommentVNode as b, Fragment as _, renderList as j } from "vue";
|
|
2
|
+
import { V as x, Q as q } from "./three.module-CWLs6nMo.js";
|
|
3
|
+
const V = { style: { width: "800px", height: "600px", overflow: "hidden", position: "relative", margin: "auto" } }, W = ["id"], H = ["id", "src"], L = ["src"], B = ["position"], N = ["color", "material", "onClick", "onMouseenter"], z = ["position"], G = ["value"], J = ["value"], K = ["position"], U = ["value"], X = ["value"], ee = /* @__PURE__ */ T({
|
|
4
|
+
__name: "Ep360Image",
|
|
5
|
+
props: {
|
|
6
|
+
scenes: {},
|
|
7
|
+
id: {}
|
|
8
|
+
},
|
|
9
|
+
setup(C) {
|
|
10
|
+
const v = C, f = p(0), a = p(null), i = p(null), s = window.AFRAME;
|
|
11
|
+
s.components["rotation-reader"] || s.registerComponent("rotation-reader", {
|
|
12
|
+
schema: {},
|
|
13
|
+
tick: w()
|
|
14
|
+
});
|
|
15
|
+
function A(e, t) {
|
|
16
|
+
if (e && ((e == null ? void 0 : e.event) === "onClick" || !e.event)) {
|
|
17
|
+
if (e.type == "descriptive")
|
|
18
|
+
i.value = e, t.target.setAttribute("material", "opacity: 0; transparent: true"), console.log("Marker clicked:", e);
|
|
19
|
+
else if (e.type == "action") {
|
|
20
|
+
const o = v.scenes.findIndex(
|
|
21
|
+
(n) => n.id === e.scene
|
|
22
|
+
);
|
|
23
|
+
o !== -1 && (f.value = o), console.log(
|
|
24
|
+
"Action Pin Clicked. Scene switched to:",
|
|
25
|
+
f.value
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function P(e, t) {
|
|
31
|
+
e && ((e == null ? void 0 : e.event) === "onHover" || !(e != null && e.event)) && (a.value = e, t.target.setAttribute("material", "opacity: 0; transparent: true"), console.log("Marker hovered:", e));
|
|
32
|
+
}
|
|
33
|
+
function E(e, t) {
|
|
34
|
+
var n;
|
|
35
|
+
if (!e) return;
|
|
36
|
+
const o = t.relatedTarget;
|
|
37
|
+
if ((e == null ? void 0 : e.event) === "onHover" || !(e != null && e.event)) {
|
|
38
|
+
const m = t.target;
|
|
39
|
+
console.log("children:", m.children), i.value == e && m.setAttribute("material", "opacity: 1; transparent: true"), !(o != null && o.classList.contains("interactive-area")) && ((n = a.value) == null ? void 0 : n.id) === (e == null ? void 0 : e.id) && (a.value = null, console.log("Hover cleared:", e));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function g(e, t) {
|
|
43
|
+
return `${e / 10} ${t / 10} -5`;
|
|
44
|
+
}
|
|
45
|
+
$(() => {
|
|
46
|
+
(async () => await M("rotation-reader", 2e3))(), (async () => await F(2e3))();
|
|
47
|
+
});
|
|
48
|
+
async function M(e, t = 1e3) {
|
|
49
|
+
s.components[e] && (await k(t), delete s.components[e]);
|
|
50
|
+
}
|
|
51
|
+
function k(e) {
|
|
52
|
+
return new Promise((t) => setTimeout(t, e));
|
|
53
|
+
}
|
|
54
|
+
async function F(e = 1e3) {
|
|
55
|
+
await k(e), s.components["rotation-reader"] && (console.warn(
|
|
56
|
+
"Existing rotation-reader component found. Re-registering..."
|
|
57
|
+
), delete s.components["rotation-reader"]), s.registerComponent("rotation-reader", {
|
|
58
|
+
schema: {},
|
|
59
|
+
tick: w()
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function w() {
|
|
63
|
+
const e = new q(), t = new x(), o = new x(), n = 5, m = 0.8;
|
|
64
|
+
return function() {
|
|
65
|
+
D(this.el.object3D, e);
|
|
66
|
+
const h = this.el.sceneEl;
|
|
67
|
+
R(e, h), this.el.object3D.getWorldPosition(t), h.querySelectorAll(".pin-marker").forEach((y) => {
|
|
68
|
+
const c = y.object3D;
|
|
69
|
+
if (c) {
|
|
70
|
+
c.getWorldPosition(o);
|
|
71
|
+
const l = t.distanceTo(o) * m / n;
|
|
72
|
+
c.scale.set(l, l, l);
|
|
73
|
+
}
|
|
74
|
+
}), h.querySelectorAll(".frame").forEach((y) => {
|
|
75
|
+
const c = y.object3D;
|
|
76
|
+
if (c) {
|
|
77
|
+
c.getWorldPosition(o);
|
|
78
|
+
const l = t.distanceTo(o) * m / n;
|
|
79
|
+
c.scale.set(l, l, l);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function O(e) {
|
|
85
|
+
return a.value && a.value.id === e || i.value && i.value.id === e ? 0 : 1;
|
|
86
|
+
}
|
|
87
|
+
function D(e, t) {
|
|
88
|
+
e.getWorldQuaternion(t);
|
|
89
|
+
}
|
|
90
|
+
function R(e, t) {
|
|
91
|
+
t.querySelectorAll(".pin-marker").forEach((o) => {
|
|
92
|
+
const n = o.object3D;
|
|
93
|
+
n && n.setRotationFromQuaternion(e);
|
|
94
|
+
}), t.querySelectorAll(".frame").forEach((o) => {
|
|
95
|
+
const n = o.object3D;
|
|
96
|
+
n && n.setRotationFromQuaternion(e);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function S() {
|
|
100
|
+
i.value = null;
|
|
101
|
+
}
|
|
102
|
+
function Q(e) {
|
|
103
|
+
return e.color || "indigo";
|
|
104
|
+
}
|
|
105
|
+
return (e, t) => (d(), u("div", V, [
|
|
106
|
+
r("a-scene", {
|
|
107
|
+
id: e.id,
|
|
108
|
+
embedded: ""
|
|
109
|
+
}, [
|
|
110
|
+
r("a-assets", null, [
|
|
111
|
+
(d(!0), u(_, null, j(v.scenes, (o) => (d(), u("img", {
|
|
112
|
+
key: o.id,
|
|
113
|
+
id: `image${o.id}`,
|
|
114
|
+
src: o.skyImage,
|
|
115
|
+
crossorigin: "anonymous"
|
|
116
|
+
}, null, 8, H))), 128))
|
|
117
|
+
]),
|
|
118
|
+
t[4] || (t[4] = r("a-entity", {
|
|
119
|
+
camera: "",
|
|
120
|
+
"look-controls": "",
|
|
121
|
+
id: "rig",
|
|
122
|
+
"rotation-reader": ""
|
|
123
|
+
}, [
|
|
124
|
+
r("a-cursor", {
|
|
125
|
+
id: "cursor",
|
|
126
|
+
cursor: "rayOrigin: mouse",
|
|
127
|
+
raycaster: "objects: none",
|
|
128
|
+
geometry: "primitive: ring; radiusInner: 0; radiusOuter: 0",
|
|
129
|
+
material: "opacity: 0; transparent: true"
|
|
130
|
+
})
|
|
131
|
+
], -1)),
|
|
132
|
+
r("a-sky", {
|
|
133
|
+
src: `#image${v.scenes[f.value].id}`,
|
|
134
|
+
radius: "100"
|
|
135
|
+
}, null, 8, L),
|
|
136
|
+
(d(!0), u(_, null, j(v.scenes[f.value].pins, (o) => (d(), u("a-entity", {
|
|
137
|
+
key: o.id,
|
|
138
|
+
position: g(o.x, o.y),
|
|
139
|
+
cursor: "rayOrigin: mouse"
|
|
140
|
+
}, [
|
|
141
|
+
r("a-circle", {
|
|
142
|
+
class: "pin-marker",
|
|
143
|
+
color: Q(o),
|
|
144
|
+
radius: "0.15",
|
|
145
|
+
shader: "flat",
|
|
146
|
+
material: `opacity: ${O(
|
|
147
|
+
o.id
|
|
148
|
+
)}; transparent: true;`,
|
|
149
|
+
onClick: (n) => A(o, n),
|
|
150
|
+
onMouseenter: (n) => P(o, n)
|
|
151
|
+
}, t[1] || (t[1] = [
|
|
152
|
+
r("a-circle", {
|
|
153
|
+
position: "0 0 0.01",
|
|
154
|
+
color: "#FFF",
|
|
155
|
+
radius: "0.05",
|
|
156
|
+
material: "opacity: 0;"
|
|
157
|
+
}, null, -1)
|
|
158
|
+
]), 40, N)
|
|
159
|
+
], 8, B))), 128)),
|
|
160
|
+
a.value ? (d(), u("a-entity", {
|
|
161
|
+
key: 0,
|
|
162
|
+
position: g(a.value.x, a.value.y),
|
|
163
|
+
class: "frame interactive-area",
|
|
164
|
+
cursor: "rayOrigin: mouse",
|
|
165
|
+
onMouseleave: t[0] || (t[0] = (o) => E(a.value, o))
|
|
166
|
+
}, [
|
|
167
|
+
t[2] || (t[2] = r("a-plane", {
|
|
168
|
+
color: "white",
|
|
169
|
+
opacity: 1,
|
|
170
|
+
width: "4",
|
|
171
|
+
height: "1.5",
|
|
172
|
+
material: "shader: standard; side: double;",
|
|
173
|
+
position: "0 0 0",
|
|
174
|
+
geometry: "primitive: plane; height: 1.5; width: 4;"
|
|
175
|
+
}, null, -1)),
|
|
176
|
+
r("a-text", {
|
|
177
|
+
value: a.value.title,
|
|
178
|
+
color: "#2c3e50",
|
|
179
|
+
font: "dejavu",
|
|
180
|
+
align: "center",
|
|
181
|
+
width: "3.8",
|
|
182
|
+
position: "0 0.3 0.01"
|
|
183
|
+
}, null, 8, G),
|
|
184
|
+
r("a-text", {
|
|
185
|
+
value: a.value.description,
|
|
186
|
+
color: "#34495e",
|
|
187
|
+
font: "dejavu",
|
|
188
|
+
align: "center",
|
|
189
|
+
width: "3.5",
|
|
190
|
+
position: "0 -0.3 0.01"
|
|
191
|
+
}, null, 8, J)
|
|
192
|
+
], 40, z)) : b("", !0),
|
|
193
|
+
i.value ? (d(), u("a-entity", {
|
|
194
|
+
key: 1,
|
|
195
|
+
position: g(i.value.x, i.value.y),
|
|
196
|
+
class: "frame interactive-area",
|
|
197
|
+
cursor: "rayOrigin: mouse"
|
|
198
|
+
}, [
|
|
199
|
+
t[3] || (t[3] = r("a-plane", {
|
|
200
|
+
color: "white",
|
|
201
|
+
opacity: 1,
|
|
202
|
+
width: "4",
|
|
203
|
+
height: "1.5",
|
|
204
|
+
material: "shader: standard; side: double;",
|
|
205
|
+
position: "0 0 0",
|
|
206
|
+
geometry: "primitive: plane; height: 1.5; width: 4;"
|
|
207
|
+
}, null, -1)),
|
|
208
|
+
r("a-plane", {
|
|
209
|
+
class: "close-frame",
|
|
210
|
+
color: "red",
|
|
211
|
+
width: "0.4",
|
|
212
|
+
height: "0.4",
|
|
213
|
+
position: "1.8 0.55 0.01",
|
|
214
|
+
material: "shader: flat; side: double; transparent: true;",
|
|
215
|
+
geometry: "primitive: plane; height: 0.4; width: 0.4;",
|
|
216
|
+
onClick: S
|
|
217
|
+
}),
|
|
218
|
+
r("a-text", {
|
|
219
|
+
value: i.value.title,
|
|
220
|
+
color: "#2c3e50",
|
|
221
|
+
font: "dejavu",
|
|
222
|
+
align: "center",
|
|
223
|
+
width: "3.8",
|
|
224
|
+
position: "0 0.3 0.01"
|
|
225
|
+
}, null, 8, U),
|
|
226
|
+
r("a-text", {
|
|
227
|
+
value: i.value.description,
|
|
228
|
+
color: "#34495e",
|
|
229
|
+
font: "dejavu",
|
|
230
|
+
align: "center",
|
|
231
|
+
width: "3.5",
|
|
232
|
+
position: "0 -0.3 0.01"
|
|
233
|
+
}, null, 8, X)
|
|
234
|
+
], 8, K)) : b("", !0)
|
|
235
|
+
], 8, W)
|
|
236
|
+
]));
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
export {
|
|
240
|
+
ee as default
|
|
241
|
+
};
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
const I = { style: { width: "1200px", height: "800px", position: "relative", margin: "auto" } }, L = { embedded: "" }, B = ["id", "src"], N = ["src"], z = ["position"], G = ["color", "material", "onClick", "onMouseenter", "onMouseleave"], J = ["position"], K = ["value"], U = ["value"], X = ["position"], Y = ["value"], Z = ["value"], oe = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as q, ref as h, onMounted as T, createElementBlock as s, openBlock as l, createElementVNode as n, toDisplayString as W, createCommentVNode as x, Fragment as p, renderList as k } from "vue";
|
|
2
|
+
import { V as P, Q as H } from "./three.module-CWLs6nMo.js";
|
|
3
|
+
const I = { style: { width: "1200px", height: "800px", position: "relative", margin: "auto" } }, L = { embedded: "" }, B = ["id", "src"], N = ["src"], z = ["position"], G = ["color", "material", "onClick", "onMouseenter", "onMouseleave"], J = ["position"], K = ["value"], U = ["value"], X = ["position"], Y = ["value"], Z = ["value"], oe = /* @__PURE__ */ q({
|
|
4
4
|
__name: "Ep360Video",
|
|
5
5
|
props: {
|
|
6
6
|
scenes: {}
|
|
7
7
|
},
|
|
8
8
|
setup(C) {
|
|
9
|
-
const v = C, m = h(0), r = h(null), a = h(null), f = h(!1);
|
|
10
|
-
|
|
9
|
+
const v = C, m = h(0), r = h(null), a = h(null), f = h(!1), c = window.AFRAME;
|
|
10
|
+
c.components["rotation-reader"] || c.registerComponent("rotation-reader", {
|
|
11
11
|
schema: {},
|
|
12
|
-
tick:
|
|
12
|
+
tick: _()
|
|
13
13
|
});
|
|
14
|
-
function E(e,
|
|
14
|
+
function E(e, t) {
|
|
15
15
|
if (e && (e == null ? void 0 : e.event) === "onClick") {
|
|
16
16
|
if (e.type === "descriptive")
|
|
17
|
-
a.value = e,
|
|
17
|
+
a.value = e, t.target.setAttribute("material", "opacity: 0; transparent: true"), console.log("Marker clicked:", e);
|
|
18
18
|
else if (e.type === "action") {
|
|
19
|
-
const
|
|
19
|
+
const o = v.scenes.findIndex(
|
|
20
20
|
(i) => i.id === e.scene
|
|
21
21
|
);
|
|
22
|
-
|
|
22
|
+
o !== -1 && (m.value = o), console.log(
|
|
23
23
|
"Action Pin Clicked. Scene switched to:",
|
|
24
24
|
m.value
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function M(e,
|
|
29
|
+
function M(e, t) {
|
|
30
30
|
e && (e.event === "onHover" || !e.event) && (r.value = e, console.log("Marker hovered:", e));
|
|
31
31
|
}
|
|
32
|
-
function w(e,
|
|
32
|
+
function w(e, t) {
|
|
33
33
|
var i;
|
|
34
34
|
if (!e) return;
|
|
35
|
-
const
|
|
36
|
-
(e.event === "onHover" || !(e != null && e.event)) && !(
|
|
35
|
+
const o = t.relatedTarget;
|
|
36
|
+
(e.event === "onHover" || !(e != null && e.event)) && !(o != null && o.classList.contains("interactive-area")) && ((i = r.value) == null ? void 0 : i.id) === e.id && (r.value = null, console.log("Hover cleared:", e));
|
|
37
37
|
}
|
|
38
|
-
function g(e,
|
|
39
|
-
return `${e / 10} ${
|
|
38
|
+
function g(e, t) {
|
|
39
|
+
return `${e / 10} ${t / 10} -5`;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function A() {
|
|
42
42
|
a.value = null;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function F(e) {
|
|
45
45
|
return e.color || "indigo";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function O(e) {
|
|
48
48
|
return r.value && r.value.id === e || a.value && a.value.id === e ? 0 : 1;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
f.value = !f.value, document.querySelectorAll(".video").forEach((
|
|
52
|
-
f.value ?
|
|
50
|
+
function S() {
|
|
51
|
+
f.value = !f.value, document.querySelectorAll(".video").forEach((t) => {
|
|
52
|
+
f.value ? t.play() : t.pause();
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
T(() => {
|
|
56
|
-
(async () => await
|
|
56
|
+
(async () => await D("rotation-reader", 2e3))(), (async () => await R(2e3))();
|
|
57
57
|
});
|
|
58
|
-
async function
|
|
59
|
-
|
|
58
|
+
async function D(e, t = 1e3) {
|
|
59
|
+
c.components[e] && (await b(t), delete c.components[e]);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return new Promise((
|
|
61
|
+
function b(e) {
|
|
62
|
+
return new Promise((t) => setTimeout(t, e));
|
|
63
63
|
}
|
|
64
|
-
async function
|
|
65
|
-
await
|
|
64
|
+
async function R(e = 1e3) {
|
|
65
|
+
await b(e), c.components["rotation-reader"] && (console.warn("Existing rotation-reader found. Re-registering..."), delete c.components["rotation-reader"]), c.registerComponent("rotation-reader", {
|
|
66
66
|
schema: {},
|
|
67
|
-
tick:
|
|
67
|
+
tick: _()
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
const e = new H(),
|
|
70
|
+
function _() {
|
|
71
|
+
const e = new H(), t = new P(), o = new P(), i = 5, j = 0.8;
|
|
72
72
|
return function() {
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
73
|
+
V(this.el.object3D, e), Q(e), this.el.object3D.getWorldPosition(t), document.querySelectorAll(".pin-marker").forEach((y) => {
|
|
74
|
+
const u = y.object3D;
|
|
75
|
+
if (u) {
|
|
76
|
+
u.getWorldPosition(o);
|
|
77
|
+
const d = t.distanceTo(o) * j / i;
|
|
78
|
+
u.scale.set(d, d, d);
|
|
79
79
|
}
|
|
80
80
|
}), document.querySelectorAll(".frame").forEach((y) => {
|
|
81
|
-
const
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
81
|
+
const u = y.object3D;
|
|
82
|
+
if (u) {
|
|
83
|
+
u.getWorldPosition(o);
|
|
84
|
+
const d = t.distanceTo(o) * j / i;
|
|
85
|
+
u.scale.set(d, d, d);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
e.getWorldQuaternion(
|
|
90
|
+
function V(e, t) {
|
|
91
|
+
e.getWorldQuaternion(t);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
document.querySelectorAll(".pin-marker").forEach((
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
}), document.querySelectorAll(".frame").forEach((
|
|
98
|
-
const
|
|
99
|
-
|
|
93
|
+
function Q(e) {
|
|
94
|
+
document.querySelectorAll(".pin-marker").forEach((t) => {
|
|
95
|
+
const o = t.object3D;
|
|
96
|
+
o && o.setRotationFromQuaternion(e);
|
|
97
|
+
}), document.querySelectorAll(".frame").forEach((t) => {
|
|
98
|
+
const o = t.object3D;
|
|
99
|
+
o && o.setRotationFromQuaternion(e);
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
return (e,
|
|
102
|
+
return (e, t) => (l(), s("div", I, [
|
|
103
103
|
n("button", {
|
|
104
|
-
onClick:
|
|
104
|
+
onClick: t[0] || (t[0] = (o) => S())
|
|
105
105
|
}, W(f.value ? "Pause" : "Play"), 1),
|
|
106
106
|
n("a-scene", L, [
|
|
107
107
|
n("a-assets", null, [
|
|
108
|
-
(l(!0), s(p, null, k(v.scenes, (
|
|
109
|
-
id: `video${
|
|
110
|
-
src:
|
|
108
|
+
(l(!0), s(p, null, k(v.scenes, (o) => (l(), s("video", {
|
|
109
|
+
id: `video${o.id}`,
|
|
110
|
+
src: o.skyVideo,
|
|
111
111
|
muted: "",
|
|
112
112
|
class: "video",
|
|
113
113
|
playsinline: "",
|
|
@@ -115,7 +115,7 @@ const I = { style: { width: "1200px", height: "800px", position: "relative", mar
|
|
|
115
115
|
crossorigin: "anonymous"
|
|
116
116
|
}, null, 8, B))), 256))
|
|
117
117
|
]),
|
|
118
|
-
|
|
118
|
+
t[5] || (t[5] = n("a-entity", {
|
|
119
119
|
camera: "",
|
|
120
120
|
"look-controls": "",
|
|
121
121
|
id: "rig",
|
|
@@ -129,36 +129,43 @@ const I = { style: { width: "1200px", height: "800px", position: "relative", mar
|
|
|
129
129
|
material: "opacity: 0; transparent: true"
|
|
130
130
|
})
|
|
131
131
|
], -1)),
|
|
132
|
-
(l(!0), s(p, null, k(v.scenes, (
|
|
133
|
-
key:
|
|
132
|
+
(l(!0), s(p, null, k(v.scenes, (o) => (l(), s("a-videosphere", {
|
|
133
|
+
key: o.id,
|
|
134
134
|
src: `#video${v.scenes[m.value].id}`
|
|
135
135
|
}, null, 8, N))), 128)),
|
|
136
|
-
(l(!0), s(p, null, k(v.scenes[m.value].pins, (
|
|
137
|
-
key:
|
|
138
|
-
position: g(
|
|
136
|
+
(l(!0), s(p, null, k(v.scenes[m.value].pins, (o) => (l(), s("a-entity", {
|
|
137
|
+
key: o.id,
|
|
138
|
+
position: g(o.x, o.y),
|
|
139
139
|
cursor: "rayOrigin: mouse"
|
|
140
140
|
}, [
|
|
141
141
|
n("a-circle", {
|
|
142
142
|
class: "pin-marker",
|
|
143
|
-
color:
|
|
144
|
-
radius: "0.
|
|
143
|
+
color: F(o),
|
|
144
|
+
radius: "0.15",
|
|
145
145
|
shader: "flat",
|
|
146
|
-
material: `opacity: ${
|
|
147
|
-
|
|
146
|
+
material: `opacity: ${O(
|
|
147
|
+
o.id
|
|
148
148
|
)}; transparent: true`,
|
|
149
|
-
onClick: (i) => E(
|
|
150
|
-
onMouseenter: (i) => M(
|
|
151
|
-
onMouseleave: (i) => w(
|
|
152
|
-
},
|
|
149
|
+
onClick: (i) => E(o, i),
|
|
150
|
+
onMouseenter: (i) => M(o),
|
|
151
|
+
onMouseleave: (i) => w(o, i)
|
|
152
|
+
}, t[2] || (t[2] = [
|
|
153
|
+
n("a-circle", {
|
|
154
|
+
position: "0 0 0.01",
|
|
155
|
+
color: "#FFF",
|
|
156
|
+
radius: "0.05",
|
|
157
|
+
material: "opacity: 0;"
|
|
158
|
+
}, null, -1)
|
|
159
|
+
]), 40, G)
|
|
153
160
|
], 8, z))), 128)),
|
|
154
161
|
r.value ? (l(), s("a-entity", {
|
|
155
162
|
key: 0,
|
|
156
163
|
position: g(r.value.x, r.value.y),
|
|
157
164
|
class: "frame interactive-area",
|
|
158
165
|
cursor: "rayOrigin: mouse",
|
|
159
|
-
onMouseleave:
|
|
166
|
+
onMouseleave: t[1] || (t[1] = (o) => w(r.value, o))
|
|
160
167
|
}, [
|
|
161
|
-
|
|
168
|
+
t[3] || (t[3] = n("a-plane", {
|
|
162
169
|
color: "white",
|
|
163
170
|
opacity: 1,
|
|
164
171
|
width: "4",
|
|
@@ -183,14 +190,14 @@ const I = { style: { width: "1200px", height: "800px", position: "relative", mar
|
|
|
183
190
|
width: "3.5",
|
|
184
191
|
position: "0 -0.3 0.01"
|
|
185
192
|
}, null, 8, U)
|
|
186
|
-
], 40, J)) :
|
|
193
|
+
], 40, J)) : x("", !0),
|
|
187
194
|
a.value ? (l(), s("a-entity", {
|
|
188
195
|
key: 1,
|
|
189
196
|
position: g(a.value.x, a.value.y),
|
|
190
197
|
class: "frame interactive-area",
|
|
191
198
|
cursor: "rayOrigin: mouse"
|
|
192
199
|
}, [
|
|
193
|
-
|
|
200
|
+
t[4] || (t[4] = n("a-plane", {
|
|
194
201
|
color: "white",
|
|
195
202
|
opacity: 1,
|
|
196
203
|
width: "4",
|
|
@@ -207,7 +214,7 @@ const I = { style: { width: "1200px", height: "800px", position: "relative", mar
|
|
|
207
214
|
position: "1.8 0.55 0.01",
|
|
208
215
|
material: "shader: flat; side: double; transparent: true;",
|
|
209
216
|
geometry: "primitive: plane; height: 0.4; width: 0.4;",
|
|
210
|
-
onClick:
|
|
217
|
+
onClick: A
|
|
211
218
|
}),
|
|
212
219
|
n("a-text", {
|
|
213
220
|
value: a.value.title,
|
|
@@ -225,7 +232,7 @@ const I = { style: { width: "1200px", height: "800px", position: "relative", mar
|
|
|
225
232
|
width: "3.5",
|
|
226
233
|
position: "0 -0.3 0.01"
|
|
227
234
|
}, null, 8, Z)
|
|
228
|
-
], 8, X)) :
|
|
235
|
+
], 8, X)) : x("", !0)
|
|
229
236
|
])
|
|
230
237
|
]));
|
|
231
238
|
}
|