lido-player 0.0.2-beta-24 → 0.0.2-beta-26-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/{decode-BCvdWRyT.js → decode-CE64w_Pc.js} +1 -1
- package/dist/cjs/{index-DjM03fsg.js → index-Cf9LHdIw.js} +238 -87
- package/dist/cjs/{index-DBCFoh1I.js → index-DnaH8sO-.js} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/lido-avatar_22.cjs.entry.js +214 -53
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/avatar/lido-avatar.tsx +214 -214
- package/dist/collection/components/avatar/readme.md +49 -49
- package/dist/collection/components/calculator/lido-calculator.css +89 -89
- package/dist/collection/components/calculator/lido-calculator.js +2 -2
- package/dist/collection/components/canvas/lido-canvas.css +33 -33
- package/dist/collection/components/canvas/lido-canvas.js +1 -1
- 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 +34 -10
- package/dist/collection/components/container/lido-container.js +55 -9
- package/dist/collection/components/flashCard/lido-flash-card.css +72 -72
- package/dist/collection/components/flashCard/lido-flash-card.js +84 -15
- 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 +309 -309
- package/dist/collection/components/home/lido-home.js +38 -14
- 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 +1 -1
- 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 +6 -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/assets/Shadow.svg +9 -9
- package/dist/collection/components/scale/lido-balance.css +174 -174
- package/dist/collection/components/scale/lido-balance.js +13 -13
- package/dist/collection/components/shape/lido-shape.css +216 -216
- package/dist/collection/components/shape/lido-shape.js +6 -6
- 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 -6
- package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
- 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 +211 -211
- package/dist/collection/css/index.css +323 -323
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +59 -59
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
- 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 +29 -29
- 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 +43 -43
- 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/imageMatch/imageMatch.stories.js +44 -44
- 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 +84 -84
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
- 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 +57 -57
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
- package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
- package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
- package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
- package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
- package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
- package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
- package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
- package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
- package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
- package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
- 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 +58 -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/quizMaths/quizMaths.stories.js +633 -633
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
- package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
- 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/substraction/substractionWithimg.stories.js +62 -62
- package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
- package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
- package/dist/collection/stories/Templates/total/total.stories.js +28 -28
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
- 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 +10 -3
- package/dist/collection/utils/constants.js +6 -0
- package/dist/collection/utils/utils.js +109 -14
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +8 -8
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/slideHandler.js +58 -19
- 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.js +1 -1
- 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 +1 -1
- 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-B4iWvszS.js +1 -0
- package/dist/components/{p-C5jvgiPE.js → p-BA-XmR9g.js} +1 -1
- package/dist/components/p-BJt-z8VW.js +1 -0
- package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
- package/dist/components/{p-DNo3iX_r.js → p-BiBt9LGP.js} +1 -1
- package/dist/components/{p-DG0KR2iN.js → p-BlN0IsR4.js} +1 -1
- package/dist/components/{p-CFPSty2U.js → p-BpVpANK9.js} +1 -1
- package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
- package/dist/components/p-C2J7-bcH.js +1 -0
- package/dist/components/{p-CFWohOId.js → p-CEmofYPx.js} +1 -1
- package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
- package/dist/components/{p-CsDu4kiC.js → p-ChfVUoX4.js} +1 -1
- package/dist/components/p-CnQ-4EIw.js +1 -0
- package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
- package/dist/components/{p-C-pHQRbp.js → p-D1cBkIab.js} +1 -1
- package/dist/components/p-DP6jQ5ML.js +1 -0
- package/dist/components/{p-Bv1hunWk.js → p-DV-k1ulI.js} +1 -1
- package/dist/components/p-Qhj9-H6e.js +12 -0
- package/dist/components/{p-Bh_vemY3.js → p-hUfX1As2.js} +1 -1
- package/dist/components/p-leIEepjl.js +1 -0
- package/dist/components/{p-B8nzzM8c.js → p-s4oGlKg6.js} +1 -1
- package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
- package/dist/esm/{decode-BxzUG5XP.js → decode-DhjaTUf2.js} +1 -1
- package/dist/esm/{index-C_uxZLF-.js → index-Bc6Y7rds.js} +235 -88
- package/dist/esm/{index-mMpK8062.js → index-Dvjbti-h.js} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +214 -53
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/lido-player/assets/Shadow.svg +9 -9
- package/dist/lido-player/assets/Tracing-hand.svg +8 -8
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-avatar.css +4 -4
- package/dist/lido-player/lido-avatar.tsx +214 -214
- package/dist/lido-player/lido-player.css +7 -7
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-CsCr7DlS.js → p-CORilAH-.js} +1 -1
- package/dist/lido-player/p-D66K5DXn.js +1 -0
- package/dist/lido-player/p-Dvjbti-h.js +2 -0
- package/dist/lido-player/p-ca195982.entry.js +12 -0
- package/dist/lido-player/readme.md +49 -49
- package/dist/types/components/container/lido-container.d.ts +7 -0
- package/dist/types/components/flashCard/lido-flash-card.d.ts +2 -0
- package/dist/types/components.d.ts +1 -0
- package/dist/types/types/json.d.ts +3 -3
- package/dist/types/utils/audioPlayer.d.ts +1 -1
- package/dist/types/utils/constants.d.ts +2 -0
- package/dist/types/utils/utils.d.ts +11 -0
- package/dist/types/utils/utilsHandlers/slideHandler.d.ts +1 -1
- package/package.json +73 -73
- package/readme.md +113 -113
- package/dist/components/p-CgBwmr9A.js +0 -12
- package/dist/components/p-Ckb8QhUV.js +0 -1
- package/dist/components/p-DDwqmTYM.js +0 -1
- package/dist/components/p-DLyacZap.js +0 -1
- package/dist/components/p-DONbWJGn.js +0 -1
- package/dist/components/p-DXy70SGv.js +0 -1
- package/dist/components/p-Gwko4CTL.js +0 -1
- package/dist/lido-player/p-00993d1a.entry.js +0 -12
- package/dist/lido-player/p-mMpK8062.js +0 -2
- package/dist/lido-player/p-v3GBrpv9.js +0 -1
|
@@ -8,32 +8,32 @@ export function showWrongAnswerAnimation(elements) {
|
|
|
8
8
|
if (!document.querySelector(styleId)) {
|
|
9
9
|
const style = document.createElement('style');
|
|
10
10
|
style.id = styleId;
|
|
11
|
-
style.innerHTML = `
|
|
12
|
-
@keyframes enhanced-shake {
|
|
13
|
-
0% { left: 0; }
|
|
14
|
-
10% { left: -8px; }
|
|
15
|
-
20% { left: 8px; }
|
|
16
|
-
30% { left: -8px; }
|
|
17
|
-
40% { left: 8px; }
|
|
18
|
-
50% { left: -6px; }
|
|
19
|
-
60% { left: 6px; }
|
|
20
|
-
70% { left: -4px; }
|
|
21
|
-
80% { left: 4px; }
|
|
22
|
-
90% { left: -2px; }
|
|
23
|
-
100% { left: 0; }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
.wrong-answer {
|
|
28
|
-
position: relative; /* Enable relative positioning to move the element */
|
|
29
|
-
animation: enhanced-shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
|
|
30
|
-
background-color: #ffdddd; /* Flash red background to indicate wrong answer */
|
|
31
|
-
box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); /* Subtle red shadow */
|
|
32
|
-
|
|
33
|
-
border: 4px solid red;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
style.innerHTML = `
|
|
12
|
+
@keyframes enhanced-shake {
|
|
13
|
+
0% { left: 0; }
|
|
14
|
+
10% { left: -8px; }
|
|
15
|
+
20% { left: 8px; }
|
|
16
|
+
30% { left: -8px; }
|
|
17
|
+
40% { left: 8px; }
|
|
18
|
+
50% { left: -6px; }
|
|
19
|
+
60% { left: 6px; }
|
|
20
|
+
70% { left: -4px; }
|
|
21
|
+
80% { left: 4px; }
|
|
22
|
+
90% { left: -2px; }
|
|
23
|
+
100% { left: 0; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
.wrong-answer {
|
|
28
|
+
position: relative; /* Enable relative positioning to move the element */
|
|
29
|
+
animation: enhanced-shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
|
|
30
|
+
background-color: #ffdddd; /* Flash red background to indicate wrong answer */
|
|
31
|
+
box-shadow: 0 0 10px rgba(255, 0, 0, 0.5); /* Subtle red shadow */
|
|
32
|
+
|
|
33
|
+
border: 4px solid red;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
37
|
`;
|
|
38
38
|
document.head.appendChild(style);
|
|
39
39
|
}
|
|
@@ -61,34 +61,34 @@ export function highlightSpeakingElement(element) {
|
|
|
61
61
|
if (!document.getElementById(styleId)) {
|
|
62
62
|
const style = document.createElement('style');
|
|
63
63
|
style.id = styleId;
|
|
64
|
-
style.innerHTML = `
|
|
65
|
-
.speaking-highlight {
|
|
66
|
-
--base-transform: ${element.style.transform};
|
|
67
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
68
|
-
// border: 3px solid green !important;
|
|
69
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
70
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
71
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@keyframes pulseEffect {
|
|
76
|
-
0% {
|
|
77
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
78
|
-
// transform: var(--base-transform) scale(1.05);
|
|
79
|
-
// background-color: #FFFF0B;
|
|
80
|
-
}
|
|
81
|
-
50% {
|
|
82
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
83
|
-
// transform: var(--base-transform) scale(1.1);
|
|
84
|
-
// background-color: #FFFF0B;
|
|
85
|
-
}
|
|
86
|
-
100% {
|
|
87
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
88
|
-
// transform: var(--base-transform) scale(1.05);
|
|
89
|
-
// background-color: #FFFF0B;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
64
|
+
style.innerHTML = `
|
|
65
|
+
.speaking-highlight {
|
|
66
|
+
--base-transform: ${element.style.transform};
|
|
67
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
68
|
+
// border: 3px solid green !important;
|
|
69
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
70
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
71
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@keyframes pulseEffect {
|
|
76
|
+
0% {
|
|
77
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
78
|
+
// transform: var(--base-transform) scale(1.05);
|
|
79
|
+
// background-color: #FFFF0B;
|
|
80
|
+
}
|
|
81
|
+
50% {
|
|
82
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
83
|
+
// transform: var(--base-transform) scale(1.1);
|
|
84
|
+
// background-color: #FFFF0B;
|
|
85
|
+
}
|
|
86
|
+
100% {
|
|
87
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
88
|
+
// transform: var(--base-transform) scale(1.05);
|
|
89
|
+
// background-color: #FFFF0B;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
92
|
`;
|
|
93
93
|
document.head.appendChild(style);
|
|
94
94
|
}
|
|
@@ -160,6 +160,7 @@ export function slidingWithScaling(element) {
|
|
|
160
160
|
};
|
|
161
161
|
// Start observing the element
|
|
162
162
|
observer.observe(parentElement, observerConfig);
|
|
163
|
+
let mostOverlappedElement;
|
|
163
164
|
const onMove = (event) => {
|
|
164
165
|
if (!isDragging)
|
|
165
166
|
return;
|
|
@@ -180,12 +181,14 @@ export function slidingWithScaling(element) {
|
|
|
180
181
|
// Get the dimensions and scale-corrected position of the container and element
|
|
181
182
|
const containerRect = parentElement.getBoundingClientRect();
|
|
182
183
|
const elementRect = element.getBoundingClientRect();
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const
|
|
188
|
-
const
|
|
184
|
+
// Firefox serializes translate(x, 0) as translate(x), so parsing the
|
|
185
|
+
// inline string can lose Y and produce NaN. Read the computed matrix instead.
|
|
186
|
+
const transform = window.getComputedStyle(element).transform;
|
|
187
|
+
const translation = new DOMMatrixReadOnly(transform === 'none' ? undefined : transform);
|
|
188
|
+
const initialElementLeftPx = elementRect.left / parentElementScale - translation.m41;
|
|
189
|
+
const initialElementTopPx = elementRect.top - translation.m42;
|
|
190
|
+
const initialElementRightPx = elementRect.right / parentElementScale - translation.m41;
|
|
191
|
+
const initialElementBottomPx = elementRect.bottom - translation.m42;
|
|
189
192
|
const maxRight = containerRect.right - initialElementRightPx;
|
|
190
193
|
const maxLeft = containerRect.left - initialElementLeftPx;
|
|
191
194
|
const maxTop = containerRect.top - initialElementTopPx;
|
|
@@ -195,7 +198,7 @@ export function slidingWithScaling(element) {
|
|
|
195
198
|
// Apply transform with translation within boundaries
|
|
196
199
|
element.style.transform = `translate(${newLeftClamp}px, ${newTopClamp}px)`;
|
|
197
200
|
// Check for overlaps and highlight only the most overlapping element
|
|
198
|
-
|
|
201
|
+
mostOverlappedElement = findMostoverlappedElement(element, 'slide');
|
|
199
202
|
// Apply styles only to the most overlapped element
|
|
200
203
|
if (mostOverlappedElement) {
|
|
201
204
|
if (mostOverlappedElement != element) {
|
|
@@ -256,6 +259,7 @@ export function slidingWithScaling(element) {
|
|
|
256
259
|
setTimeout(() => {
|
|
257
260
|
if (overlapElement) {
|
|
258
261
|
void slideCompleted(element);
|
|
262
|
+
updateReorderCorrectness(container, element, mostOverlappedElement);
|
|
259
263
|
overlapElement = false;
|
|
260
264
|
}
|
|
261
265
|
}, 300);
|
|
@@ -298,18 +302,50 @@ export const isArrangeLettersComplete = (slideValues, objectiveString) => {
|
|
|
298
302
|
return slideValues.length === objectiveValues.length
|
|
299
303
|
&& slideValues.every((value, index) => value === objectiveValues[index]);
|
|
300
304
|
};
|
|
301
|
-
export const updateReorderCorrectness = (container,
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
305
|
+
export const updateReorderCorrectness = (container, slideElement, overlappedElement) => {
|
|
306
|
+
const allSlideElements = Array.from(container.querySelectorAll('[type="slide"]'));
|
|
307
|
+
const elementIndex = allSlideElements.indexOf(slideElement);
|
|
308
|
+
const overlappedElementIndex = allSlideElements.indexOf(overlappedElement);
|
|
309
|
+
const objectiveString = document.getElementById(LidoContainer)['objective'];
|
|
310
|
+
const objectiveArray = objectiveString.split(',');
|
|
311
|
+
const slideValues = getSlideValuesForValidation(container, allSlideElements);
|
|
312
|
+
const isCorrect = elementIndex >= 0 && elementIndex < objectiveArray.length
|
|
313
|
+
? matchStringPattern(slideValues[elementIndex], [objectiveArray[elementIndex].trim()])
|
|
314
|
+
: false;
|
|
315
|
+
const isCorrectOverlap = overlappedElementIndex >= 0 && overlappedElementIndex < objectiveArray.length
|
|
316
|
+
? matchStringPattern(slideValues[overlappedElementIndex], [objectiveArray[overlappedElementIndex].trim()])
|
|
317
|
+
: false;
|
|
318
|
+
if (isCorrect && isCorrectOverlap) {
|
|
319
|
+
updateElementCategoryClass(slideElement, true);
|
|
320
|
+
updateElementCategoryClass(overlappedElement, true);
|
|
321
|
+
}
|
|
322
|
+
else if (isCorrect) {
|
|
323
|
+
updateElementCategoryClass(slideElement, true);
|
|
324
|
+
updateElementCategoryClass(overlappedElement, false);
|
|
325
|
+
}
|
|
326
|
+
else if (isCorrectOverlap) {
|
|
327
|
+
updateElementCategoryClass(slideElement, false);
|
|
328
|
+
updateElementCategoryClass(overlappedElement, true);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
updateElementCategoryClass(slideElement, false);
|
|
332
|
+
updateElementCategoryClass(overlappedElement, false);
|
|
333
|
+
}
|
|
312
334
|
};
|
|
335
|
+
function updateElementCategoryClass(element, isCorrect) {
|
|
336
|
+
if (!element)
|
|
337
|
+
return;
|
|
338
|
+
const correctClass = 'category-dropped-onCorrect';
|
|
339
|
+
const incorrectClass = 'category-dropped-onInCorrect';
|
|
340
|
+
if (isCorrect) {
|
|
341
|
+
element.classList.add(correctClass);
|
|
342
|
+
element.classList.remove(incorrectClass);
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
element.classList.add(incorrectClass);
|
|
346
|
+
element.classList.remove(correctClass);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
313
349
|
export const isReorderComplete = (slideValues, objectiveString) => {
|
|
314
350
|
if (!objectiveString)
|
|
315
351
|
return false;
|
|
@@ -337,7 +373,10 @@ const slideCompleted = async (slideElement) => {
|
|
|
337
373
|
updateArrangeLettersCorrectness(container, slideValues, objectiveArray);
|
|
338
374
|
}
|
|
339
375
|
else if (isReorderContainer(container)) {
|
|
340
|
-
|
|
376
|
+
if (isReorderComplete(slideValues, objectiveString)) {
|
|
377
|
+
allSlideElements.forEach(item => updateElementCategoryClass(item, true));
|
|
378
|
+
}
|
|
379
|
+
// updateReorderCorrectness(container, slideValues, objectiveArray);
|
|
341
380
|
}
|
|
342
381
|
if (container.getAttribute('is-continue-on-correct') === 'true') {
|
|
343
382
|
storingEachActivityScore(true);
|
|
@@ -163,11 +163,11 @@ export function enableReorderDrag(element) {
|
|
|
163
163
|
onDropToCategory(element, category);
|
|
164
164
|
}
|
|
165
165
|
if (divEl) {
|
|
166
|
-
const keyframes = `
|
|
167
|
-
@keyframes widthDecrease {
|
|
168
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
169
|
-
100% { width: 0px; height: 0px;}
|
|
170
|
-
}
|
|
166
|
+
const keyframes = `
|
|
167
|
+
@keyframes widthDecrease {
|
|
168
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
169
|
+
100% { width: 0px; height: 0px;}
|
|
170
|
+
}
|
|
171
171
|
`;
|
|
172
172
|
const styleSheet = document.styleSheets[0];
|
|
173
173
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -390,11 +390,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
390
390
|
const dummy = createDummyElement(target);
|
|
391
391
|
dummy.style.visibility = 'hidden';
|
|
392
392
|
dummy.setAttribute('type', 'dummy');
|
|
393
|
-
const keyframes = `
|
|
394
|
-
@keyframes widthIncrease {
|
|
395
|
-
0% { width: 0px; height: 0px; }
|
|
396
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
397
|
-
}
|
|
393
|
+
const keyframes = `
|
|
394
|
+
@keyframes widthIncrease {
|
|
395
|
+
0% { width: 0px; height: 0px; }
|
|
396
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
397
|
+
}
|
|
398
398
|
`;
|
|
399
399
|
if (!overlapped) {
|
|
400
400
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|