lido-player 0.0.2-alpha-50-dev → 0.0.2-alpha-51-dev
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/LICENSE +21 -21
- package/dist/cjs/{index-6a69c33a.js → index-baff5c15.js} +48 -14
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{lido-avatar_21.cjs.entry.js → lido-avatar_22.cjs.entry.js} +3043 -162
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-079a5e7d.js → utils-dc02d753.js} +150 -95
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/calculator/lido-calculator.css +87 -87
- package/dist/collection/components/calculator/lido-calculator.js +14 -8
- package/dist/collection/components/canvas/lido-canvas.css +38 -0
- package/dist/collection/components/canvas/lido-canvas.js +220 -0
- package/dist/collection/components/cell/lido-cell.css +100 -100
- package/dist/collection/components/cell/lido-cell.js +12 -12
- package/dist/collection/components/column/lido-col.css +19 -19
- package/dist/collection/components/column/lido-col.js +6 -6
- package/dist/collection/components/container/lido-container.css +10 -10
- package/dist/collection/components/container/lido-container.js +70 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
- package/dist/collection/components/float/lido-float.css +30 -30
- package/dist/collection/components/float/lido-float.js +2 -2
- package/dist/collection/components/home/lido-home.css +278 -278
- package/dist/collection/components/home/lido-home.js +92 -12
- package/dist/collection/components/image/lido-image.css +17 -17
- package/dist/collection/components/image/lido-image.js +6 -6
- package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +56 -2
- package/dist/collection/components/position/lido-pos.css +16 -16
- package/dist/collection/components/position/lido-pos.js +2 -2
- package/dist/collection/components/random/lido-random.css +8 -8
- package/dist/collection/components/random/lido-random.js +2 -2
- package/dist/collection/components/root/lido-root.js +42 -6
- package/dist/collection/components/row/lido-row.css +10 -10
- package/dist/collection/components/row/lido-row.js +6 -6
- package/dist/collection/components/scale/lido-balance.css +145 -114
- package/dist/collection/components/scale/lido-balance.js +17 -17
- package/dist/collection/components/shape/lido-shape.css +96 -96
- package/dist/collection/components/shape/lido-shape.js +5 -5
- package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
- package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
- package/dist/collection/components/text/lido-text.css +53 -53
- package/dist/collection/components/text/lido-text.js +6 -5
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +2 -2
- package/dist/collection/components/wrap/lido-wrap.css +18 -18
- package/dist/collection/components/wrap/lido-wrap.js +6 -6
- package/dist/collection/css/animation.css +194 -194
- package/dist/collection/css/index.css +277 -277
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +60 -60
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +55 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +29 -29
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +42 -42
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +37 -31
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +48 -0
- package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +28 -22
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
- package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +37 -37
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
- package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
- package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +54 -54
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +23 -23
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +32 -28
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +56 -54
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +56 -45
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +38 -38
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +131 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +53 -49
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +44 -40
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +96 -96
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +47 -45
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
- package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +62 -58
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +52 -48
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +65 -61
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -58
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +111 -107
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +46 -46
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
- package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +51 -47
- package/dist/collection/stories/Templates/total/total.stories.js +27 -27
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +35 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +62 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -40
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +36 -32
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +37 -33
- package/dist/collection/stories/components/flash-card.stories.js +48 -48
- package/dist/collection/stories/components/keyboard.stories.js +10 -10
- package/dist/collection/stories/components/slider.stories.js +4 -4
- package/dist/collection/stories/components/trace.stories.js +5 -5
- package/dist/collection/utils/audioPlayer.js +43 -6
- package/dist/collection/utils/constants.js +1 -0
- package/dist/collection/utils/i18n.js +36 -0
- package/dist/collection/utils/utils.js +36 -29
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +17 -9
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +2 -2
- package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +9 -9
- package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.d.ts +11 -0
- package/dist/components/lido-canvas.js +6 -0
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-image.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +49 -25
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-73e31a86.js → p-04e904b5.js} +8 -8
- package/dist/components/p-0fbeb3a1.js +2700 -0
- package/dist/components/{p-1fbdb431.js → p-12432f23.js} +2 -2
- package/dist/components/p-1c84cf65.js +123 -0
- package/dist/components/{p-74849cdd.js → p-1f3c2783.js} +4 -4
- package/dist/components/{p-e4e42677.js → p-4fd6b588.js} +2 -2
- package/dist/components/{p-e36ddcc1.js → p-56c8f3da.js} +14 -11
- package/dist/components/{p-cbac3cbc.js → p-62d2a5b3.js} +2 -2
- package/dist/components/{p-44808985.js → p-6ba0f1af.js} +7 -7
- package/dist/components/{p-52844fa4.js → p-6be6c5eb.js} +2 -2
- package/dist/components/{p-08d0deab.js → p-74b90a9c.js} +9 -3
- package/dist/components/{p-d37ab4dc.js → p-988477ad.js} +2 -2
- package/dist/components/{p-7f7e5672.js → p-a8724f06.js} +2 -2
- package/dist/components/{p-3f406017.js → p-b7efadad.js} +2 -2
- package/dist/components/{p-15971ede.js → p-b89371ac.js} +1 -1
- package/dist/components/{p-904711c8.js → p-bb907e43.js} +2 -2
- package/dist/components/{p-afbc196f.js → p-bef96764.js} +3 -2
- package/dist/components/{p-322acda6.js → p-c8815e84.js} +67 -31
- package/dist/components/{p-835b973d.js → p-caa05d1e.js} +2 -2
- package/dist/components/{p-bed94c37.js → p-d0131159.js} +187 -105
- package/dist/components/{p-29bdd953.js → p-d3f7d561.js} +2 -2
- package/dist/components/{p-90465904.js → p-d7693f47.js} +2 -2
- package/dist/components/{p-9be56729.js → p-e9548986.js} +46 -2
- package/dist/esm/{index-170e58c7.js → index-37c2ad2d.js} +48 -14
- package/dist/esm/index.js +2 -2
- package/dist/esm/{lido-avatar_21.entry.js → lido-avatar_22.entry.js} +3043 -163
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-5df09162.js → utils-b5eb2360.js} +150 -95
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-9a9d5339.js +2 -0
- package/dist/lido-player/{p-7556e652.js → p-9fd87d44.js} +2 -2
- package/dist/lido-player/p-e1a9c26f.entry.js +1 -0
- package/dist/types/components/canvas/lido-canvas.d.ts +27 -0
- package/dist/types/components/container/lido-container.d.ts +6 -0
- package/dist/types/components/home/lido-home.d.ts +8 -0
- package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +3 -0
- package/dist/types/components/root/lido-root.d.ts +5 -0
- package/dist/types/components.d.ts +71 -0
- package/dist/types/stories/Templates/RocketGame/rocketGame.stories.d.ts +1 -0
- package/dist/types/stories/Templates/calculator/calculator.stories.d.ts +4 -0
- package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow.stories.d.ts +1 -0
- package/dist/types/stories/Templates/openwindow/openwindow2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +1 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +1 -0
- package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +1 -1
- package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeCard/writeCard.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeLetter/writeLetter.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +1 -0
- package/dist/types/stories/Templates/writeWord/writeWord.stories.d.ts +1 -0
- package/dist/types/types/json.d.ts +4 -0
- package/dist/types/utils/audioPlayer.d.ts +2 -0
- package/dist/types/utils/constants.d.ts +1 -0
- package/dist/types/utils/i18n.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/package.json +71 -69
- package/readme.md +113 -113
- package/dist/lido-player/p-137c99ce.js +0 -2
- package/dist/lido-player/p-eb956325.entry.js +0 -1
|
@@ -10,21 +10,21 @@ export default meta;
|
|
|
10
10
|
export const FrontTextBackCol = {
|
|
11
11
|
args: {},
|
|
12
12
|
render: _ => {
|
|
13
|
-
const xml = `<main>
|
|
14
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
15
|
-
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
16
|
-
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
17
|
-
<lido-text slot="front" width="400px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="lion" visible="true" y="landscape.35px, portrait.15px" bg-color="red">
|
|
18
|
-
</lido-text>
|
|
19
|
-
<lido-col id="col5" slot="back" disable-edit="true" visible="true" width="300px" height="400px" bg-color="orange" type="" tab-index="6" dropAttr="diagonal" value="cat" onEntry="this.position='relative';" y="landscape.-50px,portrait.">
|
|
20
|
-
<lido-image visible="true" src="https://i0.wp.com/pixahive.com/wp-content/uploads/2021/02/Yellow-pattern-abstract-background-wallpaper-325431-pixahive.jpg?fit=778%2C435ssl=1" z="0" width="200px" height="300px" onEntry="">
|
|
21
|
-
</lido-image>
|
|
22
|
-
<lido-text width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="tiger" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
23
|
-
</lido-text>
|
|
24
|
-
</lido-col>
|
|
25
|
-
</lido-flash-card>
|
|
26
|
-
</lido-row>
|
|
27
|
-
</lido-container>
|
|
13
|
+
const xml = `<main>
|
|
14
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
15
|
+
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
16
|
+
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
17
|
+
<lido-text slot="front" width="400px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="lion" visible="true" y="landscape.35px, portrait.15px" bg-color="red">
|
|
18
|
+
</lido-text>
|
|
19
|
+
<lido-col id="col5" slot="back" disable-edit="true" visible="true" width="300px" height="400px" bg-color="orange" type="" tab-index="6" dropAttr="diagonal" value="cat" onEntry="this.position='relative';" y="landscape.-50px,portrait.">
|
|
20
|
+
<lido-image visible="true" src="https://i0.wp.com/pixahive.com/wp-content/uploads/2021/02/Yellow-pattern-abstract-background-wallpaper-325431-pixahive.jpg?fit=778%2C435ssl=1" z="0" width="200px" height="300px" onEntry="">
|
|
21
|
+
</lido-image>
|
|
22
|
+
<lido-text width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="tiger" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
23
|
+
</lido-text>
|
|
24
|
+
</lido-col>
|
|
25
|
+
</lido-flash-card>
|
|
26
|
+
</lido-row>
|
|
27
|
+
</lido-container>
|
|
28
28
|
</main>`;
|
|
29
29
|
return html `<lido-home xml-data="${xml}" xmlData="${xml}"></lido-home>`;
|
|
30
30
|
},
|
|
@@ -32,17 +32,17 @@ export const FrontTextBackCol = {
|
|
|
32
32
|
export const BothText = {
|
|
33
33
|
args: {},
|
|
34
34
|
render: _ => {
|
|
35
|
-
const xml = `<main>
|
|
36
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
37
|
-
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
38
|
-
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
39
|
-
<lido-text slot="front" width="400px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="lion" visible="true" y="landscape.35px, portrait.15px" bg-color="red">
|
|
40
|
-
</lido-text>
|
|
41
|
-
<lido-text slot="back" width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="tiger" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
42
|
-
</lido-text>
|
|
43
|
-
</lido-flash-card>
|
|
44
|
-
</lido-row>
|
|
45
|
-
</lido-container>
|
|
35
|
+
const xml = `<main>
|
|
36
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
37
|
+
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
38
|
+
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
39
|
+
<lido-text slot="front" width="400px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="lion" visible="true" y="landscape.35px, portrait.15px" bg-color="red">
|
|
40
|
+
</lido-text>
|
|
41
|
+
<lido-text slot="back" width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="tiger" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
42
|
+
</lido-text>
|
|
43
|
+
</lido-flash-card>
|
|
44
|
+
</lido-row>
|
|
45
|
+
</lido-container>
|
|
46
46
|
</main>`;
|
|
47
47
|
return html `<lido-home xml-data="${xml}" xmlData="${xml}"></lido-home>`;
|
|
48
48
|
},
|
|
@@ -50,17 +50,17 @@ export const BothText = {
|
|
|
50
50
|
export const BothImages = {
|
|
51
51
|
args: {},
|
|
52
52
|
render: _ => {
|
|
53
|
-
const xml = `<main>
|
|
54
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
55
|
-
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
56
|
-
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
57
|
-
<lido-image visible="true" slot="front" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Bird_Blue.png" z="0" width="200px" height="300px" onEntry="">
|
|
58
|
-
</lido-image>
|
|
59
|
-
<lido-image visible="true" slot="back" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Boat.png" z="0" width="200px" height="300px" onEntry="">
|
|
60
|
-
</lido-image>
|
|
61
|
-
</lido-flash-card>
|
|
62
|
-
</lido-row>
|
|
63
|
-
</lido-container>
|
|
53
|
+
const xml = `<main>
|
|
54
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
55
|
+
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
56
|
+
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
57
|
+
<lido-image visible="true" slot="front" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Bird_Blue.png" z="0" width="200px" height="300px" onEntry="">
|
|
58
|
+
</lido-image>
|
|
59
|
+
<lido-image visible="true" slot="back" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Boat.png" z="0" width="200px" height="300px" onEntry="">
|
|
60
|
+
</lido-image>
|
|
61
|
+
</lido-flash-card>
|
|
62
|
+
</lido-row>
|
|
63
|
+
</lido-container>
|
|
64
64
|
</main>`;
|
|
65
65
|
return html `<lido-home xml-data="${xml}" xmlData="${xml}"></lido-home>`;
|
|
66
66
|
},
|
|
@@ -68,17 +68,17 @@ export const BothImages = {
|
|
|
68
68
|
export const FrontImageBackText = {
|
|
69
69
|
args: {},
|
|
70
70
|
render: _ => {
|
|
71
|
-
const xml = `<main>
|
|
72
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
73
|
-
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
74
|
-
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
75
|
-
<lido-image visible="true" slot="front" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Bird_Blue.png" z="0" width="200px" height="300px" onEntry="">
|
|
76
|
-
</lido-image>
|
|
77
|
-
<lido-text slot="back" width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="Bird" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
78
|
-
</lido-text>
|
|
79
|
-
</lido-flash-card>
|
|
80
|
-
</lido-row>
|
|
81
|
-
</lido-container>
|
|
71
|
+
const xml = `<main>
|
|
72
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer3" objective="lion,crocodile,cow" bg-color="#B1BEFD" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; this.removeClone='.cloned-element'" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" dropAttr="diagonal">
|
|
73
|
+
<lido-row visible="true" width="landscape.100%, portrait.338px" onEntry="" height="landscape.100%, portrait." y="landscape.340px, portrait.300px" x="landscape.,portrait.520px" direction="landscape.row, portrait.column">
|
|
74
|
+
<lido-flash-card x="50" y="200" width="220px" height="140px">
|
|
75
|
+
<lido-image visible="true" slot="front" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/thumbnails/sticker/Bird_Blue.png" z="0" width="200px" height="300px" onEntry="">
|
|
76
|
+
</lido-image>
|
|
77
|
+
<lido-text slot="back" width="300px" height="200px" display="flex" onEntry="" font-family="" font-size="48px" z="1" font-color="black" fontWeight="bold" color="#000000" string="Bird" visible="true" y="landscape.35px, portrait.15px" bg-color="yellow">
|
|
78
|
+
</lido-text>
|
|
79
|
+
</lido-flash-card>
|
|
80
|
+
</lido-row>
|
|
81
|
+
</lido-container>
|
|
82
82
|
</main>`;
|
|
83
83
|
return html `<lido-home xml-data="${xml}" xmlData="${xml}"></lido-home>`;
|
|
84
84
|
},
|
|
@@ -24,15 +24,15 @@ export const Keyboard = {
|
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
26
|
const getContainerXml = args => {
|
|
27
|
-
return `<main>
|
|
28
|
-
<lido-container objective="${args.objective}" is-continue-on-correct="true" drop-action="infinite-drop" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';">
|
|
29
|
-
<!-- Chimple Avatar -->
|
|
30
|
-
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="305px" width="227px" x="-50px" y="landscape.560px, portrait.1220px" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
31
|
-
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="462px" width="356px" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
32
|
-
</lido-avatar>
|
|
33
|
-
</lido-cell>
|
|
34
|
-
${args.type === 'drag' ? `<lido-text visible="true" string="Drag the letters to this boxes." font-family="'Baloo Bhai 2'" font-size="36px" bg-color="transparent" margin="0 0 20px 0" type="drop"></lido-text>` : ""}
|
|
35
|
-
<lido-keyboard visible="true" keys="${args.keys}" type="${args.type}" width="1000px" height="300px" keyboard-input="${args.keyboardInput === "enable" ? "true" : "false"}"></lido-keyboard>
|
|
36
|
-
</lido-container>
|
|
27
|
+
return `<main>
|
|
28
|
+
<lido-container objective="${args.objective}" is-continue-on-correct="true" drop-action="infinite-drop" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';">
|
|
29
|
+
<!-- Chimple Avatar -->
|
|
30
|
+
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="305px" width="227px" x="-50px" y="landscape.560px, portrait.1220px" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
31
|
+
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="462px" width="356px" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
32
|
+
</lido-avatar>
|
|
33
|
+
</lido-cell>
|
|
34
|
+
${args.type === 'drag' ? `<lido-text visible="true" string="Drag the letters to this boxes." font-family="'Baloo Bhai 2'" font-size="36px" bg-color="transparent" margin="0 0 20px 0" type="drop"></lido-text>` : ""}
|
|
35
|
+
<lido-keyboard visible="true" keys="${args.keys}" type="${args.type}" width="1000px" height="300px" keyboard-input="${args.keyboardInput === "enable" ? "true" : "false"}"></lido-keyboard>
|
|
36
|
+
</lido-container>
|
|
37
37
|
</main>`;
|
|
38
38
|
};
|
|
@@ -32,9 +32,9 @@ export const QuestionAndOptions = {
|
|
|
32
32
|
};
|
|
33
33
|
function getContainerXml(args) {
|
|
34
34
|
const { src, fillPercentage, fillDirection, min, max, division, numberType } = args;
|
|
35
|
-
return `<main>
|
|
36
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer1" objective="..." aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" bg-color="black" visible="true">
|
|
37
|
-
<lido-slide-fill fill="${fillPercentage}" width="500px" src="${src}" fillDirection="${fillDirection}" numberType="${numberType}" min="${min}" max="${max}" division="${division}" ></lido-slider-fill>
|
|
38
|
-
</lido-container>
|
|
35
|
+
return `<main>
|
|
36
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer1" objective="..." aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" bg-color="black" visible="true">
|
|
37
|
+
<lido-slide-fill fill="${fillPercentage}" width="500px" src="${src}" fillDirection="${fillDirection}" numberType="${numberType}" min="${min}" max="${max}" division="${division}" ></lido-slider-fill>
|
|
38
|
+
</lido-container>
|
|
39
39
|
</main>`;
|
|
40
40
|
}
|
|
@@ -21,10 +21,10 @@ export const QuestionAndOptions = {
|
|
|
21
21
|
function getContainerXml(args) {
|
|
22
22
|
let svgText = args.svgFile[0];
|
|
23
23
|
let mode = args.mode;
|
|
24
|
-
return `<main>
|
|
25
|
-
<lido-container id="lido-container" tab-index="1" value="mainContainer1" objective="D-6ba518e3,D-5a192ba3,D-b686f882,D-9095b74f,D-e0a32c78,D-1e4e88f1" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" bg-color="#FFB742" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true">
|
|
26
|
-
<lido-trace id="image1" tab-index="2" value="image1" visible="true" svgSource="${svgText}" mode="${mode}" z="0" width="1600px" height="900px" onEntry="" alt-text="{backgroundImage}">
|
|
27
|
-
</lido-trace>
|
|
28
|
-
</lido-container>
|
|
24
|
+
return `<main>
|
|
25
|
+
<lido-container id="lido-container" tab-index="1" value="mainContainer1" objective="D-6ba518e3,D-5a192ba3,D-b686f882,D-9095b74f,D-e0a32c78,D-1e4e88f1" aria-label="" height="100vh" width="100vw" x="0" y="0" z="0" bg-color="#FFB742" visible="true" audio="background1.mp3" onTouch="" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true">
|
|
26
|
+
<lido-trace id="image1" tab-index="2" value="image1" visible="true" svgSource="${svgText}" mode="${mode}" z="0" width="1600px" height="900px" onEntry="" alt-text="{backgroundImage}">
|
|
27
|
+
</lido-trace>
|
|
28
|
+
</lido-container>
|
|
29
29
|
</main>`;
|
|
30
30
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { convertUrlToRelative, speakText } from "./utils";
|
|
2
2
|
import { highlightSpeakingElement, stopHighlightForSpeakingElement } from "./utilsHandlers/highlightHandler";
|
|
3
3
|
import { setDraggingDisabled } from "./utilsHandlers/dragDropHandler";
|
|
4
|
+
import { NextContainerKey, PrevContainerKey, ActivityChangeKey, GameCompletedKey, GameExitKey, ActivityEndKey, LessonEndKey } from "./constants";
|
|
4
5
|
export class AudioPlayer {
|
|
5
6
|
constructor() {
|
|
6
7
|
this.audioElement = document.createElement('audio');
|
|
7
8
|
this.audioElement.id = 'audio';
|
|
8
9
|
document.body.appendChild(this.audioElement);
|
|
10
|
+
this.registerGlobalStopEvents();
|
|
9
11
|
}
|
|
10
12
|
static getI() {
|
|
11
13
|
if (!AudioPlayer.instance) {
|
|
@@ -31,13 +33,23 @@ export class AudioPlayer {
|
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
async play(targetElement) {
|
|
36
|
+
// Stop any currently playing audio first if target element has audio given
|
|
37
|
+
try {
|
|
38
|
+
await AudioPlayer.getI().stop();
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
console.error('Error stopping audio before speak action:', e);
|
|
42
|
+
}
|
|
43
|
+
// then play the target element audio.
|
|
34
44
|
let audioUrl = targetElement.getAttribute('audio') || '';
|
|
45
|
+
// If no direct audio attribute, check childrens for audio
|
|
35
46
|
if (!audioUrl) {
|
|
36
47
|
const childElements = targetElement.children;
|
|
37
48
|
for (let i = 0; i < childElements.length; i++) {
|
|
38
49
|
const childAudioUrl = childElements[i].getAttribute('audio');
|
|
39
50
|
if (childAudioUrl) {
|
|
40
51
|
audioUrl = childAudioUrl;
|
|
52
|
+
break;
|
|
41
53
|
}
|
|
42
54
|
}
|
|
43
55
|
}
|
|
@@ -47,18 +59,21 @@ export class AudioPlayer {
|
|
|
47
59
|
console.log('🚀 Playing audio:', this.audioElement.src);
|
|
48
60
|
try {
|
|
49
61
|
setDraggingDisabled(true);
|
|
50
|
-
await this.audioElement.play();
|
|
51
62
|
highlightSpeakingElement(targetElement);
|
|
63
|
+
await this.audioElement.play();
|
|
52
64
|
await new Promise(resolve => {
|
|
53
65
|
this.audioElement.onended = () => {
|
|
54
|
-
stopHighlightForSpeakingElement(targetElement);
|
|
55
66
|
resolve();
|
|
56
|
-
setDraggingDisabled(false);
|
|
57
67
|
};
|
|
58
68
|
});
|
|
59
69
|
}
|
|
60
70
|
catch (error) {
|
|
61
|
-
console.log('
|
|
71
|
+
console.log('🎧 Audio play error:', error);
|
|
72
|
+
}
|
|
73
|
+
finally {
|
|
74
|
+
this.audioElement.onended = null; // cleanup
|
|
75
|
+
setDraggingDisabled(false);
|
|
76
|
+
stopHighlightForSpeakingElement(targetElement);
|
|
62
77
|
}
|
|
63
78
|
}
|
|
64
79
|
// If no audio, use text-to-speech
|
|
@@ -68,11 +83,33 @@ export class AudioPlayer {
|
|
|
68
83
|
await speakText(targetElement.textContent, targetElement);
|
|
69
84
|
const highlightedElements = document.querySelectorAll('.speaking-highlight');
|
|
70
85
|
highlightedElements.forEach(element => stopHighlightForSpeakingElement(element));
|
|
71
|
-
setDraggingDisabled(false);
|
|
72
86
|
}
|
|
73
87
|
catch (error) {
|
|
74
|
-
console.log('
|
|
88
|
+
console.log('🎧 TTS Error:', error);
|
|
89
|
+
}
|
|
90
|
+
finally {
|
|
91
|
+
setDraggingDisabled(false);
|
|
75
92
|
}
|
|
76
93
|
}
|
|
77
94
|
}
|
|
95
|
+
// GLOBAL STOP EVENTS (container change, activity change…)
|
|
96
|
+
registerGlobalStopEvents() {
|
|
97
|
+
const stopEvents = [
|
|
98
|
+
NextContainerKey, PrevContainerKey, LessonEndKey, ActivityChangeKey,
|
|
99
|
+
ActivityEndKey, GameCompletedKey, GameExitKey
|
|
100
|
+
];
|
|
101
|
+
stopEvents.forEach(key => {
|
|
102
|
+
window.addEventListener(key, () => this.stop());
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// DESTROY (for hot-reload)
|
|
106
|
+
destroy() {
|
|
107
|
+
console.log("AudioPlayer destroyed (hot-reload safe)");
|
|
108
|
+
this.stop();
|
|
109
|
+
// Remove DOM element
|
|
110
|
+
if (this.audioElement.parentNode) {
|
|
111
|
+
this.audioElement.parentNode.removeChild(this.audioElement);
|
|
112
|
+
}
|
|
113
|
+
AudioPlayer.instance = undefined;
|
|
114
|
+
}
|
|
78
115
|
}
|
|
@@ -16,6 +16,7 @@ export const DropHasDrag = 'dropHasDrag';
|
|
|
16
16
|
export const DropToAttr = 'drop-to';
|
|
17
17
|
export const DropTimeAttr = 'drop-time';
|
|
18
18
|
export const LidoContainer = 'lido-container';
|
|
19
|
+
export const LangChangeEvent = 'languageChanged';
|
|
19
20
|
export var TraceMode;
|
|
20
21
|
(function (TraceMode) {
|
|
21
22
|
TraceMode["NoFlow"] = "noFlow";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import i18next from "i18next";
|
|
2
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
3
|
+
// Import all your translation JSONs
|
|
4
|
+
import en from "../i18n/en.json";
|
|
5
|
+
import fr from "../i18n/fr.json";
|
|
6
|
+
import hi from "../i18n/hi.json";
|
|
7
|
+
import ka from "../i18n/ka.json";
|
|
8
|
+
import te from "../i18n/te.json";
|
|
9
|
+
import port from "../i18n/port.json";
|
|
10
|
+
i18next
|
|
11
|
+
.use(LanguageDetector)
|
|
12
|
+
.init({
|
|
13
|
+
resources: {
|
|
14
|
+
en: { translation: en },
|
|
15
|
+
fr: { translation: fr },
|
|
16
|
+
hi: { translation: hi },
|
|
17
|
+
ka: { translation: ka },
|
|
18
|
+
te: { translation: te },
|
|
19
|
+
port: { translation: port },
|
|
20
|
+
},
|
|
21
|
+
fallbackLng: 'en', // fallback if current lang not found
|
|
22
|
+
debug: false,
|
|
23
|
+
interpolation: {
|
|
24
|
+
escapeValue: false, // Stencil already handles escaping
|
|
25
|
+
},
|
|
26
|
+
detection: {
|
|
27
|
+
// optional: tune detection logic
|
|
28
|
+
order: ['querystring', 'localStorage', 'navigator', 'htmlTag'],
|
|
29
|
+
caches: ['localStorage'],
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
// Helper wrappers (simplify usage in components)
|
|
33
|
+
export const t = (key, options) => i18next.t(key, options);
|
|
34
|
+
export const setLanguage = (lang) => i18next.changeLanguage(lang);
|
|
35
|
+
export const getLanguage = () => i18next.language;
|
|
36
|
+
export default i18next;
|
|
@@ -169,7 +169,15 @@ export const executeActions = async (actionsString, thisElement, element) => {
|
|
|
169
169
|
break;
|
|
170
170
|
}
|
|
171
171
|
case 'speak': {
|
|
172
|
-
|
|
172
|
+
const val = (action.value || '').toString().trim().toLowerCase();
|
|
173
|
+
if (val === 'true' || val === '1' || val === 'yes') {
|
|
174
|
+
try {
|
|
175
|
+
await AudioPlayer.getI().play(targetElement);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
console.error('Error playing audio for speak action:', err);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
173
181
|
break;
|
|
174
182
|
}
|
|
175
183
|
case 'fill-slide': {
|
|
@@ -291,6 +299,10 @@ export const executeActions = async (actionsString, thisElement, element) => {
|
|
|
291
299
|
}
|
|
292
300
|
break;
|
|
293
301
|
}
|
|
302
|
+
case 'updatedAnswer': {
|
|
303
|
+
updatedAnswer();
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
294
306
|
default: {
|
|
295
307
|
targetElement.style[action.action] = action.value;
|
|
296
308
|
break;
|
|
@@ -321,11 +333,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
321
333
|
}
|
|
322
334
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
323
335
|
dragElement.replaceWith(dummyElement);
|
|
324
|
-
const keyframes = `
|
|
325
|
-
@keyframes widthDecrease {
|
|
326
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
327
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
328
|
-
}
|
|
336
|
+
const keyframes = `
|
|
337
|
+
@keyframes widthDecrease {
|
|
338
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
339
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
340
|
+
}
|
|
329
341
|
`;
|
|
330
342
|
if (!isInfinite) {
|
|
331
343
|
dummyElement.style.width = element.style.width;
|
|
@@ -488,10 +500,6 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
488
500
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
489
501
|
}
|
|
490
502
|
}
|
|
491
|
-
else {
|
|
492
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
493
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
494
|
-
}
|
|
495
503
|
}
|
|
496
504
|
let dragScore = buildDragSelectedMapFromDOM();
|
|
497
505
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
@@ -503,21 +511,6 @@ export async function onActivityComplete(dragElement, dropElement) {
|
|
|
503
511
|
drag[index] = [];
|
|
504
512
|
}
|
|
505
513
|
drag[index].push(dragElement.id);
|
|
506
|
-
// localStorage.setItem(DragMapKey, JSON.stringify(drag));
|
|
507
|
-
const sortedKeys = Object.keys(dragScore).sort((a, b) => parseInt(a) - parseInt(b));
|
|
508
|
-
if (dragElement && dropElement) {
|
|
509
|
-
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
510
|
-
if (isCorrect) {
|
|
511
|
-
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
512
|
-
if (onCorrect) {
|
|
513
|
-
await executeActions(onCorrect, dropElement, dragElement);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
else {
|
|
517
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
518
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
514
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
522
515
|
allElements.forEach(otherElement => {
|
|
523
516
|
var _a;
|
|
@@ -607,6 +600,7 @@ export const validateObjectiveStatus = async () => {
|
|
|
607
600
|
return;
|
|
608
601
|
const objectiveString = container['objective'];
|
|
609
602
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
603
|
+
const isAllowOnlyCorrect = container.getAttribute('isAllowOnlyCorrect') === 'true' || '';
|
|
610
604
|
console.log('🚀 ~ validateObjectiveStatus ~ additionalCheck:', additionalCheck);
|
|
611
605
|
let equationGiven = false;
|
|
612
606
|
if (objectiveString == null || objectiveString.length === 0) {
|
|
@@ -658,13 +652,15 @@ export const validateObjectiveStatus = async () => {
|
|
|
658
652
|
await calculateScore();
|
|
659
653
|
}
|
|
660
654
|
else {
|
|
661
|
-
const onInCorrect = container.getAttribute('onInCorrect');
|
|
662
|
-
await executeActions(onInCorrect, container);
|
|
663
655
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
664
656
|
if (!isContinueOnCorrect) {
|
|
665
657
|
triggerNextContainer();
|
|
666
658
|
await calculateScore();
|
|
667
659
|
}
|
|
660
|
+
else {
|
|
661
|
+
const onInCorrect = container.getAttribute('onInCorrect');
|
|
662
|
+
await executeActions(onInCorrect, container);
|
|
663
|
+
}
|
|
668
664
|
}
|
|
669
665
|
};
|
|
670
666
|
export const triggerNextContainer = () => {
|
|
@@ -1229,14 +1225,14 @@ export const SumTogetherAnimation = async (element, value) => {
|
|
|
1229
1225
|
const sign = ((signElement && ((signElement.getAttribute('string') || signElement.textContent) || '')).toString().trim() === '+') ? '+' : '-';
|
|
1230
1226
|
if (sign === '-') {
|
|
1231
1227
|
// '-' flow: reveal one by one then change bgColor of last B to red
|
|
1232
|
-
for (let i = 0; i < topRowChildren.length; i++) {
|
|
1228
|
+
for (let i = 0; i < Math.min(number1, topRowChildren.length); i++) {
|
|
1233
1229
|
await new Promise(resolve => setTimeout(resolve, 75));
|
|
1234
1230
|
showElement(topRowChildren[i]);
|
|
1235
1231
|
}
|
|
1236
1232
|
elementAppearance(true);
|
|
1237
1233
|
await new Promise(r => setTimeout(r, 500));
|
|
1238
1234
|
for (let k = 0; k < Math.min(number2, topRowChildren.length); k++) {
|
|
1239
|
-
const idx = topRowChildren.length - 1 - k;
|
|
1235
|
+
const idx = Math.min(number1, topRowChildren.length) - 1 - k;
|
|
1240
1236
|
setImageBackground(topRowChildren[idx], 'red');
|
|
1241
1237
|
await new Promise(r => setTimeout(r, 200));
|
|
1242
1238
|
}
|
|
@@ -1261,3 +1257,14 @@ export const SumTogetherAnimation = async (element, value) => {
|
|
|
1261
1257
|
elementAppearance(false);
|
|
1262
1258
|
}
|
|
1263
1259
|
};
|
|
1260
|
+
export const updatedAnswer = () => {
|
|
1261
|
+
const container = document.getElementById(LidoContainer);
|
|
1262
|
+
if (!container)
|
|
1263
|
+
return;
|
|
1264
|
+
const answerText = container.querySelector('#answer');
|
|
1265
|
+
if (!answerText)
|
|
1266
|
+
return;
|
|
1267
|
+
const equationAttr = container.getAttribute('equationCheck') || '';
|
|
1268
|
+
const calculatedValue = equationCheck(equationAttr);
|
|
1269
|
+
answerText.setAttribute('string', String(calculatedValue));
|
|
1270
|
+
};
|
|
@@ -64,7 +64,11 @@ export function addClickListenerForClickType(element) {
|
|
|
64
64
|
if (lido_buttons === 'lido-arrow-left' || lido_buttons === 'lido-arrow-right') {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
const audioAttr = element.getAttribute('audio');
|
|
68
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
69
|
+
if (hasValidAudio) {
|
|
70
|
+
AudioPlayer.getI().stop();
|
|
71
|
+
}
|
|
68
72
|
const container = document.getElementById(LidoContainer);
|
|
69
73
|
const objective = container['objective'].split(',');
|
|
70
74
|
const checkButton = document.querySelector('#lido-checkButton');
|
|
@@ -44,6 +44,7 @@ export function enableOptionArea(element) {
|
|
|
44
44
|
}
|
|
45
45
|
let isDraggingDisabled = false;
|
|
46
46
|
export const setDraggingDisabled = (disabled) => {
|
|
47
|
+
console.log("Setting dragging disabled to:", disabled);
|
|
47
48
|
isDraggingDisabled = disabled;
|
|
48
49
|
};
|
|
49
50
|
export const getDraggingDisabled = () => isDraggingDisabled;
|
|
@@ -534,6 +535,9 @@ export async function onElementDropComplete(dragElement, dropElement) {
|
|
|
534
535
|
const localStorageKey = `${LidoContainer}_dropData`;
|
|
535
536
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
536
537
|
animateDragToTarget(dragElement, dropElement, container);
|
|
538
|
+
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
539
|
+
console.log("onincorrectttt", onInCorrect);
|
|
540
|
+
await executeActions(onInCorrect, dropElement, dragElement);
|
|
537
541
|
setTimeout(() => {
|
|
538
542
|
dragElement.style.transform = 'translate(0, 0)';
|
|
539
543
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
@@ -805,14 +809,14 @@ export async function onClickDropOrDragElement(element, type) {
|
|
|
805
809
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
806
810
|
const style = document.createElement('style');
|
|
807
811
|
style.id = 'dynamic-highlight-style';
|
|
808
|
-
style.innerHTML = `
|
|
809
|
-
.highlight {
|
|
810
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
811
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
812
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
813
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
814
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
815
|
-
}
|
|
812
|
+
style.innerHTML = `
|
|
813
|
+
.highlight {
|
|
814
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
815
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
816
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
817
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
818
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
819
|
+
}
|
|
816
820
|
`;
|
|
817
821
|
document.head.appendChild(style);
|
|
818
822
|
}
|
|
@@ -854,7 +858,11 @@ export async function onClickDropOrDragElement(element, type) {
|
|
|
854
858
|
}
|
|
855
859
|
export const dragToDropMap = new Map();
|
|
856
860
|
async function onClickDragElement(element) {
|
|
857
|
-
|
|
861
|
+
const audioAttr = element.getAttribute('audio');
|
|
862
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
863
|
+
if (hasValidAudio) {
|
|
864
|
+
AudioPlayer.getI().stop();
|
|
865
|
+
}
|
|
858
866
|
const dropElements = buildDropHasDragFromDOM();
|
|
859
867
|
const dragEl = element;
|
|
860
868
|
if (!dragEl) {
|