ep-lib-ts 1.0.35 → 1.0.37
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/App.vue.d.ts +2 -0
- package/dist/BgAudio-DezFnyKB.js +4 -0
- package/dist/DisplayBox-DYzeHzkr.js +4 -0
- package/dist/Ep360Image-BZpa7qLl.js +228 -0
- package/dist/Ep360Video-Wy_YWl7-.js +235 -0
- package/dist/EpAlert-DdtU5nno.js +4 -0
- package/dist/EpAudio-vt4JUOf2.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-BSMtvAqC.js +4 -0
- package/dist/{EpBadge-DqmSNdbi.js → EpBadge-CWIq_C51.js} +2 -2
- package/dist/EpBarChart-BA3EqJ-Z.js +4 -0
- package/dist/EpBranchingScenario-5sbzBXZ0.js +151 -0
- package/dist/EpBtn-B1xGgn2Y.js +4 -0
- package/dist/EpCard-CEjoqwN4.js +4 -0
- package/dist/EpCheckbox-Da_2WoCs.js +4 -0
- package/dist/{EpCheckbox-BtJRFbS_.js → EpCheckbox.vue_vue_type_script_setup_true_lang-Dqi62vJ8.js} +7 -7
- package/dist/EpChip-d8r-FDqu.js +4 -0
- package/dist/EpCodeblock-Cu1MOvmi.js +4 -0
- package/dist/EpConclusion-Dk_FFixG.js +4 -0
- package/dist/EpContentSlider-dx8Hu4OS.js +4 -0
- package/dist/{EpDarkmode-BHYy2H_7.js → EpDarkmode-CuVlLi72.js} +5 -5
- package/dist/EpDescription-B00PjQg0.js +4 -0
- package/dist/EpDivider-CukqZw1a.js +4 -0
- package/dist/EpEdu-B5N7RG49.js +4 -0
- package/dist/EpFlex-DAtWa--7.js +4 -0
- package/dist/EpFunnelChart-jn5C9tAB.js +4 -0
- package/dist/EpHeader-Cwx5Qb6Q.js +4 -0
- package/dist/{EpHotsPot-DFz_Du9o.js → EpHotsPot-nT87sUMT.js} +6 -6
- package/dist/EpHover-Kp8XbqYO.js +4 -0
- package/dist/EpHover.vue_vue_type_script_setup_true_lang-BxiamS7-.js +36 -0
- package/dist/EpHoverCard-DRRYl4MK.js +84 -0
- package/dist/EpIcon-DitBbcuQ.js +4 -0
- package/dist/EpIframe-C5c1K8RE.js +4 -0
- package/dist/EpImg-YPH6mMcR.js +4 -0
- package/dist/EpInput-BKc_tU1_.js +1095 -0
- package/dist/EpInstructions-D8kw_rwC.js +4 -0
- package/dist/EpIntroduction-B2d2vChC.js +4 -0
- package/dist/EpLineChart-BjlCf9dW.js +4 -0
- package/dist/EpLink-CXIYlycG.js +4 -0
- package/dist/EpLinkVersion-Dn_Tid-r.js +4 -0
- package/dist/{EpList-CWrpD1mL.js → EpList-B2x9zHps.js} +3 -3
- package/dist/{EpListitem-DzQrc-k2.js → EpListitem-DXh4Kniu.js} +4 -4
- package/dist/EpLottieSvg-NNSQLDpl.js +1971 -0
- package/dist/EpModal-CaPOVdQK.js +4 -0
- package/dist/EpNothing-D3fg3Krb.js +10 -0
- package/dist/EpObjective-czDKm1c4.js +4 -0
- package/dist/EpPieChart-DuW7EBmx.js +4 -0
- package/dist/EpQuestion-BuIkR2Ae.js +4 -0
- package/dist/EpQuote-5FQFWcfv.js +4 -0
- package/dist/EpRadio-BnPZeKpP.js +4 -0
- package/dist/EpRadioSummative-AtVwjeQ-.js +4 -0
- package/dist/EpReading-s2TQVAZ_.js +4 -0
- package/dist/EpResource-Cxx1lwrs.js +4 -0
- package/dist/EpScope-CG9n9QnC.js +4 -0
- package/dist/EpSection-cDQVtX9A.js +4 -0
- package/dist/EpSectionCols-DsH_iEem.js +4 -0
- package/dist/{EpSelect-FIb6SyJU.js → EpSelect-kjH_wTXb.js} +3 -3
- package/dist/EpSkeleton-BQG8jrs6.js +4 -0
- package/dist/EpSoftware-DR1d7ezZ.js +4 -0
- package/dist/EpSpecificObjective-BS1QMNrt.js +4 -0
- package/dist/EpSpinner-O3kZ_dUO.js +4 -0
- package/dist/EpStackedList-CTU_KKMZ.js +81 -0
- package/dist/EpSummativeTable-iudwhrUL.js +4 -0
- package/dist/EpSvg-Bnj4H9sA.js +4 -0
- package/dist/{EpSwitch-hdXyzuR1.js → EpSwitch-DtQon_hm.js} +2 -2
- package/dist/EpTable-Byza5VY-.js +4 -0
- package/dist/EpTerm-BkpUPK_G.js +4 -0
- package/dist/EpText-J0qcEorF.js +4 -0
- package/dist/{EpTextarea-D8UCQuga.js → EpTextarea-VJ4pdPV_.js} +2 -2
- package/dist/EpTimeLine-Czscwhgg.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-0w267ZqV.js +4 -0
- package/dist/EpVideoPanopto-CDy_LUMi.js +4 -0
- package/dist/EpWordDef-qWt87mhg.js +4 -0
- package/dist/components/basics/EpAvatar.vue.d.ts +4 -35
- package/dist/components/basics/EpBadge.vue.d.ts +3 -28
- package/dist/components/basics/EpBtn.vue.d.ts +13 -38
- package/dist/components/basics/EpCard.vue.d.ts +14 -46
- package/dist/components/basics/EpChip.vue.d.ts +12 -38
- package/dist/components/basics/EpDivider.vue.d.ts +3 -33
- package/dist/components/basics/EpFlex.vue.d.ts +8 -2
- package/dist/components/basics/EpHover.vue.d.ts +17 -37
- package/dist/components/basics/EpHoverCard.vue.d.ts +50 -0
- package/dist/components/basics/EpIcon.vue.d.ts +3 -26
- package/dist/components/basics/EpImg.vue.d.ts +2 -38
- package/dist/components/basics/EpSection.vue.d.ts +10 -31
- package/dist/components/basics/EpSectionCols.vue.d.ts +11 -39
- package/dist/components/basics/EpSpinner.vue.d.ts +2 -29
- package/dist/components/basics/EpStackedList.vue.d.ts +12 -0
- package/dist/components/basics/EpTable.vue.d.ts +1 -18
- package/dist/components/basics/EpText.vue.d.ts +2 -33
- package/dist/components/charts/EpBarChart.vue.d.ts +2 -28
- package/dist/components/charts/EpFunnelChart.vue.d.ts +3 -35
- package/dist/components/charts/EpLineChart.vue.d.ts +2 -28
- package/dist/components/charts/EpPieChart.vue.d.ts +3 -31
- package/dist/components/educationals/EpBranchingScenario.vue.d.ts +22 -0
- package/dist/components/educationals/EpCodeblock.vue.d.ts +5 -30
- package/dist/components/educationals/EpConclusion.vue.d.ts +10 -25
- package/dist/components/educationals/EpDescription.vue.d.ts +10 -25
- package/dist/components/educationals/EpEdu.vue.d.ts +13 -37
- package/dist/components/educationals/EpInstructions.vue.d.ts +2 -23
- package/dist/components/educationals/EpIntroduction.vue.d.ts +10 -25
- package/dist/components/educationals/EpObjective.vue.d.ts +10 -25
- package/dist/components/educationals/EpReading.vue.d.ts +3 -49
- package/dist/components/educationals/EpResource.vue.d.ts +2 -24
- package/dist/components/educationals/EpScope.vue.d.ts +1 -19
- package/dist/components/educationals/EpSpecificObjective.vue.d.ts +2 -25
- package/dist/components/forms/EpCheckbox.vue.d.ts +5 -36
- package/dist/components/forms/EpInput.vue.d.ts +7 -44
- package/dist/components/forms/EpRadio.vue.d.ts +5 -39
- package/dist/components/forms/EpRadioSummative.vue.d.ts +5 -39
- package/dist/components/forms/EpSelect.vue.d.ts +12 -13
- package/dist/components/forms/EpTextarea.vue.d.ts +7 -50
- package/dist/components/forms/EpToggle.vue.d.ts +7 -48
- package/dist/components/interactions/EpAccordeon.vue.d.ts +16 -34
- package/dist/components/interactions/EpContentSlider.vue.d.ts +2 -28
- package/dist/components/interactions/EpDarkmode.vue.d.ts +3 -3
- package/dist/components/interactions/EpModal.vue.d.ts +14 -39
- package/dist/components/interactions/EpQuestion.vue.d.ts +2 -38
- package/dist/components/interactions/EpSummativeTable.vue.d.ts +2 -24
- package/dist/components/interactions/EpTabs.vue.d.ts +1 -1
- package/dist/components/medias/EpAudio.vue.d.ts +4 -30
- package/dist/components/medias/EpCarousel.vue.d.ts +2 -32
- package/dist/components/medias/EpIframe.vue.d.ts +2 -28
- package/dist/components/medias/EpKatex.vue.d.ts +4 -24
- package/dist/components/medias/EpLink.vue.d.ts +2 -26
- package/dist/components/medias/EpLinkVersion.vue.d.ts +2 -29
- package/dist/components/medias/EpLottieSvg.vue.d.ts +164 -0
- package/dist/components/medias/EpSoftware.vue.d.ts +2 -36
- package/dist/components/medias/EpSvg.vue.d.ts +2 -24
- package/dist/components/medias/EpTerm.vue.d.ts +10 -41
- package/dist/components/medias/EpTimeLine.vue.d.ts +1 -19
- package/dist/components/medias/EpVideo.vue.d.ts +4 -28
- package/dist/components/medias/EpVideoPanopto.vue.d.ts +2 -28
- package/dist/components/medias/EpWordDef.vue.d.ts +2 -33
- package/dist/components/signages/EpAlert.vue.d.ts +12 -31
- package/dist/components/signages/EpHeader.vue.d.ts +19 -62
- package/dist/components/signages/EpNothing.vue.d.ts +1 -1
- package/dist/components/signages/EpQuote.vue.d.ts +10 -31
- package/dist/components/signages/EpSkeleton.vue.d.ts +3 -32
- package/dist/components/tools/BgAudio.vue.d.ts +4 -26
- package/dist/components/tools/DisplayBox.vue.d.ts +19 -9
- package/dist/components/tools/SvgFilter.vue.d.ts +1 -1
- package/dist/components/tools/TimelineItem.vue.d.ts +4 -28
- package/dist/ep-lib-ts.css +1 -0
- package/dist/ep-lib-ts.js +23 -23
- package/dist/ep-lib-ts.umd.cjs +5157 -109
- package/dist/{index-BGsaIGs9.js → index-1vY3QtSb.js} +5412 -4713
- package/dist/{index-CAb7BIas.js → index-BkHXngnv.js} +5447 -5206
- package/dist/index-IdtPmXeP.js +3483 -0
- package/dist/index.d.ts +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/menu.vue.d.ts +2 -0
- package/dist/pages/Basics.vue.d.ts +2 -0
- package/dist/pages/CurrentDev.vue.d.ts +2 -0
- package/dist/pages/Educationals.vue.d.ts +2 -0
- package/dist/pages/Forms.vue.d.ts +2 -0
- package/dist/pages/Home.vue.d.ts +2 -0
- package/dist/pages/Interactions.vue.d.ts +2 -0
- package/dist/pages/Medias.vue.d.ts +2 -0
- package/dist/pages/NicDev.vue.d.ts +2 -0
- package/dist/pages/Signages.vue.d.ts +2 -0
- package/dist/pages/basics/EpBadgeView.vue.d.ts +2 -0
- package/dist/pages/basics/EpBtnView.vue.d.ts +2 -0
- package/dist/pages/basics/EpCardView.vue.d.ts +2 -0
- package/dist/pages/basics/EpChipView.vue.d.ts +2 -0
- package/dist/pages/basics/EpFlexView.vue.d.ts +2 -0
- package/dist/pages/basics/EpHoverCardView.vue.d.ts +2 -0
- package/dist/pages/basics/EpIconView.vue.d.ts +2 -0
- package/dist/pages/basics/EpImgView.vue.d.ts +2 -0
- package/dist/pages/basics/EpSectionColsView.vue.d.ts +2 -0
- package/dist/pages/basics/EpSectionView.vue.d.ts +2 -0
- package/dist/pages/basics/EpStackedListView.vue.d.ts +2 -0
- package/dist/pages/basics/EpTableView.vue.d.ts +2 -0
- package/dist/pages/basics/EpTextView.vue.d.ts +2 -0
- package/dist/pages/charts/EpBarChartView.vue.d.ts +2 -0
- package/dist/pages/charts/EpFunnelChartView.vue.d.ts +2 -0
- package/dist/pages/charts/EpLineChartView.vue.d.ts +2 -0
- package/dist/pages/charts/EpPieChartView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpBranchingScenarioView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpCodeBlockView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpConclusionView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpDescriptionView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpEduView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpInstructionsView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpIntroductionView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpObjectiveView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpReadingView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpResourceView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpScopeView.vue.d.ts +2 -0
- package/dist/pages/educationals/EpSpecificObjectiveView.vue.d.ts +2 -0
- package/dist/pages/interactions/Ep360ImageView.vue.d.ts +2 -0
- package/dist/pages/interactions/Ep360VideoView.vue.d.ts +2 -0
- package/dist/pages/interactions/EpAccordeonView.vue.d.ts +2 -0
- package/dist/pages/interactions/EpContentSliderView.vue.d.ts +2 -0
- package/dist/pages/interactions/EpModalView.vue.d.ts +2 -0
- package/dist/pages/interactions/EpQuestionView.vue.d.ts +2 -0
- package/dist/pages/interactions/EpSummativeTableView.vue.d.ts +2 -0
- package/dist/pages/medias/EpAudioView.vue.d.ts +2 -0
- package/dist/pages/medias/EpCarouselView.vue.d.ts +2 -0
- package/dist/pages/medias/EpIframeView.vue.d.ts +2 -0
- package/dist/pages/medias/EpKatexView.vue.d.ts +2 -0
- package/dist/pages/medias/EpLinkVersionView.vue.d.ts +2 -0
- package/dist/pages/medias/EpLinkView.vue.d.ts +2 -0
- package/dist/pages/medias/EpLottieSvgView.vue.d.ts +2 -0
- package/dist/pages/medias/EpSoftwareView.vue.d.ts +2 -0
- package/dist/pages/medias/EpSvgView.vue.d.ts +2 -0
- package/dist/pages/medias/EpTermView.vue.d.ts +2 -0
- package/dist/pages/medias/EpTimeLineView.vue.d.ts +2 -0
- package/dist/pages/medias/EpVideoPanoptoView.vue.d.ts +2 -0
- package/dist/pages/medias/EpVideoView.vue.d.ts +2 -0
- package/dist/pages/medias/EpWordDefView.vue.d.ts +2 -0
- package/dist/pages/signages/EpAlertView.vue.d.ts +2 -0
- package/dist/pages/signages/EpHeaderView.vue.d.ts +2 -0
- package/dist/pages/signages/EpQuoteView.vue.d.ts +2 -0
- package/dist/pages/signages/EpSkeletonView.vue.d.ts +2 -0
- package/dist/prism-CvcYxWXz.js +1184 -0
- package/dist/testImg.jpg +0 -0
- package/dist/testMaria.jpg +0 -0
- package/dist/three.core-ChKHLxK7.js +48675 -0
- package/dist/types/Aframe.d.ts +1 -0
- package/dist/types/Answer.d.ts +0 -1
- package/dist/types/Hover.d.ts +3 -0
- package/dist/types/StackedList.d.ts +63 -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 +33 -27
- 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 +74 -0
- package/src/components/educationals/EpBranchingScenario.vue +239 -0
- package/src/components/educationals/EpCodeblock.vue +26 -0
- package/src/components/educationals/EpEdu.vue +4 -4
- package/src/components/forms/EpSelect.vue +0 -2
- 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/src/components/signages/EpHeader.vue +3 -3
- package/dist/BgAudio-DVtBy2Yu.js +0 -4
- package/dist/DisplayBox-Bqpv2Yax.js +0 -4
- package/dist/EpAlert-DIz92PWl.js +0 -4
- package/dist/EpAudio-BYAKVi4t.js +0 -4
- package/dist/EpBadge-BQPHoP0c.js +0 -4
- package/dist/EpBarChart-DPMjCUAi.js +0 -4
- package/dist/EpBtn-BsTDJzZl.js +0 -4
- package/dist/EpCard-BV7JGDmN.js +0 -4
- package/dist/EpChip-Bc5_CRfT.js +0 -4
- package/dist/EpCodeblock-Cgpe89w6.js +0 -4
- package/dist/EpConclusion--tFRXdSL.js +0 -4
- package/dist/EpContentSlider-zrdFRG7P.js +0 -4
- package/dist/EpDescription-BDF2F3QV.js +0 -4
- package/dist/EpDivider-CJi6nCyw.js +0 -4
- package/dist/EpEdu--ba22VQy.js +0 -4
- package/dist/EpFlex-CHPbSith.js +0 -4
- package/dist/EpFunnelChart-D0e_q2MH.js +0 -4
- package/dist/EpHeader-BxdfY-8D.js +0 -4
- package/dist/EpHover-yDkRFQtx.js +0 -31
- package/dist/EpIcon-CjqNxCUN.js +0 -4
- package/dist/EpIframe-DErlt49p.js +0 -4
- package/dist/EpImg-CXoXMzh1.js +0 -4
- package/dist/EpInput-SPJ_6aAL.js +0 -1168
- package/dist/EpInstructions-swRu_knl.js +0 -4
- package/dist/EpIntroduction-BpdeCXud.js +0 -4
- package/dist/EpLineChart-ClCluBEa.js +0 -4
- package/dist/EpLink-BH8JnesP.js +0 -4
- package/dist/EpLinkVersion-Ti3w_eOz.js +0 -4
- package/dist/EpModal-bOiLnl7i.js +0 -4
- package/dist/EpNothing-DoWzP81f.js +0 -10
- package/dist/EpObjective-ADofPvvb.js +0 -4
- package/dist/EpPieChart-Q9m_DFgU.js +0 -4
- package/dist/EpQuestion-CcpZ58fx.js +0 -4
- package/dist/EpQuote-2fZoyMCN.js +0 -4
- package/dist/EpRadio-DDVA6v0A.js +0 -4
- package/dist/EpRadioSummative-4JojYeC8.js +0 -4
- package/dist/EpReading-CXeFpu9Q.js +0 -4
- package/dist/EpResource-BWdIzn90.js +0 -4
- package/dist/EpScope-Cc_-80ir.js +0 -4
- package/dist/EpSection-BLO-FKWj.js +0 -4
- package/dist/EpSectionCols-2PD4vn2f.js +0 -4
- package/dist/EpSkeleton-DZVfIXYn.js +0 -4
- package/dist/EpSoftware-DssmIKzt.js +0 -4
- package/dist/EpSpecificObjective-DZVGLGX3.js +0 -4
- package/dist/EpSpinner-Bq6iLU0e.js +0 -4
- package/dist/EpSummativeTable-LbWYDdm0.js +0 -4
- package/dist/EpSvg-CArfUn2s.js +0 -4
- package/dist/EpTable-CgEzj10i.js +0 -4
- package/dist/EpTerm-CpUmtYPe.js +0 -4
- package/dist/EpText-CCnR2Vyt.js +0 -4
- package/dist/EpTimeLine-CJ5GCxvC.js +0 -4
- package/dist/EpVideo-BBmT0bWr.js +0 -4
- package/dist/EpVideoPanopto-CF_RKq9a.js +0 -4
- package/dist/EpWordDef-jdGql2Aw.js +0 -4
- package/dist/components/basics/EpList.vue.d.ts +0 -11
- package/dist/components/basics/EpListitem.vue.d.ts +0 -45
- package/dist/components/forms/EpSwitch.vue.d.ts +0 -58
- package/dist/components/interactions/EpHotsPot.vue.d.ts +0 -47
- package/dist/components/interactions/EpTooltip.vue.d.ts +0 -51
- package/dist/components/signages/EpBadge.vue.d.ts +0 -59
- package/dist/prism-DcL1Q084.js +0 -1182
- package/dist/style.css +0 -1
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
import { ref, computed } from "vue";
|
|
4
|
+
import { useRenderText } from '../../composables/useRenderText';
|
|
5
|
+
import EpIcon from '../../components/basics/EpIcon.vue';
|
|
6
|
+
import { mdiArrowLeft } from "@mdi/js";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// Defining the props
|
|
10
|
+
|
|
11
|
+
interface Option {
|
|
12
|
+
name: string;
|
|
13
|
+
question: string;
|
|
14
|
+
imgSrc?: string;
|
|
15
|
+
options?: Option[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface Props {
|
|
19
|
+
scenarioTitle: string;
|
|
20
|
+
initialInstruction?: string | null;
|
|
21
|
+
bgColor?: string;
|
|
22
|
+
decisionTree: {
|
|
23
|
+
rootQuestion: string;
|
|
24
|
+
imgSrc?: string;
|
|
25
|
+
options: Option[];
|
|
26
|
+
};
|
|
27
|
+
transitionAnimation?: "fade" | "scale" | "slideY";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
32
|
+
initialInstruction: null,
|
|
33
|
+
transitionAnimation: "fade"
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// The necessary references to keep track of the evolution
|
|
38
|
+
|
|
39
|
+
const itinerary = ref<number[]>([]);
|
|
40
|
+
|
|
41
|
+
const currentSlide = ref(0);
|
|
42
|
+
const currentOption = ref<null | any>(null);
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// Manage the introductory part
|
|
46
|
+
const isIntroductoryPart = ref(true);
|
|
47
|
+
|
|
48
|
+
// Get the option from the itinerary
|
|
49
|
+
const getOptionFromItinerary = (itinerary: number[]) => {
|
|
50
|
+
let option: any = props.decisionTree;
|
|
51
|
+
if (itinerary.length > 0) {
|
|
52
|
+
for (let i = 0; i < itinerary.length; i++) {
|
|
53
|
+
option = option.options[itinerary[i]];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
return (option !== props.decisionTree)? option : null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
// Return function
|
|
64
|
+
|
|
65
|
+
const goToPrevious = () => {
|
|
66
|
+
if(notTheEnd.value){
|
|
67
|
+
if(itinerary.value.length === 0) {
|
|
68
|
+
isIntroductoryPart.value = true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
itinerary.value.pop();
|
|
72
|
+
currentOption.value = getOptionFromItinerary(itinerary.value);
|
|
73
|
+
currentSlide.value = itinerary.value.length;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// Verifying if we are at the end
|
|
78
|
+
const notTheEnd = computed(() => {
|
|
79
|
+
return currentSlide.value === 0 || (currentOption.value && currentOption.value.options && currentOption.value.options.length > 0);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
// Restart function
|
|
85
|
+
const restart = () => {
|
|
86
|
+
currentSlide.value = 0;
|
|
87
|
+
currentOption.value = null;
|
|
88
|
+
itinerary.value = [];
|
|
89
|
+
isIntroductoryPart.value = true;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
// Function to get the choices made based on the itinerary
|
|
95
|
+
const getChoices = (itinerary: number[]) => {
|
|
96
|
+
let choices: any[] = [{question: props.decisionTree.rootQuestion, choice: props.decisionTree.options[itinerary[0]].name}];
|
|
97
|
+
let option: any = props.decisionTree.options[itinerary[0]];
|
|
98
|
+
if (itinerary.length > 1) {
|
|
99
|
+
for (let i = 1; i < itinerary.length; i++) {
|
|
100
|
+
let question: string = option.question;
|
|
101
|
+
option = option.options[itinerary[i]];
|
|
102
|
+
choices.push({question, choice: option.name});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return choices;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<template>
|
|
114
|
+
<div>
|
|
115
|
+
|
|
116
|
+
<!-- The introductory part -->
|
|
117
|
+
<div v-if="isIntroductoryPart" class="m-4 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 }">
|
|
118
|
+
<h1 class="font-bold text-3xl">{{ scenarioTitle }}</h1>
|
|
119
|
+
<div class="text-center min-w-max m-3 flex flex-col items-center gap-3" v-if="initialInstruction" v-html="useRenderText(initialInstruction)"></div>
|
|
120
|
+
<button class="rounded bg-blue-500 text-white py-2 px-4 min-w-28 my-3" @click="isIntroductoryPart = false">Commencer</button>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<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>
|
|
125
|
+
<!-- Return button -->
|
|
126
|
+
<div><button :class="`rounded bg-blue-500 text-white py-2 px-4 m-2 ${transitionAnimation}`" v-if="notTheEnd" @click="goToPrevious">
|
|
127
|
+
<EpIcon :icon-path="mdiArrowLeft" size="25"></EpIcon>
|
|
128
|
+
</button></div>
|
|
129
|
+
|
|
130
|
+
<!-- First question -->
|
|
131
|
+
<div :class="`flex-grow flex flex-col items-center justify-around ${transitionAnimation}`" v-if="currentSlide === 0">
|
|
132
|
+
<div class="text-center min-w-max m-3 flex flex-col items-center gap-3" v-html="useRenderText(decisionTree.rootQuestion)"></div>
|
|
133
|
+
<img v-if="decisionTree.imgSrc" :src="decisionTree.imgSrc" class="rounded" width="200" />
|
|
134
|
+
<div :class="`w-full justify-items-center mx-4 grid ${(decisionTree.options.length <= 2)? 'grid-cols-2' : 'grid-cols-3'}`">
|
|
135
|
+
<button :class="`rounded bg-blue-500 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>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- The rest of the scenario including the end-->
|
|
140
|
+
<div class="flex-grow flex" v-else>
|
|
141
|
+
|
|
142
|
+
<!-- The current slide -->
|
|
143
|
+
<div :key="currentOption.question" :class="`flex-grow flex flex-col items-center justify-around ${transitionAnimation}`" v-if="notTheEnd">
|
|
144
|
+
<div class="text-center min-w-max m-3 flex flex-col items-center gap-3" v-html="useRenderText(currentOption.question)"></div>
|
|
145
|
+
<img v-if="currentOption.imgSrc" :src="currentOption.imgSrc" class="rounded" width="200" />
|
|
146
|
+
<div :class="`w-full justify-items-center mx-4 grid ${(currentOption.options.length <= 2)? 'grid-cols-2' : 'grid-cols-3'}`">
|
|
147
|
+
<button :class="`rounded bg-blue-500 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>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<!-- End of the scenario -->
|
|
152
|
+
<div :class="`flex-grow flex flex-col items-center ${transitionAnimation}`" v-else>
|
|
153
|
+
<div class="flex-grow flex flex-col items-center">
|
|
154
|
+
<h1 class="my-2 font-bold text-3xl">Vous avez terminé le scénario!</h1>
|
|
155
|
+
<p>Voici votre parcours</p>
|
|
156
|
+
<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;">
|
|
157
|
+
<div v-for="(question, index) in getChoices(itinerary)" :key="index" class="path-item rounded bg-blue-500 text-white py-2 px-4 flex flex-col items-center">
|
|
158
|
+
<u>{{ question.question }}</u>
|
|
159
|
+
<p>{{ question.choice }}</p>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
<button class='rounded bg-blue-500 text-white py-2 px-4 min-w-28 my-3 col-span-1' @click="restart">Recommencer</button>
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</template>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
<style scoped>
|
|
174
|
+
@keyframes fade {
|
|
175
|
+
0% {
|
|
176
|
+
opacity: 0;
|
|
177
|
+
}
|
|
178
|
+
100% {
|
|
179
|
+
opacity: 1;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@keyframes scale {
|
|
185
|
+
0% {
|
|
186
|
+
transform: scale(0.5);
|
|
187
|
+
opacity: 0;
|
|
188
|
+
}
|
|
189
|
+
100% {
|
|
190
|
+
transform: scale(1);
|
|
191
|
+
opacity: 1;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes slideY {
|
|
196
|
+
0% {
|
|
197
|
+
transform: translateY(-100%);
|
|
198
|
+
opacity: 0;
|
|
199
|
+
}
|
|
200
|
+
100% {
|
|
201
|
+
transform: translateY(0);
|
|
202
|
+
opacity: 1;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Transition animation */
|
|
207
|
+
.fade{
|
|
208
|
+
animation: fade 1s;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.scale{
|
|
212
|
+
animation: scale 1s;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.slideY{
|
|
216
|
+
animation: slideY 1s;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
/* Path item styling */
|
|
224
|
+
.path-item {
|
|
225
|
+
position: relative;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.path-item::after {
|
|
229
|
+
content: '';
|
|
230
|
+
position: absolute;
|
|
231
|
+
top: 50%;
|
|
232
|
+
right: 100%;
|
|
233
|
+
width: 60px;
|
|
234
|
+
height: 4px;
|
|
235
|
+
background-color: rgb(55, 65, 81);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
</style>
|
|
239
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import VCodeBlock from '@wdns/vue-code-block';
|
|
3
3
|
import {defaultOption} from "../../types/Codeblock";
|
|
4
|
+
import EpAccordeon from "../interactions/EpAccordeon.vue";
|
|
4
5
|
import type Theme from "../../types/Codeblock";
|
|
5
6
|
import { computed} from "vue";
|
|
6
7
|
import { ref } from "vue";
|
|
@@ -12,14 +13,23 @@
|
|
|
12
13
|
label?:string;
|
|
13
14
|
lang?:Langue;
|
|
14
15
|
theme?:Theme;
|
|
16
|
+
title?: string | null;
|
|
17
|
+
compact?: boolean;
|
|
15
18
|
}
|
|
16
19
|
const props = withDefaults(defineProps<Props>(), {
|
|
17
20
|
code:"",
|
|
18
21
|
label:"",
|
|
19
22
|
lang:"javascript",
|
|
20
23
|
theme: defaultOption,
|
|
24
|
+
compact: false,
|
|
21
25
|
})
|
|
22
26
|
|
|
27
|
+
const renderTitle = computed(() => {
|
|
28
|
+
if (!props.title) {
|
|
29
|
+
return "En savoir plus"
|
|
30
|
+
}
|
|
31
|
+
return props.title;
|
|
32
|
+
});
|
|
23
33
|
|
|
24
34
|
const code = computed(()=>{
|
|
25
35
|
return ref(props.code);
|
|
@@ -43,6 +53,22 @@ const theme = computed(()=>{
|
|
|
43
53
|
:label=label
|
|
44
54
|
:lang=lang
|
|
45
55
|
:theme=theme
|
|
56
|
+
v-if="!compact"
|
|
46
57
|
/>
|
|
58
|
+
|
|
59
|
+
<EpAccordeon outlined :title="renderTitle" v-else>
|
|
60
|
+
<VCodeBlock
|
|
61
|
+
:code=code
|
|
62
|
+
highlightjs
|
|
63
|
+
:label=label
|
|
64
|
+
:lang=lang
|
|
65
|
+
:theme=theme
|
|
66
|
+
/>
|
|
67
|
+
</EpAccordeon>
|
|
47
68
|
|
|
48
69
|
</template>
|
|
70
|
+
<style>
|
|
71
|
+
pre {
|
|
72
|
+
white-space: break-spaces;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { toRefs, computed, useSlots } from "vue";
|
|
2
|
+
import { toRefs, computed, useSlots, SetupContext } from "vue";
|
|
3
3
|
//types with capital letter, object styles in lowercase
|
|
4
4
|
import { type MediaVariants, mediaVariants } from "../../types/Medias";
|
|
5
5
|
import { type MandateLevel } from "../../types/MandateLevel";
|
|
@@ -26,11 +26,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
26
26
|
type: "base",
|
|
27
27
|
hideIcon: false,
|
|
28
28
|
flat: false,
|
|
29
|
-
labelIntentions:""
|
|
29
|
+
labelIntentions: "",
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
//get slots
|
|
33
|
-
const slots = useSlots();
|
|
33
|
+
const slots: SetupContext["slots"] = useSlots();
|
|
34
34
|
|
|
35
35
|
const hasIntentions = computed(() => {
|
|
36
36
|
return slots.intentions ? true : false;
|
|
@@ -93,7 +93,7 @@ const { title, hideIcon } = toRefs(props);
|
|
|
93
93
|
class="font-semibold mb-2 text-sm uppercase tracking-wide text-gray-500 dark:text-white"
|
|
94
94
|
>
|
|
95
95
|
{{ labelIntentions }}
|
|
96
|
-
</h4>
|
|
96
|
+
</h4>
|
|
97
97
|
<slot name="intentions"></slot>
|
|
98
98
|
<EpDivider />
|
|
99
99
|
</div>
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
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 { Object3D, Quaternion, Vector3 } from "three";
|
|
6
|
+
import type { Pin, Scene } from "../../types/image360";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
scenes:Scene[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = defineProps<Props>();
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const currentSceneIndex = ref(0);
|
|
17
|
+
const hoveredPin = ref<Pin | null>(null);
|
|
18
|
+
const clickedPin = ref<Pin | null>(null);
|
|
19
|
+
|
|
20
|
+
if (!AFRAME.components["rotation-reader"]) {
|
|
21
|
+
AFRAME.registerComponent("rotation-reader", {
|
|
22
|
+
schema: {},
|
|
23
|
+
tick: createTickFunction(),
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function handleMarkerClick(pin: Pin, event: Event): void {
|
|
28
|
+
if (!pin) return;
|
|
29
|
+
|
|
30
|
+
if (pin?.event === "onClick" || !pin.event) {
|
|
31
|
+
if (pin.type == "descriptive") {
|
|
32
|
+
clickedPin.value = pin;
|
|
33
|
+
const target = event.target as HTMLElement;
|
|
34
|
+
target.setAttribute("material", "opacity: 0; transparent: true");
|
|
35
|
+
console.log("Marker clicked:", pin);
|
|
36
|
+
} else if (pin.type == "action") {
|
|
37
|
+
const nextSceneIndex = props.scenes.findIndex(
|
|
38
|
+
(scene) => scene.id === pin.scene
|
|
39
|
+
);
|
|
40
|
+
if (nextSceneIndex !== -1) {
|
|
41
|
+
currentSceneIndex.value = nextSceneIndex;
|
|
42
|
+
}
|
|
43
|
+
console.log(
|
|
44
|
+
"Action Pin Clicked. Scene switched to:",
|
|
45
|
+
currentSceneIndex.value
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function handleMouseEnter(pin: Pin | null, event: Event): void {
|
|
52
|
+
if (!pin) return;
|
|
53
|
+
|
|
54
|
+
if (pin?.event === "onHover" || !pin?.event) {
|
|
55
|
+
hoveredPin.value = pin;
|
|
56
|
+
const target = event.target as HTMLElement;
|
|
57
|
+
target.setAttribute("material", "opacity: 0; transparent: true");
|
|
58
|
+
console.log("Marker hovered:", pin);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handleMouseLeave(pin: Pin | null, event: Event): void {
|
|
63
|
+
if (!pin) return;
|
|
64
|
+
|
|
65
|
+
const relatedTarget = (event as MouseEvent).relatedTarget as HTMLElement;
|
|
66
|
+
|
|
67
|
+
if (pin?.event === "onHover" || !pin?.event) {
|
|
68
|
+
const target = event.target as HTMLElement;
|
|
69
|
+
if (clickedPin.value == pin) {
|
|
70
|
+
target.setAttribute("material", "opacity: 1; transparent: true");
|
|
71
|
+
}
|
|
72
|
+
if (
|
|
73
|
+
!relatedTarget?.classList.contains("interactive-area") &&
|
|
74
|
+
hoveredPin.value?.id === pin?.id
|
|
75
|
+
) {
|
|
76
|
+
hoveredPin.value = null;
|
|
77
|
+
console.log("Hover cleared:", pin);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function convertToPosition(x: number, y: number): string {
|
|
83
|
+
return `${x / 10} ${y / 10} -5`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
onMounted(() => {
|
|
87
|
+
(async () => {
|
|
88
|
+
await checkAndDeleteComponent("rotation-reader", 2000);
|
|
89
|
+
})();
|
|
90
|
+
(async () => {
|
|
91
|
+
await registerRotationReaderComponent(2000);
|
|
92
|
+
})();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
async function checkAndDeleteComponent(
|
|
96
|
+
componentName: string,
|
|
97
|
+
delayMs: number = 1000
|
|
98
|
+
) {
|
|
99
|
+
if (AFRAME.components[componentName]) {
|
|
100
|
+
await delay(delayMs);
|
|
101
|
+
delete AFRAME.components[componentName];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function delay(ms: number): Promise<void> {
|
|
106
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async function registerRotationReaderComponent(delayMs: number = 1000) {
|
|
110
|
+
await delay(delayMs);
|
|
111
|
+
if (AFRAME.components["rotation-reader"]) {
|
|
112
|
+
console.warn(
|
|
113
|
+
"Existing rotation-reader component found. Re-registering..."
|
|
114
|
+
);
|
|
115
|
+
delete AFRAME.components["rotation-reader"];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
AFRAME.registerComponent("rotation-reader", {
|
|
119
|
+
schema: {},
|
|
120
|
+
tick: createTickFunction(),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function createTickFunction() {
|
|
125
|
+
const quaternion = new Quaternion();
|
|
126
|
+
const cameraPosition = new Vector3();
|
|
127
|
+
const objectPosition = new Vector3();
|
|
128
|
+
|
|
129
|
+
const referenceDistance = 5;
|
|
130
|
+
const initialScale = 0.8;
|
|
131
|
+
|
|
132
|
+
return function (this: {
|
|
133
|
+
el: { object3D: InstanceType<typeof Object3D>; sceneEl: any };
|
|
134
|
+
}) {
|
|
135
|
+
updateCameraQuaternion(this.el.object3D, quaternion);
|
|
136
|
+
updatePinsRotation(quaternion);
|
|
137
|
+
|
|
138
|
+
this.el.object3D.getWorldPosition(cameraPosition);
|
|
139
|
+
|
|
140
|
+
document.querySelectorAll(".pin-marker").forEach((pinElement) => {
|
|
141
|
+
const pinObject = (pinElement as any).object3D;
|
|
142
|
+
if (pinObject) {
|
|
143
|
+
pinObject.getWorldPosition(objectPosition);
|
|
144
|
+
const distance = cameraPosition.distanceTo(objectPosition);
|
|
145
|
+
const scale = (distance * initialScale) / referenceDistance;
|
|
146
|
+
pinObject.scale.set(scale, scale, scale);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
document.querySelectorAll(".frame").forEach((frameElement) => {
|
|
151
|
+
const frameObject = (frameElement as any).object3D;
|
|
152
|
+
if (frameObject) {
|
|
153
|
+
frameObject.getWorldPosition(objectPosition);
|
|
154
|
+
const distance = cameraPosition.distanceTo(objectPosition);
|
|
155
|
+
const scale = (distance * initialScale) / referenceDistance;
|
|
156
|
+
frameObject.scale.set(scale, scale, scale);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function getPinOpacity(pinId: number): number {
|
|
163
|
+
return (hoveredPin.value && hoveredPin.value.id === pinId) ||
|
|
164
|
+
(clickedPin.value && clickedPin.value.id === pinId)
|
|
165
|
+
? 0
|
|
166
|
+
: 1;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function updateCameraQuaternion(
|
|
170
|
+
object3D: InstanceType<typeof Object3D>,
|
|
171
|
+
quaternion: InstanceType<typeof Quaternion>
|
|
172
|
+
) {
|
|
173
|
+
object3D.getWorldQuaternion(quaternion);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function updatePinsRotation(quaternion: InstanceType<typeof Quaternion>) {
|
|
177
|
+
document.querySelectorAll(".pin-marker").forEach((pinElement) => {
|
|
178
|
+
const pinObject = (pinElement as any).object3D;
|
|
179
|
+
if (pinObject) {
|
|
180
|
+
pinObject.setRotationFromQuaternion(quaternion);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
document.querySelectorAll(".frame").forEach((pinElement) => {
|
|
184
|
+
const pinObject = (pinElement as any).object3D;
|
|
185
|
+
if (pinObject) {
|
|
186
|
+
pinObject.setRotationFromQuaternion(quaternion);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function removeFrame() {
|
|
192
|
+
clickedPin.value = null;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function getPinColor(pin: Pin): string {
|
|
196
|
+
return pin.color || "indigo";
|
|
197
|
+
}
|
|
198
|
+
</script>
|
|
199
|
+
|
|
200
|
+
<template>
|
|
201
|
+
<div
|
|
202
|
+
style="
|
|
203
|
+
width: 800px;
|
|
204
|
+
height: 600px;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
position: relative;
|
|
207
|
+
margin: auto;
|
|
208
|
+
"
|
|
209
|
+
>
|
|
210
|
+
<a-scene embedded>
|
|
211
|
+
<a-assets>
|
|
212
|
+
<img
|
|
213
|
+
v-for="scene in props.scenes"
|
|
214
|
+
:key="scene.id"
|
|
215
|
+
:id="`image${scene.id}`"
|
|
216
|
+
:src="scene.skyImage"
|
|
217
|
+
crossorigin="anonymous"
|
|
218
|
+
/>
|
|
219
|
+
</a-assets>
|
|
220
|
+
<a-entity camera look-controls id="rig" rotation-reader>
|
|
221
|
+
<a-cursor
|
|
222
|
+
id="cursor"
|
|
223
|
+
cursor="rayOrigin: mouse"
|
|
224
|
+
raycaster="objects: none"
|
|
225
|
+
geometry="primitive: ring; radiusInner: 0; radiusOuter: 0"
|
|
226
|
+
material="opacity: 0; transparent: true"
|
|
227
|
+
></a-cursor>
|
|
228
|
+
</a-entity>
|
|
229
|
+
|
|
230
|
+
<a-sky
|
|
231
|
+
:src="`#image${props.scenes[currentSceneIndex].id}`"
|
|
232
|
+
radius="100"
|
|
233
|
+
></a-sky>
|
|
234
|
+
|
|
235
|
+
<a-entity
|
|
236
|
+
v-for="pin in props.scenes[currentSceneIndex].pins"
|
|
237
|
+
:key="pin.id"
|
|
238
|
+
:position="convertToPosition(pin.x, pin.y)"
|
|
239
|
+
cursor="rayOrigin: mouse"
|
|
240
|
+
>
|
|
241
|
+
<a-circle
|
|
242
|
+
class="pin-marker"
|
|
243
|
+
:color="getPinColor(pin)"
|
|
244
|
+
radius="0.25"
|
|
245
|
+
shader="flat"
|
|
246
|
+
:material="`opacity: ${getPinOpacity(
|
|
247
|
+
pin.id
|
|
248
|
+
)}; transparent: true`"
|
|
249
|
+
@click="(event: Event) => handleMarkerClick(pin, event)"
|
|
250
|
+
@mouseenter="(event: Event) => handleMouseEnter(pin, event)"
|
|
251
|
+
></a-circle>
|
|
252
|
+
</a-entity>
|
|
253
|
+
|
|
254
|
+
<a-entity
|
|
255
|
+
v-if="hoveredPin"
|
|
256
|
+
:position="convertToPosition(hoveredPin.x, hoveredPin.y)"
|
|
257
|
+
class="frame interactive-area"
|
|
258
|
+
cursor="rayOrigin: mouse"
|
|
259
|
+
@mouseleave="(event: Event) => handleMouseLeave(hoveredPin, event)"
|
|
260
|
+
>
|
|
261
|
+
<a-plane
|
|
262
|
+
color="white"
|
|
263
|
+
:opacity="1"
|
|
264
|
+
width="4"
|
|
265
|
+
height="1.5"
|
|
266
|
+
material="shader: standard; side: double;"
|
|
267
|
+
position="0 0 0"
|
|
268
|
+
geometry="primitive: plane; height: 1.5; width: 4;"
|
|
269
|
+
>
|
|
270
|
+
</a-plane>
|
|
271
|
+
|
|
272
|
+
<a-text
|
|
273
|
+
:value="hoveredPin.title"
|
|
274
|
+
color="#2c3e50"
|
|
275
|
+
font="dejavu"
|
|
276
|
+
align="center"
|
|
277
|
+
width="3.8"
|
|
278
|
+
position="0 0.3 0.01"
|
|
279
|
+
>
|
|
280
|
+
</a-text>
|
|
281
|
+
|
|
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
|
+
>
|
|
290
|
+
</a-text>
|
|
291
|
+
</a-entity>
|
|
292
|
+
|
|
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
|
+
>
|
|
308
|
+
</a-plane>
|
|
309
|
+
|
|
310
|
+
<a-plane
|
|
311
|
+
class="close-frame"
|
|
312
|
+
color="red"
|
|
313
|
+
width="0.4"
|
|
314
|
+
height="0.4"
|
|
315
|
+
position="1.8 0.55 0.01"
|
|
316
|
+
material="shader: flat; side: double; transparent: true;"
|
|
317
|
+
geometry="primitive: plane; height: 0.4; width: 0.4;"
|
|
318
|
+
@click="removeFrame"
|
|
319
|
+
>
|
|
320
|
+
</a-plane>
|
|
321
|
+
|
|
322
|
+
<a-text
|
|
323
|
+
:value="clickedPin.title"
|
|
324
|
+
color="#2c3e50"
|
|
325
|
+
font="dejavu"
|
|
326
|
+
align="center"
|
|
327
|
+
width="3.8"
|
|
328
|
+
position="0 0.3 0.01"
|
|
329
|
+
>
|
|
330
|
+
</a-text>
|
|
331
|
+
|
|
332
|
+
<a-text
|
|
333
|
+
:value="clickedPin.description"
|
|
334
|
+
color="#34495e"
|
|
335
|
+
font="dejavu"
|
|
336
|
+
align="center"
|
|
337
|
+
width="3.5"
|
|
338
|
+
position="0 -0.3 0.01"
|
|
339
|
+
>
|
|
340
|
+
</a-text>
|
|
341
|
+
</a-entity>
|
|
342
|
+
</a-scene>
|
|
343
|
+
</div>
|
|
344
|
+
</template>
|