ep-lib-ts 1.0.46 → 1.0.47
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-CFZeS_dQ.js +4 -0
- package/dist/Details-D_yxeUuE.js +4 -0
- package/dist/DisplayBox-D8hlc9Gn.js +4 -0
- package/dist/EpAlert-RMp39gBY.js +4 -0
- package/dist/EpAudio-VXqSaCc0.js +4 -0
- package/dist/EpAvatar-CoBsHAyN.js +4 -0
- package/dist/EpBadge-Di0ORWOa.js +4 -0
- package/dist/EpBarChart-D0FaZPGz.js +4 -0
- package/dist/EpBtn-D5wu8yT7.js +4 -0
- package/dist/EpCard-Drdckmbx.js +4 -0
- package/dist/EpCardLink-DUGjSAGF.js +4 -0
- package/dist/EpChip-DDochFMT.js +4 -0
- package/dist/EpCodeblock-BjxiWHoc.js +4 -0
- package/dist/EpConclusion-CXoGHiG1.js +4 -0
- package/dist/EpContentSlider-HBkmUIw5.js +4 -0
- package/dist/{EpDarkmode-DyUrMSO5.js → EpDarkmode-DKSyFe8_.js} +1 -1
- package/dist/EpDescription-BmRR6d2p.js +4 -0
- package/dist/EpDivider-BALEThPk.js +4 -0
- package/dist/{EpDraggable-CTWqRQzE.js → EpDraggable-B6I1LZM8.js} +110 -110
- package/dist/EpEdu-D7erj5ED.js +4 -0
- package/dist/EpFlex-CdriG_tC.js +4 -0
- package/dist/EpFunnelChart-HVjlJWQd.js +4 -0
- package/dist/EpHeader-Bl4162yt.js +4 -0
- package/dist/EpHover-CVY1squO.js +4 -0
- package/dist/EpHoverCard-BIuPau4X.js +4 -0
- package/dist/EpIcon-DsCeMM28.js +4 -0
- package/dist/EpIframe-Cz5g1BYb.js +4 -0
- package/dist/EpImg-Ccr76yR5.js +4 -0
- package/dist/EpImgCarousel-Ddz1Ur0L.js +4 -0
- package/dist/{EpInput-CGnN-piP.js → EpInput-BLfdye3a.js} +2 -2
- package/dist/EpInstructions-B-b52LnB.js +4 -0
- package/dist/EpIntroduction-DEaiE8_Q.js +4 -0
- package/dist/EpLineChart-CJ28vhHx.js +4 -0
- package/dist/EpLink-DRGrCSOs.js +4 -0
- package/dist/EpLinkVersion-DJcPV4xm.js +4 -0
- package/dist/{EpList-C8uaLum6.js → EpList-snrOZLuu.js} +1 -1
- package/dist/EpModal-m4szNip0.js +4 -0
- package/dist/{EpNothing-DxfGfasN.js → EpNothing-ChU4qO5j.js} +1 -1
- package/dist/EpObjective-CAXtephy.js +4 -0
- package/dist/EpPieChart-B3l-Y3E9.js +4 -0
- package/dist/EpQuestion-CrXTzzzu.js +4 -0
- package/dist/EpQuote-Dc-IZjOX.js +4 -0
- package/dist/EpRadio-CA0CASuz.js +4 -0
- package/dist/EpRadioSummative-Bm2JDs6z.js +4 -0
- package/dist/EpReading-BNArWsC2.js +4 -0
- package/dist/EpResource-Bx1G7Dlz.js +4 -0
- package/dist/EpScope-CB6RuO3X.js +4 -0
- package/dist/EpSection-BUBgMeo9.js +4 -0
- package/dist/EpSectionCols-rigTAR3l.js +4 -0
- package/dist/EpSkeleton-B9HFmS5A.js +4 -0
- package/dist/EpSoftware-CK9VPoFF.js +4 -0
- package/dist/EpSpecificObjective-Dm-H_StM.js +4 -0
- package/dist/EpSpinner-Br8tW9f2.js +4 -0
- package/dist/EpStackedList-By0U0h1R.js +4 -0
- package/dist/EpSummativeTable-Czo4hRQq.js +4 -0
- package/dist/EpSvg-BVV9GJ09.js +4 -0
- package/dist/EpSvgShow-DSPDvQlK.js +4 -0
- package/dist/EpTable-CNPciiRt.js +4 -0
- package/dist/EpTerm-BjD-0L65.js +4 -0
- package/dist/EpText-8IGa40sW.js +4 -0
- package/dist/EpTimeLine-D5R81tuv.js +4 -0
- package/dist/EpVideo-v6GnvLIU.js +4 -0
- package/dist/EpVideoPanopto-BWVr3ji1.js +4 -0
- package/dist/EpWordDef-QB2ioxjp.js +4 -0
- package/dist/TextImg-B_cSkkBi.js +4 -0
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +1 -0
- package/dist/components/interactions/EpSvgShow.vue.d.ts +0 -1
- package/dist/components/tools/Details.vue.d.ts +34 -0
- package/dist/components/tools/TextImg.vue.d.ts +24 -0
- package/dist/ep-lib-ts.js +44 -42
- package/dist/ep-lib-ts.umd.cjs +198 -198
- package/dist/{index-IdtPmXeP.js → index-CO05CQPt.js} +461 -514
- package/dist/{index-FmXc2ivj.js → index-D6RVSyf7.js} +4230 -3944
- package/dist/{index-D5QYJLNE.js → index-QY-UvpNr.js} +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/{prism-D-x8E1YK.js → prism-Cv4D8Rjm.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/educationals/EpBranchingScenario.vue +73 -25
- package/src/components/interactions/EpDraggable.vue +4 -4
- package/src/components/interactions/EpSvgShow.vue +66 -66
- package/src/components/tools/Details.vue +48 -0
- package/src/components/tools/TextImg.vue +28 -0
- package/dist/BgAudio-ryf2FIxF.js +0 -4
- package/dist/DisplayBox-ky90shjr.js +0 -4
- package/dist/EpAlert-BUiXiWRL.js +0 -4
- package/dist/EpAudio-CkZrkt3Z.js +0 -4
- package/dist/EpAvatar-2ZL5g8-2.js +0 -4
- package/dist/EpBadge-vOdZrc0e.js +0 -4
- package/dist/EpBarChart-CUUaOMsS.js +0 -4
- package/dist/EpBranchingScenario-DT2VQz7o.js +0 -160
- package/dist/EpBtn-DD0ykcYq.js +0 -4
- package/dist/EpCard-Qgkskboo.js +0 -4
- package/dist/EpCardLink-BfTUOLcA.js +0 -4
- package/dist/EpChip-P7j6l0PH.js +0 -4
- package/dist/EpCodeblock-DpzMd_h0.js +0 -4
- package/dist/EpConclusion-BRBOGFVk.js +0 -4
- package/dist/EpContentSlider-KFhPqR1h.js +0 -4
- package/dist/EpDescription-CcdsFWCf.js +0 -4
- package/dist/EpDivider-C30UAjvv.js +0 -4
- package/dist/EpEdu-CApC3SiS.js +0 -4
- package/dist/EpFlex-Dgc5dinh.js +0 -4
- package/dist/EpFunnelChart-Xm34GDMu.js +0 -4
- package/dist/EpHeader-DSKKm621.js +0 -4
- package/dist/EpHover-KHdqQJ6y.js +0 -4
- package/dist/EpHoverCard-Ccl2Un2s.js +0 -4
- package/dist/EpIcon-Eezd-EUx.js +0 -4
- package/dist/EpIframe-CmEsIYyW.js +0 -4
- package/dist/EpImg-BV_rS7v3.js +0 -4
- package/dist/EpImgCarousel-BHade9dP.js +0 -4
- package/dist/EpInstructions-A6ajkYEJ.js +0 -4
- package/dist/EpIntroduction-BY39wrQW.js +0 -4
- package/dist/EpLineChart-DQNIlO9r.js +0 -4
- package/dist/EpLink-BdxmUlWG.js +0 -4
- package/dist/EpLinkVersion-BAsA6tzp.js +0 -4
- package/dist/EpModal-DIEKXVnQ.js +0 -4
- package/dist/EpObjective-DwnP_7Zm.js +0 -4
- package/dist/EpPieChart-DmcML2d-.js +0 -4
- package/dist/EpQuestion-D7-nzMHE.js +0 -4
- package/dist/EpQuote-Cb5Ty6Ec.js +0 -4
- package/dist/EpRadio-9V6iAh4n.js +0 -4
- package/dist/EpRadioSummative-BL2YhCK3.js +0 -4
- package/dist/EpReading-DTWjzj6l.js +0 -4
- package/dist/EpResource-ZMfXpSqf.js +0 -4
- package/dist/EpScope-1aCF0beo.js +0 -4
- package/dist/EpSection-C-GaZN4R.js +0 -4
- package/dist/EpSectionCols-ap4Z5x7P.js +0 -4
- package/dist/EpSkeleton-DQUHmKio.js +0 -4
- package/dist/EpSoftware-DdF8BdqQ.js +0 -4
- package/dist/EpSpecificObjective-44uQGH3u.js +0 -4
- package/dist/EpSpinner-DHU8EZRf.js +0 -4
- package/dist/EpStackedList-BBGlTBx6.js +0 -4
- package/dist/EpSummativeTable-Cz4gcxHT.js +0 -4
- package/dist/EpSvg-Dk_q0cGB.js +0 -4
- package/dist/EpSvgShow-Cb_Y5UGq.js +0 -54
- package/dist/EpTable-Cg3-lRZY.js +0 -4
- package/dist/EpTerm-CRkB0QyE.js +0 -4
- package/dist/EpText-Dj93fveo.js +0 -4
- package/dist/EpTimeLine-Cit4tc3F.js +0 -4
- package/dist/EpVideo-1obD7bUC.js +0 -4
- package/dist/EpVideoPanopto-DzkzWyOF.js +0 -4
- package/dist/EpWordDef-DIjwoqzN.js +0 -4
package/dist/index.d.ts
CHANGED
|
@@ -28,12 +28,14 @@ import { default as EpInstructions } from './components/educationals/EpInstructi
|
|
|
28
28
|
import { default as EpDescription } from './components/educationals/EpDescription.vue';
|
|
29
29
|
import { default as EpConclusion } from './components/educationals/EpConclusion.vue';
|
|
30
30
|
import { default as EpCodeblock } from './components/educationals/EpCodeblock.vue';
|
|
31
|
+
import { default as EpBranchingScenario } from './components/educationals/EpBranchingScenario.vue';
|
|
31
32
|
import { default as EpAccordeon } from './components/interactions/EpAccordeon.vue';
|
|
32
33
|
import { default as EpContentSlider } from './components/interactions/EpContentSlider.vue';
|
|
33
34
|
import { default as EpModal } from './components/interactions/EpModal.vue';
|
|
34
35
|
import { default as EpQuestion } from './components/interactions/EpQuestion.vue';
|
|
35
36
|
import { default as EpTabs } from './components/interactions/EpTabs.vue';
|
|
36
37
|
import { default as EpSummativeTable } from './components/interactions/EpSummativeTable.vue';
|
|
38
|
+
import { default as EpSvgShow } from './components/interactions/EpSvgShow.vue';
|
|
37
39
|
import { default as EpAudio } from './components/medias/EpAudio.vue';
|
|
38
40
|
import { default as EpCarousel } from './components/medias/EpCarousel.vue';
|
|
39
41
|
import { default as EpIframe } from './components/medias/EpIframe.vue';
|
|
@@ -53,4 +55,4 @@ import { default as EpHeader } from './components/signages/EpHeader.vue';
|
|
|
53
55
|
import { default as EpQuote } from './components/signages/EpQuote.vue';
|
|
54
56
|
import { default as EpSkeleton } from './components/signages/EpSkeleton.vue';
|
|
55
57
|
|
|
56
|
-
export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpFunnelChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton, EpWordDef, EpSummativeTable, EpObjective, EpSpecificObjective, EpIntroduction, EpInstructions, EpDescription, EpConclusion, EpCodeblock, EpSectionCols, EpCardLink, EpStackedList, EpHoverCard };
|
|
58
|
+
export { EpBadge, EpBtn, EpCard, EpChip, EpDivider, EpFlex, EpIcon, EpImg, EpSection, EpSpinner, EpTable, EpBarChart, EpLineChart, EpPieChart, EpFunnelChart, EpText, EpEdu, EpReading, EpResource, EpScope, EpAccordeon, EpContentSlider, EpModal, EpQuestion, EpTabs, EpAudio, EpCarousel, EpIframe, EpKatex, EpLink, EpLinkVersion, EpSoftware, EpSvg, EpTerm, EpTimeLine, EpVideo, EpVideoPanopto, EpAlert, EpHeader, EpQuote, EpSkeleton, EpWordDef, EpSummativeTable, EpObjective, EpSpecificObjective, EpIntroduction, EpInstructions, EpDescription, EpConclusion, EpCodeblock, EpSectionCols, EpCardLink, EpStackedList, EpHoverCard, EpBranchingScenario, EpSvgShow };
|
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}
|
|
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}@keyframes fade-7af6ae43{0%{opacity:0}to{opacity:1}}@keyframes scale-7af6ae43{0%{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}@keyframes slideY-7af6ae43{0%{transform:translateY(-100%);opacity:0}to{transform:translateY(0);opacity:1}}.fade[data-v-7af6ae43]{animation:fade-7af6ae43 1s}.scale[data-v-7af6ae43]{animation:scale-7af6ae43 1s}.slideY[data-v-7af6ae43]{animation:slideY-7af6ae43 1s}.path-item[data-v-7af6ae43]{position:relative}.path-item[data-v-7af6ae43]:after{content:"";position:absolute;top:50%;right:100%;width:60px;height:4px;background-color:#374151}.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}
|
package/package.json
CHANGED
|
@@ -4,6 +4,8 @@ import { ref, computed } from "vue";
|
|
|
4
4
|
import { useRenderText } from '../../composables/useRenderText';
|
|
5
5
|
import EpIcon from '../../components/basics/EpIcon.vue';
|
|
6
6
|
import { mdiArrowLeft } from "@mdi/js";
|
|
7
|
+
import TextImg from "../tools/TextImg.vue";
|
|
8
|
+
import Details from "../tools/Details.vue";
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
// Defining the props
|
|
@@ -15,8 +17,15 @@ interface Option {
|
|
|
15
17
|
options?: Option[];
|
|
16
18
|
}
|
|
17
19
|
|
|
20
|
+
interface Choice {
|
|
21
|
+
question:string;
|
|
22
|
+
choice:string;
|
|
23
|
+
img?:string;
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
interface Props {
|
|
19
27
|
scenarioTitle: string;
|
|
28
|
+
scenarioImg?:string;
|
|
20
29
|
initialInstruction?: string | null;
|
|
21
30
|
generalFeedback?: string;
|
|
22
31
|
bgColor?: string;
|
|
@@ -54,8 +63,6 @@ const getOptionFromItinerary = (itinerary: number[]) => {
|
|
|
54
63
|
option = option.options[itinerary[i]];
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
66
|
return (option !== props.decisionTree)? option : null;
|
|
60
67
|
};
|
|
61
68
|
|
|
@@ -94,16 +101,25 @@ const restart = () => {
|
|
|
94
101
|
|
|
95
102
|
// Function to get the choices made based on the itinerary
|
|
96
103
|
const getChoices = (itinerary: number[]) => {
|
|
97
|
-
let choices:
|
|
98
|
-
|
|
104
|
+
let choices: Choice[] = [{
|
|
105
|
+
question: props.decisionTree.rootQuestion,
|
|
106
|
+
choice: props.decisionTree.options[itinerary[0]].name,
|
|
107
|
+
img:props.decisionTree.imgSrc
|
|
108
|
+
}];
|
|
109
|
+
let option: Option = props.decisionTree.options[itinerary[0]];
|
|
110
|
+
|
|
99
111
|
if (itinerary.length > 1) {
|
|
100
112
|
for (let i = 1; i < itinerary.length; i++) {
|
|
101
113
|
let question: string = option.question;
|
|
102
|
-
|
|
103
|
-
|
|
114
|
+
let img:string|undefined = option.imgSrc
|
|
115
|
+
if(option.options){
|
|
116
|
+
option = option.options[itinerary[i]];
|
|
117
|
+
console.log(option)
|
|
118
|
+
}
|
|
119
|
+
choices.push({question, choice: option.name, img});
|
|
104
120
|
}
|
|
105
121
|
}
|
|
106
|
-
|
|
122
|
+
|
|
107
123
|
return choices;
|
|
108
124
|
};
|
|
109
125
|
|
|
@@ -113,27 +129,38 @@ const getChoices = (itinerary: number[]) => {
|
|
|
113
129
|
|
|
114
130
|
<template>
|
|
115
131
|
<div>
|
|
116
|
-
|
|
117
132
|
<!-- The introductory part -->
|
|
118
|
-
<div v-if="isIntroductoryPart" class="
|
|
133
|
+
<div v-if="isIntroductoryPart" class="mx-auto w-2/3 bg-gray-200 dark:bg-slate-800 rounded-md flex flex-col items-center justify-around p-4 fade" :style="{ minHeight: '500px', backgroundColor: bgColor }">
|
|
119
134
|
<h1 class="font-bold text-3xl">{{ scenarioTitle }}</h1>
|
|
120
|
-
|
|
121
|
-
<
|
|
135
|
+
|
|
136
|
+
<TextImg v-if="initialInstruction"
|
|
137
|
+
:text="initialInstruction"
|
|
138
|
+
:src="scenarioImg"
|
|
139
|
+
:alt="`image d'introduction ${scenarioTitle}`"
|
|
140
|
+
/>
|
|
141
|
+
<button class="rounded bg-primary text-white py-2 px-4 min-w-28 my-2" @click="isIntroductoryPart = false">Commencer</button>
|
|
122
142
|
</div>
|
|
123
143
|
|
|
124
144
|
|
|
125
145
|
<div class="m-4 mx-auto w-2/3 rounded-md flex flex-col p-4 bg-gray-200 dark:bg-slate-800" :style="{ minHeight: '500px', backgroundColor: bgColor }" v-else>
|
|
126
146
|
<!-- Return button -->
|
|
127
|
-
<div><button :class="`rounded bg-
|
|
147
|
+
<div><button :class="`rounded bg-primary text-white py-2 px-4 m-2 ${transitionAnimation}`" v-if="notTheEnd" @click="goToPrevious">
|
|
128
148
|
<EpIcon :icon-path="mdiArrowLeft" size="25"></EpIcon>
|
|
129
149
|
</button></div>
|
|
130
150
|
|
|
131
151
|
<!-- First question -->
|
|
132
152
|
<div :class="`flex-grow flex flex-col items-center justify-around ${transitionAnimation}`" v-if="currentSlide === 0">
|
|
133
|
-
|
|
134
|
-
|
|
153
|
+
|
|
154
|
+
<TextImg
|
|
155
|
+
:text="decisionTree.rootQuestion"
|
|
156
|
+
:src="decisionTree.imgSrc"
|
|
157
|
+
:alt="`image de la question ${decisionTree.rootQuestion}`"
|
|
158
|
+
/>
|
|
159
|
+
|
|
160
|
+
|
|
135
161
|
<div :class="`w-full justify-items-center mx-4 grid ${(decisionTree.options.length <= 2)? 'grid-cols-2' : 'grid-cols-3'}`">
|
|
136
|
-
|
|
162
|
+
|
|
163
|
+
<button :class="`rounded bg-primary text-white py-2 px-4 min-w-28 max-w-40 my-3 ${(index === (decisionTree.options.length - 1) && (index % 3) === 0)? `col-span-3`: 'col-span-1'}`" v-for="(option, index) in decisionTree.options" :key="index" @click="itinerary.push(index); currentSlide++; currentOption = option">{{ option.name }}</button>
|
|
137
164
|
</div>
|
|
138
165
|
</div>
|
|
139
166
|
|
|
@@ -142,10 +169,15 @@ const getChoices = (itinerary: number[]) => {
|
|
|
142
169
|
|
|
143
170
|
<!-- The current slide -->
|
|
144
171
|
<div :key="currentOption.question" :class="`flex-grow flex flex-col items-center justify-around ${transitionAnimation}`" v-if="notTheEnd">
|
|
145
|
-
|
|
146
|
-
|
|
172
|
+
|
|
173
|
+
<TextImg
|
|
174
|
+
:text="currentOption.question"
|
|
175
|
+
:src="currentOption.imgSrc"
|
|
176
|
+
:alt="`image de la question ${currentOption.question}`"
|
|
177
|
+
/>
|
|
178
|
+
|
|
147
179
|
<div :class="`w-full justify-items-center mx-4 grid ${(currentOption.options.length <= 2)? 'grid-cols-2' : 'grid-cols-3'}`">
|
|
148
|
-
<button :class="`rounded bg-
|
|
180
|
+
<button :class="`rounded bg-primary text-white py-2 px-4 min-w-28 max-w-40 my-3 ${(index === (currentOption.options.length - 1) && (index % 3) === 0)? `col-span-3`: 'col-span-1'}`" v-for="(option, index) in currentOption.options" :key="index" @click="itinerary.push(index); currentSlide++; currentOption = option">{{ option.name }}</button>
|
|
149
181
|
</div>
|
|
150
182
|
</div>
|
|
151
183
|
|
|
@@ -153,23 +185,39 @@ const getChoices = (itinerary: number[]) => {
|
|
|
153
185
|
<div :class="`flex-grow flex flex-col items-center ${transitionAnimation}`" v-else>
|
|
154
186
|
<div class="flex-grow flex flex-col items-center">
|
|
155
187
|
<h1 class="my-4 font-bold text-3xl">Vous avez terminé le scénario!</h1>
|
|
188
|
+
|
|
156
189
|
<div class="grid grid-cols-2 gap-2">
|
|
157
|
-
<div class="
|
|
190
|
+
<div :class="[
|
|
191
|
+
'flex flex-col items-center',
|
|
192
|
+
generalFeedback ? 'col-span-1' : 'col-span-2'
|
|
193
|
+
]">
|
|
158
194
|
<h3 class="font-bold">Voici votre parcours</h3>
|
|
159
195
|
<div class="flex flex-col relative w-full gap-4 px-5 py-5 items-start overflow-auto border-l-4 border-gray-700" style="max-width: 600px; height: 300px;">
|
|
160
|
-
<div
|
|
196
|
+
<!-- <div class="path-item rounded bg-primary text-white py-2 px-4 flex flex-col items-center">
|
|
161
197
|
<u>{{ question.question }}</u>
|
|
162
198
|
<p>{{ question.choice }}</p>
|
|
163
|
-
</div>
|
|
199
|
+
</div> -->
|
|
200
|
+
<template v-for="(question, index) in getChoices(itinerary)" :key="`question-${index}`">
|
|
201
|
+
<div class="path-item">
|
|
202
|
+
<Details
|
|
203
|
+
:content="question.question"
|
|
204
|
+
:title="question.choice"
|
|
205
|
+
:img="question.img"
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
</template>
|
|
209
|
+
|
|
210
|
+
|
|
164
211
|
</div>
|
|
165
212
|
</div>
|
|
166
|
-
<div class="flex flex-col col-span-1
|
|
167
|
-
<h3 class="font-bold">Feedback général</h3>
|
|
168
|
-
<
|
|
213
|
+
<div v-if="generalFeedback" class="flex flex-col col-span-1 items-center px-4 border-l-2 border-gray-700 overflow-auto">
|
|
214
|
+
<h3 class="font-bold mb-3">Feedback général</h3>
|
|
215
|
+
<div v-html="useRenderText(generalFeedback)"></div>
|
|
169
216
|
</div>
|
|
170
217
|
</div>
|
|
218
|
+
|
|
171
219
|
</div>
|
|
172
|
-
<button class='rounded bg-
|
|
220
|
+
<button class='rounded bg-primary text-white py-2 px-4 min-w-28 my-3 col-span-1' @click="restart">Recommencer</button>
|
|
173
221
|
</div>
|
|
174
222
|
|
|
175
223
|
</div>
|
|
@@ -39,7 +39,7 @@ const updateSize = () => {
|
|
|
39
39
|
const rect = myImage.value.getBoundingClientRect();
|
|
40
40
|
actualRect.value = { width: rect.width, height: rect.height };
|
|
41
41
|
|
|
42
|
-
console.log('Image size updated. Width:', actualRect.value.width, 'Height:', actualRect.value.height);
|
|
42
|
+
//console.log('Image size updated. Width:', actualRect.value.width, 'Height:', actualRect.value.height);
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
|
|
@@ -56,7 +56,7 @@ const handleImageLoad = (event: any) => {
|
|
|
56
56
|
originalWidth.value = event.target.naturalWidth;
|
|
57
57
|
originalHeight.value = event.target.naturalHeight;
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
// console.log('Image loaded. Width:', originalWidth.value, 'Height:', originalHeight.value);
|
|
60
60
|
|
|
61
61
|
updateSize();
|
|
62
62
|
}
|
|
@@ -93,7 +93,7 @@ const choices = ref<Choice[]>( props.sockets.map((s) => {
|
|
|
93
93
|
|
|
94
94
|
// Manage drag and drop
|
|
95
95
|
const onAdd = (event: any, index: number) => {
|
|
96
|
-
|
|
96
|
+
// console.log(event.clone);
|
|
97
97
|
|
|
98
98
|
// Retirer l'élément de la liste des réponses disponibles
|
|
99
99
|
availableAnswers.value = availableAnswers.value.filter(item => item.name !== event.clone.name);
|
|
@@ -101,7 +101,7 @@ const onAdd = (event: any, index: number) => {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const onRemove = (event: any, index: number) => {
|
|
104
|
-
|
|
104
|
+
// console.log(event.clone);
|
|
105
105
|
|
|
106
106
|
choices.value[index].choice = [];
|
|
107
107
|
choices.value[index].allowPut = true;
|
|
@@ -2,96 +2,96 @@
|
|
|
2
2
|
import { onMounted, ref, computed, nextTick } from 'vue';
|
|
3
3
|
import { useRenderText } from '../../composables/useRenderText';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
interface Props {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
multiple?: boolean
|
|
6
|
+
svg: string,
|
|
7
|
+
animation?: "" | "translateX" | "scale",
|
|
8
|
+
multiple?: boolean
|
|
12
9
|
}
|
|
13
10
|
|
|
14
|
-
|
|
15
11
|
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
animation: "",
|
|
13
|
+
multiple: false
|
|
18
14
|
});
|
|
19
15
|
|
|
20
16
|
const svg = ref<string>("");
|
|
21
17
|
|
|
18
|
+
// Refs
|
|
19
|
+
const svgContainer = ref<HTMLElement | null>(null);
|
|
20
|
+
|
|
22
21
|
const animationType = computed(() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
switch (props.animation) {
|
|
23
|
+
case "translateX":
|
|
24
|
+
return "animate-slide";
|
|
25
|
+
case "scale":
|
|
26
|
+
return "animate-zoom";
|
|
27
|
+
default:
|
|
28
|
+
return "animate-fade";
|
|
29
|
+
}
|
|
31
30
|
});
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
32
|
+
const showScene = (scene: string) => {
|
|
33
|
+
if (!svgContainer.value) return;
|
|
34
|
+
const currentScene = svgContainer.value.querySelector(`[data-scene="${scene}"]`)
|
|
35
|
+
if(!currentScene) return;
|
|
36
|
+
if(!props.multiple){
|
|
37
|
+
hideScenes()
|
|
38
|
+
}
|
|
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
|
+
};
|
|
54
|
+
|
|
55
|
+
const hideScenes = () => {
|
|
56
|
+
if (!svgContainer.value) return;
|
|
57
|
+
const scenes = svgContainer.value.querySelectorAll('[data-scene]');
|
|
58
|
+
Array.from(scenes).forEach((s) => {
|
|
59
|
+
if (!s.classList.contains('hidden')) {
|
|
60
|
+
s.classList.add('hidden');
|
|
61
|
+
s.classList.remove(animationType.value);
|
|
51
62
|
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
52
65
|
|
|
53
|
-
|
|
54
|
-
|
|
66
|
+
onMounted(async () => {
|
|
67
|
+
svg.value = useRenderText(props.svg);
|
|
55
68
|
|
|
56
|
-
|
|
57
|
-
Array.from(btns).forEach((b) => {
|
|
58
|
-
b.addEventListener('click', (e) => {
|
|
59
|
-
const scene = b.getAttribute("id");
|
|
60
|
-
showScene(scene?? "");
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
});
|
|
69
|
+
await nextTick();
|
|
65
70
|
|
|
71
|
+
if (!svgContainer.value) return;
|
|
66
72
|
|
|
73
|
+
// Hide all scenes initially
|
|
74
|
+
hideScenes()
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
if(!props.multiple && !s.classList.contains('hidden')) {
|
|
79
|
-
s.classList.add('hidden');
|
|
80
|
-
s.classList.remove(animationType.value);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
76
|
+
// Bind click events to buttons
|
|
77
|
+
const btns = svgContainer.value.querySelectorAll('[data-btn]');
|
|
78
|
+
Array.from(btns).forEach((b) => {
|
|
79
|
+
b.classList.add('cursor-pointer')
|
|
80
|
+
b.addEventListener('click', () => {
|
|
81
|
+
const sceneName = b.getAttribute("data-btn")
|
|
82
|
+
showScene(sceneName ?? "");
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
});
|
|
87
86
|
|
|
88
87
|
|
|
89
88
|
|
|
90
89
|
</script>
|
|
91
90
|
|
|
92
91
|
|
|
92
|
+
|
|
93
93
|
<template>
|
|
94
94
|
<!-- The buttons must have class "btn" and an unique id="<scene-name>"
|
|
95
95
|
The scenes elements must have class "scene" and "scene-<scene-name>" -->
|
|
96
|
-
<div
|
|
96
|
+
<div ref="svgContainer" v-html="svg"></div>
|
|
97
97
|
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {ref} from 'vue'
|
|
3
|
+
import EpModal from '../interactions/EpModal.vue';
|
|
4
|
+
import { useRenderText } from '../../composables/useRenderText';
|
|
5
|
+
import EpBtn from '../basics/EpBtn.vue';
|
|
6
|
+
import EpDivider from '../basics/EpDivider.vue';
|
|
7
|
+
import TextImg from './TextImg.vue';
|
|
8
|
+
const showModal = ref(false)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
title?:string;
|
|
13
|
+
content:string;
|
|
14
|
+
labelClose?:string;
|
|
15
|
+
img?:string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
19
|
+
title:"Voir détails",
|
|
20
|
+
labelClose:"Fermer"
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="cursor-pointer rounded bg-primary text-white py-2 px-4 flex flex-col items-center" @click="showModal = true">
|
|
27
|
+
<EpModal v-model="showModal">
|
|
28
|
+
<TextImg
|
|
29
|
+
:text="content"
|
|
30
|
+
:src="img"
|
|
31
|
+
:alt="`image ${title}`"
|
|
32
|
+
/>
|
|
33
|
+
<EpDivider/>
|
|
34
|
+
<p>{{title}}</p>
|
|
35
|
+
<div class="flex justify-end">
|
|
36
|
+
<EpBtn
|
|
37
|
+
type="error"
|
|
38
|
+
rounded
|
|
39
|
+
size="small"
|
|
40
|
+
@click="showModal = false">
|
|
41
|
+
{{labelClose}}
|
|
42
|
+
</EpBtn>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
</EpModal>
|
|
46
|
+
<p>{{title}}</p>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import {computed} from "vue"
|
|
3
|
+
import { useRenderText } from '../../composables/useRenderText';
|
|
4
|
+
interface Props{
|
|
5
|
+
src?:string;
|
|
6
|
+
alt?:string
|
|
7
|
+
text:string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const styles = computed(()=> {
|
|
14
|
+
return props.src ? 'md:w-1/2' : 'md:w-full'
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="flex flex-col md:flex-row items-center justify-center gap-5">
|
|
21
|
+
<div :class="`w-full ${styles}`">
|
|
22
|
+
<div v-html="useRenderText(text)"></div>
|
|
23
|
+
</div>
|
|
24
|
+
<div v-if="src" class="w-full md:w-1/2 flex justify-center">
|
|
25
|
+
<img class="w-full max-w-md object-contain rounded-md" :src="src" :alt="alt" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
package/dist/BgAudio-ryf2FIxF.js
DELETED
package/dist/EpAlert-BUiXiWRL.js
DELETED
package/dist/EpAudio-CkZrkt3Z.js
DELETED
package/dist/EpBadge-vOdZrc0e.js
DELETED