lido-player 0.0.2-alpha-50-dev → 0.0.2-alpha-52-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-ce99b0d0.js} +294 -108
- 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 +35 -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 +69 -15
- 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/blender/blender.stories.js +100 -0
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +52 -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 +39 -38
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +37 -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 +25 -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 +41 -39
- 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 +98 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +92 -91
- 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 +170 -36
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +27 -15
- 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-9be56729.js → p-00777872.js} +46 -2
- package/dist/components/{p-3f406017.js → p-06171259.js} +2 -2
- package/dist/components/{p-08d0deab.js → p-09f1e2d2.js} +15 -9
- package/dist/components/{p-e4e42677.js → p-0c2aebfb.js} +2 -2
- package/dist/components/p-0fbeb3a1.js +2700 -0
- package/dist/components/{p-cbac3cbc.js → p-11bf64aa.js} +2 -2
- package/dist/components/{p-44808985.js → p-26df0769.js} +7 -7
- package/dist/components/{p-1fbdb431.js → p-2d53e1a5.js} +2 -2
- package/dist/components/{p-afbc196f.js → p-39a2e638.js} +3 -2
- package/dist/components/{p-e36ddcc1.js → p-3ce3744c.js} +14 -11
- package/dist/components/{p-7f7e5672.js → p-3f4d4c0a.js} +2 -2
- package/dist/components/{p-d37ab4dc.js → p-52e77394.js} +2 -2
- package/dist/components/{p-bed94c37.js → p-58c67252.js} +331 -118
- package/dist/components/p-5b5f59a8.js +129 -0
- package/dist/components/{p-52844fa4.js → p-68112f8c.js} +2 -2
- package/dist/components/{p-15971ede.js → p-8a34b98b.js} +1 -1
- package/dist/components/{p-904711c8.js → p-8f2ed62f.js} +2 -2
- package/dist/components/{p-74849cdd.js → p-9d34d59d.js} +4 -4
- package/dist/components/{p-73e31a86.js → p-a2f96840.js} +8 -8
- package/dist/components/{p-90465904.js → p-a516a324.js} +2 -2
- package/dist/components/{p-322acda6.js → p-b2125fc9.js} +67 -31
- package/dist/components/{p-835b973d.js → p-c4abfd0f.js} +2 -2
- package/dist/components/{p-29bdd953.js → p-cb56a853.js} +2 -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-107b15a7.js} +294 -108
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-606ea279.entry.js +1 -0
- package/dist/lido-player/p-9a9d5339.js +2 -0
- package/dist/lido-player/{p-7556e652.js → p-d1251482.js} +2 -2
- 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 -1
- package/dist/types/components/root/lido-root.d.ts +5 -0
- package/dist/types/components.d.ts +71 -6
- package/dist/types/stories/Templates/RocketGame/rocketGame.stories.d.ts +1 -0
- package/dist/types/stories/Templates/blender/blender.stories.d.ts +4 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index$1 = require('./index-
|
|
3
|
+
const index$1 = require('./index-baff5c15.js');
|
|
4
4
|
|
|
5
5
|
const DragMapKey = 'lidoDragMap';
|
|
6
6
|
const SelectedValuesKey = 'lidoSelectedValues';
|
|
@@ -116,34 +116,34 @@ function highlightSpeakingElement(element) {
|
|
|
116
116
|
if (!document.querySelector(styleId)) {
|
|
117
117
|
const style = document.createElement('style');
|
|
118
118
|
style.id = styleId;
|
|
119
|
-
style.innerHTML = `
|
|
120
|
-
.speaking-highlight {
|
|
121
|
-
--base-transform: ${element.style.transform};
|
|
122
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
123
|
-
// border: 3px solid green !important;
|
|
124
|
-
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
125
|
-
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
126
|
-
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
@keyframes pulseEffect {
|
|
131
|
-
0% {
|
|
132
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
133
|
-
// transform: var(--base-transform) scale(1.05);
|
|
134
|
-
// background-color: #FFFF0B;
|
|
135
|
-
}
|
|
136
|
-
50% {
|
|
137
|
-
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
138
|
-
// transform: var(--base-transform) scale(1.1);
|
|
139
|
-
// background-color: #FFFF0B;
|
|
140
|
-
}
|
|
141
|
-
100% {
|
|
142
|
-
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
143
|
-
// transform: var(--base-transform) scale(1.05);
|
|
144
|
-
// background-color: #FFFF0B;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
119
|
+
style.innerHTML = `
|
|
120
|
+
.speaking-highlight {
|
|
121
|
+
--base-transform: ${element.style.transform};
|
|
122
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9) !important; /* Stronger orange glow effect */
|
|
123
|
+
// border: 3px solid green !important;
|
|
124
|
+
// transition: box-shadow 0.5s ease-in-out, transform 0.5s ease-in-out;
|
|
125
|
+
// transform: scale(1.05); /* Subtle scale effect to pop the element */
|
|
126
|
+
// animation: pulseEffect 1.5s infinite; /* Pulsing animation */
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
@keyframes pulseEffect {
|
|
131
|
+
0% {
|
|
132
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
133
|
+
// transform: var(--base-transform) scale(1.05);
|
|
134
|
+
// background-color: #FFFF0B;
|
|
135
|
+
}
|
|
136
|
+
50% {
|
|
137
|
+
box-shadow: 0 0 30px 15px rgba(255, 165, 0, 1);
|
|
138
|
+
// transform: var(--base-transform) scale(1.1);
|
|
139
|
+
// background-color: #FFFF0B;
|
|
140
|
+
}
|
|
141
|
+
100% {
|
|
142
|
+
box-shadow: 0 0 20px 10px rgba(255, 165, 0, 0.9);
|
|
143
|
+
// transform: var(--base-transform) scale(1.05);
|
|
144
|
+
// background-color: #FFFF0B;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
147
|
`;
|
|
148
148
|
document.head.appendChild(style);
|
|
149
149
|
}
|
|
@@ -215,8 +215,8 @@ function balanceResult(container, objectiveString) {
|
|
|
215
215
|
return false;
|
|
216
216
|
const leftVal = Number((_c = (_a = balanceEl.leftVal) !== null && _a !== void 0 ? _a : (_b = balanceEl.dataset) === null || _b === void 0 ? void 0 : _b.leftVal) !== null && _c !== void 0 ? _c : 0);
|
|
217
217
|
const rightVal = Number((_f = (_d = balanceEl.rightVal) !== null && _d !== void 0 ? _d : (_e = balanceEl.dataset) === null || _e === void 0 ? void 0 : _e.rightVal) !== null && _f !== void 0 ? _f : 0);
|
|
218
|
-
const hasLeft = !isNaN(leftVal)
|
|
219
|
-
const hasRight = !isNaN(rightVal)
|
|
218
|
+
const hasLeft = !isNaN(leftVal);
|
|
219
|
+
const hasRight = !isNaN(rightVal);
|
|
220
220
|
if (!hasLeft || !hasRight) {
|
|
221
221
|
return false;
|
|
222
222
|
}
|
|
@@ -266,6 +266,7 @@ function enableOptionArea(element) {
|
|
|
266
266
|
}
|
|
267
267
|
let isDraggingDisabled = false;
|
|
268
268
|
const setDraggingDisabled = (disabled) => {
|
|
269
|
+
console.log("Setting dragging disabled to:", disabled);
|
|
269
270
|
isDraggingDisabled = disabled;
|
|
270
271
|
};
|
|
271
272
|
function enableDraggingWithScaling(element) {
|
|
@@ -455,7 +456,9 @@ function enableDraggingWithScaling(element) {
|
|
|
455
456
|
mostOverlappedElement.style.backgroundColor = 'rgba(255, 0, 0, 0.1)'; // Light red background
|
|
456
457
|
}
|
|
457
458
|
else {
|
|
458
|
-
|
|
459
|
+
if (!document.getElementById('unitsDrop') || !document.getElementById('tensDrop') || !document.getElementById('hundredsDrop')) {
|
|
460
|
+
mostOverlappedElement.style.opacity = '0.3';
|
|
461
|
+
}
|
|
459
462
|
}
|
|
460
463
|
}
|
|
461
464
|
};
|
|
@@ -510,6 +513,7 @@ function enableDraggingWithScaling(element) {
|
|
|
510
513
|
// Check for overlaps and log the most overlapping element
|
|
511
514
|
let mostOverlappedElement = findMostoverlappedElement$1(element, 'drop');
|
|
512
515
|
onElementDropComplete(element, mostOverlappedElement);
|
|
516
|
+
executeActions("this.updateCountBlender='true'", container);
|
|
513
517
|
if (((_a = element.getAttribute('dropAttr')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === DropMode.Diagonal) {
|
|
514
518
|
if (mostOverlappedElement) {
|
|
515
519
|
if (element) {
|
|
@@ -711,10 +715,10 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
711
715
|
let dropHasDrag = buildDropHasDragFromDOM();
|
|
712
716
|
if (!dropElement) {
|
|
713
717
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
714
|
-
return;
|
|
715
718
|
}
|
|
716
719
|
const dropTabIndex = dropElement.getAttribute('tab-index');
|
|
717
|
-
|
|
720
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'false';
|
|
721
|
+
if (((_b = dropHasDrag[dropTabIndex]) === null || _b === void 0 ? void 0 : _b.isFull) && !isAllowOnlyOneDrop) {
|
|
718
722
|
handleResetDragElement(dragElement, dropElement, dropHasDrag, selectedValueData, dragSelectedData);
|
|
719
723
|
return;
|
|
720
724
|
}
|
|
@@ -748,6 +752,9 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
748
752
|
if (!isCorrect) {
|
|
749
753
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
750
754
|
animateDragToTarget(dragElement, dropElement, container);
|
|
755
|
+
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
756
|
+
console.log("onincorrectttt", onInCorrect);
|
|
757
|
+
await executeActions(onInCorrect, dropElement, dragElement);
|
|
751
758
|
setTimeout(() => {
|
|
752
759
|
dragElement.style.transform = 'translate(0, 0)';
|
|
753
760
|
// const oldDropIndex = dragToDropMap[dragElement.getAttribute('data-id')];
|
|
@@ -847,7 +854,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
847
854
|
}
|
|
848
855
|
if (!(((_f = dropElement.getAttribute('dropAttr')) === null || _f === void 0 ? void 0 : _f.toLowerCase()) === DropMode.Diagonal) && (dropElement.getAttribute('minDrops') === '1' || !dropElement.getAttribute('minDrops'))) {
|
|
849
856
|
const isisFull = Object.values(dropHasDrag).find(item => document.getElementById(item.drop) === dropElement);
|
|
850
|
-
|
|
857
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
858
|
+
if (isAllowOnlyOneDrop && isisFull) {
|
|
851
859
|
isisFull.isFull = true;
|
|
852
860
|
dropElement.setAttribute('is-full', 'true');
|
|
853
861
|
}
|
|
@@ -882,8 +890,8 @@ async function onElementDropComplete(dragElement, dropElement) {
|
|
|
882
890
|
// Check for overlaps and highlight only the most overlapping element
|
|
883
891
|
if (dropElement && !((_g = dropHasDrag[dropTabIndex]) === null || _g === void 0 ? void 0 : _g.isFull)) {
|
|
884
892
|
let mostOverlappedElement = findMostoverlappedElement$1(dragElement, 'drag');
|
|
885
|
-
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true'
|
|
886
|
-
if (
|
|
893
|
+
const isAllowOnlyOneDrop = dropElement.getAttribute('is-allow-only-one-drop') === 'true';
|
|
894
|
+
if (isAllowOnlyOneDrop && mostOverlappedElement) {
|
|
887
895
|
dragElement.style.transform = 'translate(0,0)';
|
|
888
896
|
dragElement.style.transition = 'transform 0.5s ease';
|
|
889
897
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
@@ -1016,14 +1024,14 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1016
1024
|
if (!document.querySelector('#dynamic-highlight-style')) {
|
|
1017
1025
|
const style = document.createElement('style');
|
|
1018
1026
|
style.id = 'dynamic-highlight-style';
|
|
1019
|
-
style.innerHTML = `
|
|
1020
|
-
.highlight {
|
|
1021
|
-
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1022
|
-
// border-radius: 12px; /* Larger rounded corners */
|
|
1023
|
-
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1024
|
-
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1025
|
-
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1026
|
-
}
|
|
1027
|
+
style.innerHTML = `
|
|
1028
|
+
.highlight {
|
|
1029
|
+
// border: 4px solid #e74c3c; /* Thicker red border for more visibility */
|
|
1030
|
+
// border-radius: 12px; /* Larger rounded corners */
|
|
1031
|
+
// background-color: rgba(231, 76, 60, 0.3); /* Stronger, more noticeable background */
|
|
1032
|
+
// box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 12px 40px rgba(0, 0, 0, 0.2); /* Stronger shadow */
|
|
1033
|
+
// outline: 4px solid rgba(231, 76, 60, 0.6); /* Glow effect */
|
|
1034
|
+
}
|
|
1027
1035
|
`;
|
|
1028
1036
|
document.head.appendChild(style);
|
|
1029
1037
|
}
|
|
@@ -1065,7 +1073,11 @@ async function onClickDropOrDragElement(element, type) {
|
|
|
1065
1073
|
}
|
|
1066
1074
|
const dragToDropMap = new Map();
|
|
1067
1075
|
async function onClickDragElement(element) {
|
|
1068
|
-
|
|
1076
|
+
const audioAttr = element.getAttribute('audio');
|
|
1077
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
1078
|
+
if (hasValidAudio) {
|
|
1079
|
+
AudioPlayer.getI().stop();
|
|
1080
|
+
}
|
|
1069
1081
|
const dropElements = buildDropHasDragFromDOM();
|
|
1070
1082
|
const dragEl = element;
|
|
1071
1083
|
if (!dragEl) {
|
|
@@ -1140,6 +1152,7 @@ class AudioPlayer {
|
|
|
1140
1152
|
this.audioElement = document.createElement('audio');
|
|
1141
1153
|
this.audioElement.id = 'audio';
|
|
1142
1154
|
document.body.appendChild(this.audioElement);
|
|
1155
|
+
this.registerGlobalStopEvents();
|
|
1143
1156
|
}
|
|
1144
1157
|
static getI() {
|
|
1145
1158
|
if (!AudioPlayer.instance) {
|
|
@@ -1165,13 +1178,23 @@ class AudioPlayer {
|
|
|
1165
1178
|
}
|
|
1166
1179
|
}
|
|
1167
1180
|
async play(targetElement) {
|
|
1181
|
+
// Stop any currently playing audio first if target element has audio given
|
|
1182
|
+
try {
|
|
1183
|
+
await AudioPlayer.getI().stop();
|
|
1184
|
+
}
|
|
1185
|
+
catch (e) {
|
|
1186
|
+
console.error('Error stopping audio before speak action:', e);
|
|
1187
|
+
}
|
|
1188
|
+
// then play the target element audio.
|
|
1168
1189
|
let audioUrl = targetElement.getAttribute('audio') || '';
|
|
1190
|
+
// If no direct audio attribute, check childrens for audio
|
|
1169
1191
|
if (!audioUrl) {
|
|
1170
1192
|
const childElements = targetElement.children;
|
|
1171
1193
|
for (let i = 0; i < childElements.length; i++) {
|
|
1172
1194
|
const childAudioUrl = childElements[i].getAttribute('audio');
|
|
1173
1195
|
if (childAudioUrl) {
|
|
1174
1196
|
audioUrl = childAudioUrl;
|
|
1197
|
+
break;
|
|
1175
1198
|
}
|
|
1176
1199
|
}
|
|
1177
1200
|
}
|
|
@@ -1181,18 +1204,21 @@ class AudioPlayer {
|
|
|
1181
1204
|
console.log('🚀 Playing audio:', this.audioElement.src);
|
|
1182
1205
|
try {
|
|
1183
1206
|
setDraggingDisabled(true);
|
|
1184
|
-
await this.audioElement.play();
|
|
1185
1207
|
highlightSpeakingElement(targetElement);
|
|
1208
|
+
await this.audioElement.play();
|
|
1186
1209
|
await new Promise(resolve => {
|
|
1187
1210
|
this.audioElement.onended = () => {
|
|
1188
|
-
stopHighlightForSpeakingElement(targetElement);
|
|
1189
1211
|
resolve();
|
|
1190
|
-
setDraggingDisabled(false);
|
|
1191
1212
|
};
|
|
1192
1213
|
});
|
|
1193
1214
|
}
|
|
1194
1215
|
catch (error) {
|
|
1195
|
-
console.log('
|
|
1216
|
+
console.log('🎧 Audio play error:', error);
|
|
1217
|
+
}
|
|
1218
|
+
finally {
|
|
1219
|
+
this.audioElement.onended = null; // cleanup
|
|
1220
|
+
setDraggingDisabled(false);
|
|
1221
|
+
stopHighlightForSpeakingElement(targetElement);
|
|
1196
1222
|
}
|
|
1197
1223
|
}
|
|
1198
1224
|
// If no audio, use text-to-speech
|
|
@@ -1202,13 +1228,35 @@ class AudioPlayer {
|
|
|
1202
1228
|
await speakText(targetElement.textContent, targetElement);
|
|
1203
1229
|
const highlightedElements = document.querySelectorAll('.speaking-highlight');
|
|
1204
1230
|
highlightedElements.forEach(element => stopHighlightForSpeakingElement(element));
|
|
1205
|
-
setDraggingDisabled(false);
|
|
1206
1231
|
}
|
|
1207
1232
|
catch (error) {
|
|
1208
|
-
console.log('
|
|
1233
|
+
console.log('🎧 TTS Error:', error);
|
|
1234
|
+
}
|
|
1235
|
+
finally {
|
|
1236
|
+
setDraggingDisabled(false);
|
|
1209
1237
|
}
|
|
1210
1238
|
}
|
|
1211
1239
|
}
|
|
1240
|
+
// GLOBAL STOP EVENTS (container change, activity change…)
|
|
1241
|
+
registerGlobalStopEvents() {
|
|
1242
|
+
const stopEvents = [
|
|
1243
|
+
NextContainerKey, PrevContainerKey, LessonEndKey, ActivityChangeKey,
|
|
1244
|
+
ActivityEndKey, GameCompletedKey, GameExitKey
|
|
1245
|
+
];
|
|
1246
|
+
stopEvents.forEach(key => {
|
|
1247
|
+
window.addEventListener(key, () => this.stop());
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
// DESTROY (for hot-reload)
|
|
1251
|
+
destroy() {
|
|
1252
|
+
console.log("AudioPlayer destroyed (hot-reload safe)");
|
|
1253
|
+
this.stop();
|
|
1254
|
+
// Remove DOM element
|
|
1255
|
+
if (this.audioElement.parentNode) {
|
|
1256
|
+
this.audioElement.parentNode.removeChild(this.audioElement);
|
|
1257
|
+
}
|
|
1258
|
+
AudioPlayer.instance = undefined;
|
|
1259
|
+
}
|
|
1212
1260
|
}
|
|
1213
1261
|
|
|
1214
1262
|
let preOverlap;
|
|
@@ -1367,11 +1415,11 @@ function enableReorderDrag(element) {
|
|
|
1367
1415
|
onDropToCategory(element, category);
|
|
1368
1416
|
}
|
|
1369
1417
|
if (divEl) {
|
|
1370
|
-
const keyframes = `
|
|
1371
|
-
@keyframes widthDecrease {
|
|
1372
|
-
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
1373
|
-
100% { width: 0px; height: 0px;}
|
|
1374
|
-
}
|
|
1418
|
+
const keyframes = `
|
|
1419
|
+
@keyframes widthDecrease {
|
|
1420
|
+
0% { width: ${divEl.offsetWidth}px; height: ${divEl.offsetHeight}px; }
|
|
1421
|
+
100% { width: 0px; height: 0px;}
|
|
1422
|
+
}
|
|
1375
1423
|
`;
|
|
1376
1424
|
const styleSheet = document.styleSheets[0];
|
|
1377
1425
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -1581,11 +1629,11 @@ function moveWithAnimation(target, overlapped) {
|
|
|
1581
1629
|
const dummy = createDummyElement(target);
|
|
1582
1630
|
dummy.style.visibility = 'hidden';
|
|
1583
1631
|
dummy.setAttribute('type', 'dummy');
|
|
1584
|
-
const keyframes = `
|
|
1585
|
-
@keyframes widthIncrease {
|
|
1586
|
-
0% { width: 0px; height: 0px; }
|
|
1587
|
-
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
1588
|
-
}
|
|
1632
|
+
const keyframes = `
|
|
1633
|
+
@keyframes widthIncrease {
|
|
1634
|
+
0% { width: 0px; height: 0px; }
|
|
1635
|
+
100% { width: ${target.offsetWidth}px; height: ${target.offsetHeight}px;}
|
|
1636
|
+
}
|
|
1589
1637
|
`;
|
|
1590
1638
|
if (!overlapped) {
|
|
1591
1639
|
const overlapCategory = findMostoverlappedElement(target, 'category');
|
|
@@ -3142,7 +3190,11 @@ function addClickListenerForClickType(element) {
|
|
|
3142
3190
|
if (lido_buttons === 'lido-arrow-left' || lido_buttons === 'lido-arrow-right') {
|
|
3143
3191
|
return;
|
|
3144
3192
|
}
|
|
3145
|
-
|
|
3193
|
+
const audioAttr = element.getAttribute('audio');
|
|
3194
|
+
const hasValidAudio = audioAttr && audioAttr.trim().length > 0;
|
|
3195
|
+
if (hasValidAudio) {
|
|
3196
|
+
AudioPlayer.getI().stop();
|
|
3197
|
+
}
|
|
3146
3198
|
const container = document.getElementById(LidoContainer);
|
|
3147
3199
|
const objective = container['objective'].split(',');
|
|
3148
3200
|
const checkButton = document.querySelector('#lido-checkButton');
|
|
@@ -68055,15 +68107,15 @@ function calculateFill(input, currentFill = 0) {
|
|
|
68055
68107
|
// Helper to animate and remove the active equation cell
|
|
68056
68108
|
const animationToRemoveEquationSolvedCellForNimbleTable = (activeCell, allCalculateTypes) => {
|
|
68057
68109
|
return new Promise((resolve) => {
|
|
68058
|
-
const keyframes = `
|
|
68059
|
-
@keyframes widthDecrease {
|
|
68060
|
-
0% {
|
|
68061
|
-
background-color: ${activeCell.style.backgroundColor};
|
|
68062
|
-
height: ${activeCell.style.height};
|
|
68063
|
-
margin: ${activeCell.style.margin};
|
|
68064
|
-
${activeCell.innerHTML = ""}
|
|
68065
|
-
}
|
|
68066
|
-
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
68110
|
+
const keyframes = `
|
|
68111
|
+
@keyframes widthDecrease {
|
|
68112
|
+
0% {
|
|
68113
|
+
background-color: ${activeCell.style.backgroundColor};
|
|
68114
|
+
height: ${activeCell.style.height};
|
|
68115
|
+
margin: ${activeCell.style.margin};
|
|
68116
|
+
${activeCell.innerHTML = ""}
|
|
68117
|
+
}
|
|
68118
|
+
100% { background-color: transparent; height: 0px; margin: 0px; }
|
|
68067
68119
|
}`;
|
|
68068
68120
|
const styleSheet = document.styleSheets[0];
|
|
68069
68121
|
styleSheet.insertRule(keyframes, styleSheet.cssRules.length);
|
|
@@ -68596,7 +68648,15 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68596
68648
|
break;
|
|
68597
68649
|
}
|
|
68598
68650
|
case 'speak': {
|
|
68599
|
-
|
|
68651
|
+
const val = (action.value || '').toString().trim().toLowerCase();
|
|
68652
|
+
if (val === 'true' || val === '1' || val === 'yes') {
|
|
68653
|
+
try {
|
|
68654
|
+
await AudioPlayer.getI().play(targetElement);
|
|
68655
|
+
}
|
|
68656
|
+
catch (err) {
|
|
68657
|
+
console.error('Error playing audio for speak action:', err);
|
|
68658
|
+
}
|
|
68659
|
+
}
|
|
68600
68660
|
break;
|
|
68601
68661
|
}
|
|
68602
68662
|
case 'fill-slide': {
|
|
@@ -68718,6 +68778,53 @@ const executeActions = async (actionsString, thisElement, element) => {
|
|
|
68718
68778
|
}
|
|
68719
68779
|
break;
|
|
68720
68780
|
}
|
|
68781
|
+
case 'disableType': {
|
|
68782
|
+
const dragEle = document.querySelector('[type="drag"]');
|
|
68783
|
+
dragEle.removeAttribute('type');
|
|
68784
|
+
dragEle.style.pointerEvents = 'none';
|
|
68785
|
+
break;
|
|
68786
|
+
}
|
|
68787
|
+
case 'updateCountBlender': {
|
|
68788
|
+
const allDrags = document.querySelectorAll('[type="drag"]');
|
|
68789
|
+
let units = 0;
|
|
68790
|
+
let tens = 0;
|
|
68791
|
+
let hundreds = 0;
|
|
68792
|
+
allDrags.forEach(el => {
|
|
68793
|
+
const dropTo = el.getAttribute("drop-to");
|
|
68794
|
+
if (dropTo === "unitsDrop")
|
|
68795
|
+
units++;
|
|
68796
|
+
if (dropTo === "tensDrop")
|
|
68797
|
+
tens++;
|
|
68798
|
+
if (dropTo === "hundredsDrop")
|
|
68799
|
+
hundreds++;
|
|
68800
|
+
});
|
|
68801
|
+
const unitsValue = units * 1;
|
|
68802
|
+
const tensValue = tens * 10;
|
|
68803
|
+
const hundredsValue = hundreds * 100;
|
|
68804
|
+
const totalValue = unitsValue + tensValue + hundredsValue;
|
|
68805
|
+
// ✅ Update Lido Text Boxes
|
|
68806
|
+
const unitsBox = document.getElementById("units");
|
|
68807
|
+
const tensBox = document.getElementById("tens");
|
|
68808
|
+
const hundredsBox = document.getElementById("hundreds");
|
|
68809
|
+
if (unitsBox) {
|
|
68810
|
+
unitsBox.setAttribute("string", unitsValue.toString());
|
|
68811
|
+
}
|
|
68812
|
+
if (tensBox) {
|
|
68813
|
+
tensBox.setAttribute("string", tensValue.toString());
|
|
68814
|
+
}
|
|
68815
|
+
if (hundredsBox) {
|
|
68816
|
+
hundredsBox.setAttribute("string", hundredsValue.toString());
|
|
68817
|
+
}
|
|
68818
|
+
console.log(`Units = ${units} → ${unitsValue}`);
|
|
68819
|
+
console.log(`Tens = ${tens} → ${tensValue}`);
|
|
68820
|
+
console.log(`Hundreds = ${hundreds} → ${hundredsValue}`);
|
|
68821
|
+
console.log(`✅ Total Value = ${totalValue}`);
|
|
68822
|
+
break;
|
|
68823
|
+
}
|
|
68824
|
+
case 'updateCalculatorAnswer': {
|
|
68825
|
+
updateCalculatorAnswer();
|
|
68826
|
+
break;
|
|
68827
|
+
}
|
|
68721
68828
|
default: {
|
|
68722
68829
|
targetElement.style[action.action] = action.value;
|
|
68723
68830
|
break;
|
|
@@ -68734,6 +68841,7 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68734
68841
|
const isInfinite = container.getAttribute('drop-action') === exports.DropAction.InfiniteDrop;
|
|
68735
68842
|
if (isAppend || isInfinite) {
|
|
68736
68843
|
setTimeout(() => {
|
|
68844
|
+
var _a, _b;
|
|
68737
68845
|
dragElement.style.transform = 'translate(0,0)';
|
|
68738
68846
|
dragElement.style.transition = '';
|
|
68739
68847
|
let dummyElement = document.createElement('div');
|
|
@@ -68748,11 +68856,11 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68748
68856
|
}
|
|
68749
68857
|
dummyElement.setAttribute('id', dragElement.getAttribute('id'));
|
|
68750
68858
|
dragElement.replaceWith(dummyElement);
|
|
68751
|
-
const keyframes = `
|
|
68752
|
-
@keyframes widthDecrease {
|
|
68753
|
-
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
68754
|
-
100% { width: 0px; height: 0px; margin: 0px;}
|
|
68755
|
-
}
|
|
68859
|
+
const keyframes = `
|
|
68860
|
+
@keyframes widthDecrease {
|
|
68861
|
+
0% { width: ${dragElement.style.width}; height: ${dragElement.style.height}; margin: ${dragElement.style.margin}; }
|
|
68862
|
+
100% { width: 0px; height: 0px; margin: 0px;}
|
|
68863
|
+
}
|
|
68756
68864
|
`;
|
|
68757
68865
|
if (!isInfinite) {
|
|
68758
68866
|
dummyElement.style.width = element.style.width;
|
|
@@ -68767,6 +68875,14 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68767
68875
|
dummyElement.style.margin = '0px';
|
|
68768
68876
|
});
|
|
68769
68877
|
}
|
|
68878
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
68879
|
+
const rowAttr = dropElement.getAttribute('dropAttr');
|
|
68880
|
+
const dropAttr = parseProp(rowAttr, orientation); // will return stackcascade or verticalstack
|
|
68881
|
+
if (((_a = (dropAttr)) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "stackcascade" || ((_b = (dropAttr)) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "verticalstack") {
|
|
68882
|
+
dropElement.append(dragElement);
|
|
68883
|
+
placeElementInDropZone(dropElement, dragElement, orientation, dropAttr);
|
|
68884
|
+
return;
|
|
68885
|
+
}
|
|
68770
68886
|
dropElement.parentElement.append(element);
|
|
68771
68887
|
dragElement.style.position = 'absolute';
|
|
68772
68888
|
dragElement.style.zIndex = '1';
|
|
@@ -68779,16 +68895,41 @@ const afterDropDragHandling = (dragElement, dropElement) => {
|
|
|
68779
68895
|
const scaledLeft = (dropCenterX - dragCenterX) / containerScale;
|
|
68780
68896
|
const scaledTop = (dropCenterY - dragCenterY) / containerScale;
|
|
68781
68897
|
dragElement.style.transform = `translate(${scaledLeft}px, ${scaledTop}px)`;
|
|
68782
|
-
},
|
|
68898
|
+
}, 100);
|
|
68783
68899
|
}
|
|
68784
68900
|
};
|
|
68901
|
+
// function cloneElementWithComputedStyles(originalEl: HTMLElement): HTMLElement {
|
|
68902
|
+
// let clone = document.createElement('div') as HTMLElement;
|
|
68903
|
+
// clone.innerHTML = originalEl.outerHTML;
|
|
68904
|
+
// clone = clone.firstChild as HTMLElement;
|
|
68905
|
+
// clone.setAttribute('height', originalEl.style.height);
|
|
68906
|
+
// clone.setAttribute('width', originalEl.style.width);
|
|
68907
|
+
// clone.setAttribute('visible', 'true');
|
|
68908
|
+
// return clone;
|
|
68909
|
+
// }
|
|
68785
68910
|
function cloneElementWithComputedStyles(originalEl) {
|
|
68786
|
-
|
|
68787
|
-
|
|
68788
|
-
|
|
68789
|
-
|
|
68790
|
-
|
|
68791
|
-
|
|
68911
|
+
const tag = originalEl.tagName.toLowerCase();
|
|
68912
|
+
if (tag === "lido-text") {
|
|
68913
|
+
let clone = document.createElement('div');
|
|
68914
|
+
clone.innerHTML = originalEl.outerHTML;
|
|
68915
|
+
clone = clone.firstChild;
|
|
68916
|
+
clone.setAttribute('height', originalEl.style.height);
|
|
68917
|
+
clone.setAttribute('width', originalEl.style.width);
|
|
68918
|
+
clone.setAttribute('visible', 'true');
|
|
68919
|
+
return clone;
|
|
68920
|
+
}
|
|
68921
|
+
// ✅ For ALL other types (INCLUDING lido-image & matrix) use your simple logic
|
|
68922
|
+
const clone = originalEl.cloneNode(false);
|
|
68923
|
+
clone.style.width = originalEl.style.width;
|
|
68924
|
+
clone.style.height = originalEl.style.height;
|
|
68925
|
+
clone.style.margin = originalEl.style.margin;
|
|
68926
|
+
clone.style.opacity = originalEl.style.opacity;
|
|
68927
|
+
clone.style.transform = originalEl.style.transform;
|
|
68928
|
+
clone.setAttribute("visible", "true");
|
|
68929
|
+
clone.setAttribute("data-dummy", "true");
|
|
68930
|
+
if (tag === "lido-math-matrix") {
|
|
68931
|
+
clone.setAttribute('clickable', "false");
|
|
68932
|
+
}
|
|
68792
68933
|
return clone;
|
|
68793
68934
|
}
|
|
68794
68935
|
// Function to parse actions string
|
|
@@ -68915,10 +69056,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
68915
69056
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
68916
69057
|
}
|
|
68917
69058
|
}
|
|
68918
|
-
else {
|
|
68919
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
68920
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
68921
|
-
}
|
|
68922
69059
|
}
|
|
68923
69060
|
let dragScore = buildDragSelectedMapFromDOM();
|
|
68924
69061
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
@@ -68930,21 +69067,6 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
68930
69067
|
drag[index] = [];
|
|
68931
69068
|
}
|
|
68932
69069
|
drag[index].push(dragElement.id);
|
|
68933
|
-
// localStorage.setItem(DragMapKey, JSON.stringify(drag));
|
|
68934
|
-
Object.keys(dragScore).sort((a, b) => parseInt(a) - parseInt(b));
|
|
68935
|
-
if (dragElement && dropElement) {
|
|
68936
|
-
const isCorrect = dropElement['value'].toLowerCase().includes(dragElement['value'].toLowerCase());
|
|
68937
|
-
if (isCorrect) {
|
|
68938
|
-
const onCorrect = dropElement.getAttribute('onCorrect');
|
|
68939
|
-
if (onCorrect) {
|
|
68940
|
-
await executeActions(onCorrect, dropElement, dragElement);
|
|
68941
|
-
}
|
|
68942
|
-
}
|
|
68943
|
-
else {
|
|
68944
|
-
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
68945
|
-
await executeActions(onInCorrect, dropElement, dragElement);
|
|
68946
|
-
}
|
|
68947
|
-
}
|
|
68948
69070
|
const allElements = document.querySelectorAll("[type='drop']");
|
|
68949
69071
|
allElements.forEach(otherElement => {
|
|
68950
69072
|
var _a;
|
|
@@ -69034,6 +69156,7 @@ const validateObjectiveStatus = async () => {
|
|
|
69034
69156
|
return;
|
|
69035
69157
|
const objectiveString = container['objective'];
|
|
69036
69158
|
const additionalCheck = container.getAttribute('equationCheck');
|
|
69159
|
+
container.getAttribute('isAllowOnlyCorrect') === 'true' || '';
|
|
69037
69160
|
console.log('🚀 ~ validateObjectiveStatus ~ additionalCheck:', additionalCheck);
|
|
69038
69161
|
let equationGiven = false;
|
|
69039
69162
|
if (objectiveString == null || objectiveString.length === 0) {
|
|
@@ -69085,13 +69208,15 @@ const validateObjectiveStatus = async () => {
|
|
|
69085
69208
|
await calculateScore();
|
|
69086
69209
|
}
|
|
69087
69210
|
else {
|
|
69088
|
-
const onInCorrect = container.getAttribute('onInCorrect');
|
|
69089
|
-
await executeActions(onInCorrect, container);
|
|
69090
69211
|
const isContinueOnCorrect = container.getAttribute('is-continue-on-correct') === 'true';
|
|
69091
69212
|
if (!isContinueOnCorrect) {
|
|
69092
69213
|
triggerNextContainer();
|
|
69093
69214
|
await calculateScore();
|
|
69094
69215
|
}
|
|
69216
|
+
else {
|
|
69217
|
+
const onInCorrect = container.getAttribute('onInCorrect');
|
|
69218
|
+
await executeActions(onInCorrect, container);
|
|
69219
|
+
}
|
|
69095
69220
|
}
|
|
69096
69221
|
};
|
|
69097
69222
|
const triggerNextContainer = () => {
|
|
@@ -69655,14 +69780,14 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69655
69780
|
const sign = ((signElement && ((signElement.getAttribute('string') || signElement.textContent) || '')).toString().trim() === '+') ? '+' : '-';
|
|
69656
69781
|
if (sign === '-') {
|
|
69657
69782
|
// '-' flow: reveal one by one then change bgColor of last B to red
|
|
69658
|
-
for (let i = 0; i < topRowChildren.length; i++) {
|
|
69783
|
+
for (let i = 0; i < Math.min(number1, topRowChildren.length); i++) {
|
|
69659
69784
|
await new Promise(resolve => setTimeout(resolve, 75));
|
|
69660
69785
|
showElement(topRowChildren[i]);
|
|
69661
69786
|
}
|
|
69662
69787
|
elementAppearance(true);
|
|
69663
69788
|
await new Promise(r => setTimeout(r, 500));
|
|
69664
69789
|
for (let k = 0; k < Math.min(number2, topRowChildren.length); k++) {
|
|
69665
|
-
const idx = topRowChildren.length - 1 - k;
|
|
69790
|
+
const idx = Math.min(number1, topRowChildren.length) - 1 - k;
|
|
69666
69791
|
setImageBackground(topRowChildren[idx], 'red');
|
|
69667
69792
|
await new Promise(r => setTimeout(r, 200));
|
|
69668
69793
|
}
|
|
@@ -69687,6 +69812,67 @@ const SumTogetherAnimation = async (element, value) => {
|
|
|
69687
69812
|
elementAppearance(false);
|
|
69688
69813
|
}
|
|
69689
69814
|
};
|
|
69815
|
+
function placeElementInDropZone(dropElement, dragElement, orientation, dropAttr) {
|
|
69816
|
+
const dropRect = dropElement.getBoundingClientRect();
|
|
69817
|
+
const dragRect = dragElement.getBoundingClientRect();
|
|
69818
|
+
const scale = typeof calculateScale === "function" ? calculateScale() : 1;
|
|
69819
|
+
if (!dropElement.dataset.dropCount)
|
|
69820
|
+
dropElement.dataset.dropCount = "0";
|
|
69821
|
+
let dropCount = parseInt(dropElement.dataset.dropCount, 10);
|
|
69822
|
+
// === READ DROP ZONE SIZE ===
|
|
69823
|
+
const dropWidth = dropRect.width;
|
|
69824
|
+
const dropHeight = dropRect.height;
|
|
69825
|
+
let targetX, targetY;
|
|
69826
|
+
// ---------------- LANDSCAPE WATERFALL ----------------
|
|
69827
|
+
if (orientation === "landscape" && dropAttr.toLowerCase() === "stackcascade") {
|
|
69828
|
+
console.log("🌄 Landscape waterfall");
|
|
69829
|
+
const shiftX = dropWidth * 0.02; // proportional (5% of width)
|
|
69830
|
+
const shiftY = dropHeight * 0.02; // proportional (5% of height)
|
|
69831
|
+
const startX = dropRect.left + dropWidth * 0.36; // 10% inside
|
|
69832
|
+
const startY = dropRect.top + dropHeight * -0.09; // slightly above
|
|
69833
|
+
targetX = startX + (dropCount * shiftX);
|
|
69834
|
+
targetY = startY + (dropCount * shiftY);
|
|
69835
|
+
}
|
|
69836
|
+
// ---------------- PORTRAIT VERTICAL ----------------
|
|
69837
|
+
else {
|
|
69838
|
+
console.log("📱 Portrait vertical stack");
|
|
69839
|
+
let startX;
|
|
69840
|
+
const stepY = dropHeight * 0.05; // 8% vertical step
|
|
69841
|
+
if (dropElement.id === "unitsDrop") {
|
|
69842
|
+
startX = dropRect.left + dropWidth * 0.4; // special spacing
|
|
69843
|
+
}
|
|
69844
|
+
else if (dropElement.id === "tensDrop") {
|
|
69845
|
+
startX = dropRect.left + dropWidth * 0.25;
|
|
69846
|
+
}
|
|
69847
|
+
else {
|
|
69848
|
+
startX = dropRect.left + dropWidth * 0.16; // normal spacing
|
|
69849
|
+
}
|
|
69850
|
+
const startY = dropRect.top - dropHeight * 0.25; // above start
|
|
69851
|
+
targetX = startX;
|
|
69852
|
+
targetY = startY + (dropCount * stepY);
|
|
69853
|
+
}
|
|
69854
|
+
// ------------ APPLY TRANSFORM SMOOTHLY --------------
|
|
69855
|
+
const dx = (targetX - dragRect.left) / scale;
|
|
69856
|
+
const dy = (targetY - dragRect.top) / scale;
|
|
69857
|
+
dragElement.style.transition = "transform .2s ease-out";
|
|
69858
|
+
dragElement.style.transform = `translate(${dx}px, ${dy}px)`;
|
|
69859
|
+
dropElement.dataset.dropCount = String(dropCount + 1);
|
|
69860
|
+
// reset size
|
|
69861
|
+
dragElement.style.width = "auto";
|
|
69862
|
+
dragElement.style.height = "auto";
|
|
69863
|
+
}
|
|
69864
|
+
const updateCalculatorAnswer = () => {
|
|
69865
|
+
const container = document.getElementById(LidoContainer);
|
|
69866
|
+
if (!container)
|
|
69867
|
+
return;
|
|
69868
|
+
const calci = document.querySelector('#lidoCalculator');
|
|
69869
|
+
if (!calci)
|
|
69870
|
+
return;
|
|
69871
|
+
const answerText = container.querySelector('#answer');
|
|
69872
|
+
const value = calci.getAttribute('value');
|
|
69873
|
+
console.log("😀😀😀😀😀😀😀", value);
|
|
69874
|
+
answerText.setAttribute('string', value);
|
|
69875
|
+
};
|
|
69690
69876
|
|
|
69691
69877
|
exports.ActivityScoreKey = ActivityScoreKey;
|
|
69692
69878
|
exports.AudioPlayer = AudioPlayer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.lido-canvas {
|
|
2
|
-
height: 100%;
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
1
|
+
.lido-canvas {
|
|
2
|
+
height: 100%;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|