ep-lib-ts 1.0.51 → 1.0.53
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-DVqw9Nm5.js +4 -0
- package/dist/Details-7B2B5Zpd.js +4 -0
- package/dist/DisplayBox-keZ6EJSM.js +4 -0
- package/dist/Ep360Image-T9Z_eSbf.js +10 -0
- package/dist/Ep360Video-CkVrfj8k.js +10 -0
- package/dist/EpAlert-C7ESUQMp.js +4 -0
- package/dist/EpAudio-B4CMouzp.js +4 -0
- package/dist/EpAvatar-HgAYI-G8.js +4 -0
- package/dist/EpBadge-B1TCZREp.js +4 -0
- package/dist/EpBarChart-DLsUDjll.js +4 -0
- package/dist/EpBtn-C7RZAtmE.js +4 -0
- package/dist/EpCard-e3PlDwjZ.js +4 -0
- package/dist/EpCardLink-wV2KCxc-.js +4 -0
- package/dist/EpChip-DaR4OmgC.js +4 -0
- package/dist/EpCodeblock-Ccq9T4Oo.js +4 -0
- package/dist/EpConclusion-DuW6s2Kg.js +4 -0
- package/dist/EpContentSlider-CYZkQWdG.js +4 -0
- package/dist/{EpDarkmode-DjqBE3PK.js → EpDarkmode-BaN4YUiN.js} +1 -1
- package/dist/EpDescription-DM9l4Vx8.js +4 -0
- package/dist/EpDivider-BFO4qXNQ.js +4 -0
- package/dist/EpDocument-CUegV3T2.js +4 -0
- package/dist/{EpDraggable-BdqCt0bX.js → EpDraggable-CxFVO0CO.js} +1 -1
- package/dist/EpEdu-Dacd0Lc7.js +4 -0
- package/dist/EpFlex-DLwZuygN.js +4 -0
- package/dist/EpFunnelChart-cmzrWVHV.js +4 -0
- package/dist/EpHeader-CTAwEG1T.js +4 -0
- package/dist/EpHover-BJIdqWVB.js +4 -0
- package/dist/EpHoverCard-DC20JMSr.js +4 -0
- package/dist/EpIcon-4Z7RS4OH.js +4 -0
- package/dist/EpIframe-CKkC-pLC.js +4 -0
- package/dist/EpImg-MgDO1oi1.js +4 -0
- package/dist/EpImgCarousel-Cq8kTVrS.js +4 -0
- package/dist/{EpInput-Dn3ZhCkT.js → EpInput-CnrS372r.js} +1 -1
- package/dist/EpInstructions-D3EHn7HY.js +4 -0
- package/dist/EpIntroduction-BstyHSxJ.js +4 -0
- package/dist/EpLineChart-CjEd4xIr.js +4 -0
- package/dist/EpLink-D3iLSt57.js +4 -0
- package/dist/EpLinkVersion-CDbADS82.js +4 -0
- package/dist/{EpList-Yhz8LAhH.js → EpList-B6uNyw7z.js} +1 -1
- package/dist/EpModal-CsAO3Czp.js +4 -0
- package/dist/{EpNothing-TCBDkSPe.js → EpNothing-DtIooSft.js} +1 -1
- package/dist/EpObjective-Dw-WvSbL.js +4 -0
- package/dist/EpPieChart-BCtBWkxe.js +4 -0
- package/dist/EpQuestion-Hgznprlu.js +4 -0
- package/dist/EpQuote-CQLvUeVK.js +4 -0
- package/dist/EpRadio-DSRwVaD-.js +4 -0
- package/dist/EpRadioSummative-Dfh6pzsV.js +4 -0
- package/dist/EpReading-D0KkKNuU.js +4 -0
- package/dist/EpResource-CX599YKk.js +4 -0
- package/dist/EpScope-Cgx6HIBY.js +4 -0
- package/dist/EpSection-BD8bxHMp.js +4 -0
- package/dist/EpSectionCols-CqB3bUwU.js +4 -0
- package/dist/EpSkeleton-CN6QVbDm.js +4 -0
- package/dist/EpSoftware-DtMceEP0.js +4 -0
- package/dist/EpSpecificObjective-DpXhc11z.js +4 -0
- package/dist/EpSpinner-BqHqN5WU.js +4 -0
- package/dist/EpStackedList-DHuRW3oE.js +4 -0
- package/dist/EpSummativeTable-CoaHpCx_.js +4 -0
- package/dist/EpSvg-CnDKjTfO.js +4 -0
- package/dist/EpSvgShow-OGT303CY.js +4 -0
- package/dist/EpTable-BclCLFna.js +4 -0
- package/dist/EpTerm-DjJx2Buo.js +4 -0
- package/dist/EpText-CyRRZ8hC.js +4 -0
- package/dist/EpTimeLine-BuyySG7Z.js +4 -0
- package/dist/EpVideo-Bt0yvFYN.js +4 -0
- package/dist/EpVideoPanopto-D3wjsXiS.js +4 -0
- package/dist/EpWordDef-C330Ll3A.js +4 -0
- package/dist/TextMedia-h-DXXeI6.js +4 -0
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +1 -0
- package/dist/components/interactions/Ep360Image.vue.d.ts +1 -16
- package/dist/components/interactions/Ep360Video.vue.d.ts +1 -15
- package/dist/components/medias/EpLottieSvg.vue.d.ts +1 -1
- package/dist/components/tools/TextMedia.vue.d.ts +2 -0
- package/dist/ep-lib-ts.js +1 -1
- package/dist/ep-lib-ts.umd.cjs +91 -4951
- package/dist/{index-DVN62rPz.js → index-BUDqjQYW.js} +1 -1
- package/dist/{index-BZh3ZH_r.js → index-BeTpNY6O.js} +1999 -1984
- package/dist/{prism-CnGAWjP8.js → prism-CV0akvnc.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/types/Component.d.ts +1 -0
- package/dist/types/Hierarchy.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/basics/EpCard.vue +2 -2
- package/src/components/educationals/EpBranchingScenario.vue +31 -44
- package/src/components/educationals/EpDocument.vue +1 -1
- package/src/components/forms/EpSwitch.vue +0 -1
- package/src/components/interactions/Ep360Image.vue +130 -157
- package/src/components/interactions/Ep360Video.vue +13 -8
- package/src/components/tools/Details.vue +1 -0
- package/src/components/tools/TextMedia.vue +12 -2
- package/dist/BgAudio-CfOyhY60.js +0 -4
- package/dist/Details-C2ibtnG1.js +0 -4
- package/dist/DisplayBox-842AxmPD.js +0 -4
- package/dist/Ep360Image-DHK_IWTi.js +0 -241
- package/dist/Ep360Video-C4PekHTc.js +0 -242
- package/dist/EpAlert-D_1oS26j.js +0 -4
- package/dist/EpAudio-CkAmtlFP.js +0 -4
- package/dist/EpAvatar-C3aEQ8pb.js +0 -4
- package/dist/EpBadge-DTAqBHg0.js +0 -4
- package/dist/EpBarChart-B477k9Ot.js +0 -4
- package/dist/EpBtn-w2CaP7VV.js +0 -4
- package/dist/EpCard-BBn794w5.js +0 -4
- package/dist/EpCardLink-BXD2hNWN.js +0 -4
- package/dist/EpChip-D7yiZLYj.js +0 -4
- package/dist/EpCodeblock-Csmouv_q.js +0 -4
- package/dist/EpConclusion-B3uB1fwu.js +0 -4
- package/dist/EpContentSlider-DhQqokB-.js +0 -4
- package/dist/EpDescription-DXFCekiB.js +0 -4
- package/dist/EpDivider-DuqIp04O.js +0 -4
- package/dist/EpDocument-kCCmYdZd.js +0 -4
- package/dist/EpEdu-Cmoe0FPr.js +0 -4
- package/dist/EpFlex-B5vaUPNy.js +0 -4
- package/dist/EpFunnelChart-CCY-RIHg.js +0 -4
- package/dist/EpHeader-hbN7H1zv.js +0 -4
- package/dist/EpHover-BEfGwtRy.js +0 -4
- package/dist/EpHoverCard-CLc-BteV.js +0 -4
- package/dist/EpIcon-DBG-wtLX.js +0 -4
- package/dist/EpIframe-B8sHwop-.js +0 -4
- package/dist/EpImg-CmzA6uO-.js +0 -4
- package/dist/EpImgCarousel-CV6GYKIV.js +0 -4
- package/dist/EpInstructions-_ZpOEQkA.js +0 -4
- package/dist/EpIntroduction-LMhdJymO.js +0 -4
- package/dist/EpLineChart-BTfB4-nk.js +0 -4
- package/dist/EpLink-D_RoQCwk.js +0 -4
- package/dist/EpLinkVersion-CyJ5Zso3.js +0 -4
- package/dist/EpModal-D6002RFz.js +0 -4
- package/dist/EpObjective-me7OFFWn.js +0 -4
- package/dist/EpPieChart-C0myD-Lh.js +0 -4
- package/dist/EpQuestion-Dgd_r9Di.js +0 -4
- package/dist/EpQuote-CerpN43p.js +0 -4
- package/dist/EpRadio-D788J3ol.js +0 -4
- package/dist/EpRadioSummative-CpBwOYCi.js +0 -4
- package/dist/EpReading-wcrCpcQ-.js +0 -4
- package/dist/EpResource-Dh038rvl.js +0 -4
- package/dist/EpScope-N1_GpZry.js +0 -4
- package/dist/EpSection-BtV8HQLl.js +0 -4
- package/dist/EpSectionCols-CVaWBh4Z.js +0 -4
- package/dist/EpSkeleton-PLY2DMXj.js +0 -4
- package/dist/EpSoftware--IWOZC1R.js +0 -4
- package/dist/EpSpecificObjective-CH7jCrOb.js +0 -4
- package/dist/EpSpinner-BnJarh6N.js +0 -4
- package/dist/EpStackedList-CB9birW-.js +0 -4
- package/dist/EpSummativeTable-C5HW1Sk5.js +0 -4
- package/dist/EpSvg-F4ikbEKY.js +0 -4
- package/dist/EpSvgShow-CEdQpJyn.js +0 -4
- package/dist/EpTable-SSCSZK__.js +0 -4
- package/dist/EpTerm-_NGJgmG0.js +0 -4
- package/dist/EpText-CzSBl1zy.js +0 -4
- package/dist/EpTimeLine-BnK4Gl34.js +0 -4
- package/dist/EpVideo-DLYxwxnk.js +0 -4
- package/dist/EpVideoPanopto-BOx_s1Qa.js +0 -4
- package/dist/EpWordDef-CGSFlRbS.js +0 -4
- package/dist/TextMedia-ovcNIdCV.js +0 -4
- package/dist/three.module-B-oqC8Xk.js +0 -33752
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.content[data-v-3a321611]{max-height:0;overflow:hidden}.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.custom_index{z-index:9999;position:absolute;right:12rem}pre{white-space:break-spaces}.tree-wrapper[data-v-633f0b83]{overflow:auto;border:1px solid #ddd}.tree-container[data-v-633f0b83]{width:100%;overflow-x:auto}@keyframes fade-
|
|
1
|
+
.content[data-v-3a321611]{max-height:0;overflow:hidden}.modal-mask{position:fixed;z-index:9998;top:0;left:0;width:100%;height:100%;background-color:#00000080;display:flex;transition:opacity .3s ease}.modal-container{margin:auto;max-height:95%;transition:all .3s ease;z-index:9999}.modal-header h3{margin-top:0;color:#42b983}.modal-body{margin:20px 0}.modal-default-button{float:right}.modal-enter-from,.modal-leave-to{opacity:0}.modal-enter-from .modal-container,.modal-leave-to .modal-container{transform:scale(1.1)}.custom_index{z-index:9999;position:absolute;right:12rem}pre{white-space:break-spaces}.tree-wrapper[data-v-633f0b83]{overflow:auto;border:1px solid #ddd}.tree-container[data-v-633f0b83]{width:100%;overflow-x:auto}@keyframes fade-d75b43b7{0%{opacity:0}to{opacity:1}}@keyframes scale-d75b43b7{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}@keyframes slideY-d75b43b7{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}.fade[data-v-d75b43b7]{animation:fade-d75b43b7 1s}.scale[data-v-d75b43b7]{animation:scale-d75b43b7 1s}.slideY[data-v-d75b43b7]{animation:slideY-d75b43b7 1s}.shape{height:var(--57a4c52c);width:var(--32b5e5ba)}.v-enter-active[data-v-7e484601],.v-leave-active[data-v-7e484601]{transition:opacity .5s ease}.v-enter-from[data-v-7e484601],.v-leave-to[data-v-7e484601]{opacity:0}.katex[data-v-a5d595cd]{font-size:1.6em}.content[data-v-1ad88e28]{max-height:0;overflow:hidden}.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.arrow-light-top:before{content:" ";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:rgba(0,0,0,.2) transparent transparent transparent}.arrow-dark-top:before{content:" ";position:absolute;top:100%;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:black transparent transparent transparent}.arrow-light-bottom:before{content:"";position:absolute;display:inline-block;left:50%;bottom:100%;border-right:7px solid transparent;border-bottom:7px solid #eee;border-left:7px solid transparent;border-bottom-color:#0003}.arrow-dark-bottom:before{content:"";position:absolute;display:inline-block;left:50%;bottom:100%;border-right:7px solid transparent;border-bottom:7px solid black;border-left:7px solid transparent;border-bottom-color:black transparent transparent transparent}.arrow-light-left:before{position:absolute;display:inline-block;left:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-left:5px solid #eee;border-bottom:5px solid transparent;border-left-color:#0003}.arrow-dark-left:before{position:absolute;display:inline-block;left:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-left:5px solid black;border-bottom:5px solid transparent;border-left-color:black transparent transparent transparent}.arrow-light-right:before{position:absolute;display:inline-block;right:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-right:5px solid #eee;border-bottom:5px solid transparent;border-right-color:#0003}.arrow-dark-right:before{position:absolute;display:inline-block;right:100%;top:50%;content:"";margin-right:0;border-top:5px solid transparent;border-right:5px solid black;border-bottom:5px solid transparent;border-right-color:black transparent transparent transparent}
|
|
@@ -7,6 +7,7 @@ export interface TreeNode {
|
|
|
7
7
|
active?: boolean;
|
|
8
8
|
text?: string;
|
|
9
9
|
component?: NestedComponents;
|
|
10
|
+
cols?: boolean;
|
|
10
11
|
}
|
|
11
12
|
type TailwindShade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800;
|
|
12
13
|
type TailwindColor = 'main-color' | 'primary' | 'red' | 'orange' | 'amber' | 'yellow' | 'lime' | 'green' | 'emerald' | 'teal' | 'cyan' | 'sky' | 'blue' | 'indigo' | 'violet' | 'purple' | 'fuchsia' | 'pink' | 'rose';
|
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@ const hasContent = computed(() => {
|
|
|
101
101
|
<template>
|
|
102
102
|
<div :class="`${stylesCard} ${isLinkStyle}`">
|
|
103
103
|
<img v-if="src" :src="src" :class="`w-full ${hasContent ? 'rounded-t-md':'rounded-md'}`" alt="header card">
|
|
104
|
-
<div v-if="!src && svg" class="w-full rounded-t-md">
|
|
104
|
+
<div v-if="!src && svg" class="w-full rounded-t-md dark:text-white">
|
|
105
105
|
<EpSvg :content="svg"/>
|
|
106
106
|
</div>
|
|
107
107
|
|
|
@@ -112,7 +112,7 @@ const hasContent = computed(() => {
|
|
|
112
112
|
<h4 :class="`text-xs dark:text-white ${subTitleText}`">{{ subtitle }}</h4>
|
|
113
113
|
</div>
|
|
114
114
|
<div v-if="icon">
|
|
115
|
-
<EpIcon :icon-path="icon"></EpIcon>
|
|
115
|
+
<EpIcon :icon-path="icon" extra-class="dark:text-white"></EpIcon>
|
|
116
116
|
</div>
|
|
117
117
|
</div>
|
|
118
118
|
<slot name="card-header"></slot>
|
|
@@ -13,19 +13,11 @@ import { mdiArrowLeft } from "@mdi/js";
|
|
|
13
13
|
import TextMedia from "../tools/TextMedia.vue";
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
// Defining the props
|
|
17
|
-
|
|
18
|
-
interface Option {
|
|
19
|
-
name: string;
|
|
20
|
-
question: string;
|
|
21
|
-
media?:NestedComponents;
|
|
22
|
-
options?: Option[];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
16
|
interface Props {
|
|
26
17
|
title: string;
|
|
27
18
|
media?:NestedComponents;
|
|
28
19
|
initialInstruction?: string | null;
|
|
20
|
+
initialTwoCols?:boolean;
|
|
29
21
|
generalFeedback?: string;
|
|
30
22
|
bgColor?: string;
|
|
31
23
|
decisionTree: TreeNode
|
|
@@ -69,6 +61,18 @@ const start = () => {
|
|
|
69
61
|
currentOption.value = props.decisionTree
|
|
70
62
|
}
|
|
71
63
|
|
|
64
|
+
const styleIntro = computed(() => {
|
|
65
|
+
const noInstruction = !props.initialInstruction;
|
|
66
|
+
const noMedia = !props.media;
|
|
67
|
+
|
|
68
|
+
if (noInstruction && noMedia) {
|
|
69
|
+
return 'pt-44';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return '';
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
|
|
72
76
|
|
|
73
77
|
|
|
74
78
|
// Return function
|
|
@@ -116,7 +120,6 @@ const nextSlide = (option:TreeNode) => {
|
|
|
116
120
|
//helper function
|
|
117
121
|
function convertOptionToTreeNode(option: TreeNode, path: TreeNode[]): TreeNode {
|
|
118
122
|
const isActive = path.includes(option);
|
|
119
|
-
|
|
120
123
|
return {
|
|
121
124
|
name: option.name,
|
|
122
125
|
text: option.text,
|
|
@@ -127,38 +130,20 @@ function convertOptionToTreeNode(option: TreeNode, path: TreeNode[]): TreeNode {
|
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
|
|
130
|
-
//styles computed
|
|
131
|
-
|
|
132
|
-
const gridStyle = computed(()=>{
|
|
133
|
-
if(currentOption.value &&
|
|
134
|
-
currentOption.value.children &&
|
|
135
|
-
currentOption.value.children?.length <= 2) {
|
|
136
|
-
return 'grid-cols-2'
|
|
137
|
-
}
|
|
138
|
-
return 'grid-cols-3'
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
const currentLengthOptions = computed(()=> {
|
|
142
|
-
if(currentOption.value && currentOption.value.children){
|
|
143
|
-
return currentOption.value.children.length
|
|
144
|
-
}
|
|
145
|
-
return 0
|
|
146
|
-
})
|
|
147
|
-
|
|
148
133
|
|
|
149
134
|
</script>
|
|
150
135
|
|
|
151
136
|
<template>
|
|
152
137
|
<div>
|
|
153
138
|
<div
|
|
154
|
-
class="
|
|
139
|
+
class=" bg-gray-200 dark:bg-slate-800 rounded-md p-4 flex flex-col"
|
|
155
140
|
:style="{ minHeight: '500px', backgroundColor: bgColor }"
|
|
156
141
|
>
|
|
157
142
|
<!-- <div v-for="item in path" :key="item.name">
|
|
158
143
|
<span class="text-xs">{{ item.name }}</span>
|
|
159
144
|
</div> -->
|
|
160
145
|
<!-- Header (fixed at top of card) -->
|
|
161
|
-
<div>
|
|
146
|
+
<div class="mb-2">
|
|
162
147
|
<h1 class="font-bold text-3xl text-center">{{ title }}</h1>
|
|
163
148
|
<div v-if="currentOption" class="mt-2">
|
|
164
149
|
<EpBtn
|
|
@@ -174,38 +159,40 @@ const currentLengthOptions = computed(()=> {
|
|
|
174
159
|
</div>
|
|
175
160
|
|
|
176
161
|
<!-- Content Area -->
|
|
177
|
-
<div
|
|
162
|
+
<div>
|
|
178
163
|
<!-- Introductory Part -->
|
|
179
164
|
<div
|
|
180
165
|
v-if="isIntroductoryPart"
|
|
181
|
-
class="flex flex-col
|
|
166
|
+
class="w-full flex flex-col space-y-6"
|
|
182
167
|
>
|
|
183
168
|
<TextMedia
|
|
184
|
-
|
|
185
|
-
:text="initialInstruction"
|
|
169
|
+
:text="initialInstruction ?? ''"
|
|
186
170
|
:media="media"
|
|
171
|
+
:cols="initialTwoCols"
|
|
187
172
|
/>
|
|
188
|
-
<
|
|
173
|
+
<div :class="`justify-center flex ${styleIntro}`">
|
|
174
|
+
<EpBtn type="primary" rounded @click="start">{{labelStart}}</EpBtn>
|
|
175
|
+
</div>
|
|
189
176
|
</div>
|
|
190
177
|
|
|
191
178
|
<!-- Slides -->
|
|
192
179
|
<template v-else-if="currentOption && !isIntroductoryPart">
|
|
193
|
-
<div class="
|
|
194
|
-
<div :class="
|
|
195
|
-
<TextMedia
|
|
180
|
+
<div class="w-full">
|
|
181
|
+
<div :class="`${transitionAnimation} my-12`">
|
|
182
|
+
<TextMedia
|
|
196
183
|
:text="currentOption.text ?? ''"
|
|
197
184
|
:media="currentOption.component"
|
|
185
|
+
:cols="currentOption.cols"
|
|
198
186
|
/>
|
|
199
187
|
|
|
200
188
|
<div
|
|
201
|
-
:class="`w-full my-4 mx-4
|
|
202
|
-
:style="{ placeItems: currentLengthOptions <= 4 ? 'center' : 'initial' }"
|
|
189
|
+
:class="`w-full my-4 mx-4 flex flex-wrap gap-2 justify-center items-center`"
|
|
203
190
|
>
|
|
204
191
|
<template v-for="(option, index) in currentOption.children" :key="`option-${index}`">
|
|
205
192
|
<EpBtn
|
|
206
193
|
rounded
|
|
207
194
|
type="primary"
|
|
208
|
-
class="w-
|
|
195
|
+
class="flex-1 min-w-[120px] sm:min-w-[160px] max-w-xs"
|
|
209
196
|
@click="nextSlide(option)"
|
|
210
197
|
>
|
|
211
198
|
{{ option.name }}
|
|
@@ -223,7 +210,7 @@ const currentLengthOptions = computed(()=> {
|
|
|
223
210
|
<EpHierarchy :nodes="userPath"/>
|
|
224
211
|
</template> -->
|
|
225
212
|
<h3 class="text-xl text-center font-semibold">{{ labelFinish }}</h3>
|
|
226
|
-
<div class="flex gap-6 mt-3">
|
|
213
|
+
<div :class="`flex gap-6 mt-3 ${!generalFeedback ? 'w-3/6 mx-auto':''}`">
|
|
227
214
|
<div class="w-full">
|
|
228
215
|
<h3 class="font-semibold mb-3">{{ labelYourPath }}</h3>
|
|
229
216
|
<div class="overflow-auto p-2" :style="{height: '200px'}">
|
|
@@ -247,12 +234,12 @@ const currentLengthOptions = computed(()=> {
|
|
|
247
234
|
:color-path="props.colorPath"
|
|
248
235
|
:color-rect="props.colorRect"
|
|
249
236
|
/>
|
|
250
|
-
<div class="flex justify-end">
|
|
237
|
+
<div class="flex justify-end mt-4">
|
|
251
238
|
<EpBtn @click="showPath = false" type="error" outlined rounded>{{labelClose}}</EpBtn>
|
|
252
239
|
</div>
|
|
253
240
|
</EpModal>
|
|
254
241
|
</div>
|
|
255
|
-
<div v-if="generalFeedback" class="flex flex-col col-span-1 items-center px-4 border-l-2 border-gray-700 overflow-auto">
|
|
242
|
+
<div v-if="generalFeedback" class="flex w-full flex-col col-span-1 items-center px-4 border-l-2 border-gray-700 overflow-auto">
|
|
256
243
|
<div v-html="useRenderText(generalFeedback)"></div>
|
|
257
244
|
</div>
|
|
258
245
|
</div>
|
|
@@ -76,7 +76,7 @@ const { src, hideIcon } = toRefs(props);
|
|
|
76
76
|
</div>
|
|
77
77
|
<div class="flex items-center justify-center px-7" v-else-if="!hideIcon">
|
|
78
78
|
<div class="text-base dark:text-white'">
|
|
79
|
-
<EpIcon :size="60" :icon-path="renderIcon"></EpIcon>
|
|
79
|
+
<EpIcon :size="60" :icon-path="renderIcon" extra-class="dark:text-white"></EpIcon>
|
|
80
80
|
</div>
|
|
81
81
|
</div>
|
|
82
82
|
<div :class="`py-6 flex-1 ${hideIcon?'px-6':'pr-2'}`">
|
|
@@ -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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
48
|
+
if (!pin) return;
|
|
58
49
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
77
|
+
return `${x / 10} ${y / 10} -5`;
|
|
92
78
|
}
|
|
93
79
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
88
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
115
89
|
}
|
|
116
90
|
|
|
117
|
-
async function registerRotationReaderComponent(delayMs
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
182
|
-
|
|
145
|
+
object3D: InstanceType<typeof THREE.Object3D>,
|
|
146
|
+
quaternion: InstanceType<typeof THREE.Quaternion>
|
|
183
147
|
) {
|
|
184
|
-
|
|
148
|
+
object3D.getWorldQuaternion(quaternion);
|
|
185
149
|
}
|
|
186
150
|
|
|
187
|
-
function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>, sceneEl: any) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
167
|
+
clickedPin.value = null;
|
|
204
168
|
}
|
|
205
169
|
|
|
206
|
-
function
|
|
207
|
-
|
|
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
|
-
|
|
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>
|