lido-player 0.0.2-alpha-52-dev → 0.0.2-alpha-55-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/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lido-avatar_22.cjs.entry.js +187 -59
- package/dist/cjs/lido-player.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{utils-ce99b0d0.js → utils-4b44610b.js} +111 -86
- package/dist/collection/components/calculator/lido-calculator.js +4 -2
- package/dist/collection/components/container/lido-container.js +24 -2
- package/dist/collection/components/home/lido-home.css +4 -0
- package/dist/collection/components/home/lido-home.js +27 -3
- package/dist/collection/components/trace/lido-trace.js +122 -47
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +26 -25
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +3 -1
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +1 -1
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +1 -1
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +1 -1
- package/dist/collection/stories/Templates/blender/blender.stories.js +1 -1
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +1 -1
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +1 -1
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +1 -1
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +1 -1
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +1 -1
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +1 -1
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +1 -1
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +1 -1
- package/dist/collection/stories/Templates/grid/grid.stories.js +5 -1
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +1 -1
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +4 -2
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +1 -1
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +1 -1
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +4 -2
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +1 -1
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +1 -1
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +1 -1
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +1 -1
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +1 -1
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +1 -1
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +2 -2
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +2 -2
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +1 -1
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +1 -1
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +1 -1
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +5 -1
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +1 -1
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +1 -1
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +3 -1
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +2 -2
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +6 -6
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +7 -6
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +1 -1
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +25 -21
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +1 -1
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +8 -6
- package/dist/collection/stories/Templates/total/total.stories.js +1 -1
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +1 -1
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +2 -2
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +6 -6
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +1 -1
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +7 -6
- package/dist/collection/utils/customEvents.js +1 -0
- package/dist/collection/utils/utils.js +20 -17
- package/dist/collection/utils/utilsHandlers/animationHandler.js +58 -0
- package/dist/collection/utils/utilsHandlers/clickHandler.js +5 -1
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +19 -60
- package/dist/collection/utils/utilsHandlers/slideHandler.js +7 -6
- package/dist/collection/utils/utilsHandlers/sortHandler.js +3 -5
- 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 +23 -23
- 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-39a2e638.js → p-0be6b5d5.js} +2 -2
- package/dist/components/{p-11bf64aa.js → p-2c518dbe.js} +1 -1
- package/dist/components/{p-c4abfd0f.js → p-2e023f67.js} +1 -1
- package/dist/components/{p-58c67252.js → p-36c2e21a.js} +110 -87
- package/dist/components/{p-52e77394.js → p-3fc01453.js} +1 -1
- package/dist/components/{p-06171259.js → p-43d79c61.js} +1 -1
- package/dist/components/{p-00777872.js → p-5078599e.js} +26 -4
- package/dist/components/{p-26df0769.js → p-590ce2c9.js} +1 -1
- package/dist/components/{p-5b5f59a8.js → p-67a24ad4.js} +2 -2
- package/dist/components/{p-68112f8c.js → p-72d6a594.js} +1 -1
- package/dist/components/{p-3ce3744c.js → p-73b2bd74.js} +6 -4
- package/dist/components/{p-0fbeb3a1.js → p-73e3f0f4.js} +12 -6
- package/dist/components/{p-0c2aebfb.js → p-9acf0fcc.js} +1 -1
- package/dist/components/{p-a2f96840.js → p-b095de27.js} +1 -1
- package/dist/components/{p-b2125fc9.js → p-b0dbee97.js} +48 -24
- package/dist/components/{p-a516a324.js → p-b847f269.js} +123 -48
- package/dist/components/{p-9d34d59d.js → p-bc5202db.js} +2 -2
- package/dist/components/{p-cb56a853.js → p-c296051d.js} +1 -1
- package/dist/components/{p-8a34b98b.js → p-c69ef266.js} +1 -1
- package/dist/components/{p-2d53e1a5.js → p-ca8aea4b.js} +1 -1
- package/dist/components/{p-3f4d4c0a.js → p-de2193c5.js} +1 -1
- package/dist/components/{p-09f1e2d2.js → p-e534ea52.js} +1 -1
- package/dist/components/{p-8f2ed62f.js → p-f8c00485.js} +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/lido-avatar_22.entry.js +187 -59
- package/dist/esm/lido-player.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-107b15a7.js → utils-ae1eb036.js} +110 -87
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-d1251482.js → p-a632e2ce.js} +2 -2
- package/dist/lido-player/p-f1b879f6.entry.js +1 -0
- package/dist/types/components/container/lido-container.d.ts +1 -0
- package/dist/types/components/home/lido-home.d.ts +1 -0
- package/dist/types/components/trace/lido-trace.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +1 -1
- package/dist/types/utils/utilsHandlers/animationHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/lido-player/p-606ea279.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
-
import { NextContainerKey, PrevContainerKey, LidoContainer, exitUrl, prevUrl, nextUrl, speakUrl, ActivityScoreKey, } from "../../utils/constants";
|
|
2
|
+
import { SelectedValuesKey, NextContainerKey, PrevContainerKey, LidoContainer, exitUrl, prevUrl, nextUrl, speakUrl, ActivityScoreKey, } from "../../utils/constants";
|
|
3
3
|
import { dispatchActivityChangeEvent, dispatchGameCompletedEvent, dispatchGameExitEvent } from "../../utils/customEvents";
|
|
4
|
-
import { calculateScale, getCancelBtnPopup, setCancelBtnPopup, executeActions, triggerPrevcontainer, convertUrlToRelative } from "../../utils/utils";
|
|
4
|
+
import { calculateScale, getCancelBtnPopup, setCancelBtnPopup, executeActions, triggerPrevcontainer, convertUrlToRelative, triggerNextContainer, matchStringPattern } from "../../utils/utils";
|
|
5
5
|
import { AudioPlayer } from "../../utils/audioPlayer";
|
|
6
6
|
import { generateUUIDFallback } from "../../utils/utils";
|
|
7
7
|
import i18next from "../../utils/i18n";
|
|
@@ -88,7 +88,6 @@ export class LidoHome {
|
|
|
88
88
|
rightbtn.style.visibility = 'hidden';
|
|
89
89
|
}
|
|
90
90
|
else {
|
|
91
|
-
rightbtn.style.pointerEvents = 'auto';
|
|
92
91
|
rightbtn.style.visibility = 'visible';
|
|
93
92
|
}
|
|
94
93
|
}, 100);
|
|
@@ -299,6 +298,9 @@ export class LidoHome {
|
|
|
299
298
|
if (tagName === 'lido-text' && props.string) {
|
|
300
299
|
props.string = i18next.t(props.string);
|
|
301
300
|
}
|
|
301
|
+
if (tagName === 'lido-text' && props.string) {
|
|
302
|
+
props.string = i18next.t(props.string);
|
|
303
|
+
}
|
|
302
304
|
// Map XML tags to Stencil components
|
|
303
305
|
const componentMapping = {
|
|
304
306
|
'lido-container': (h("lido-container", Object.assign({}, props, { canplay: this.canplay, baseUrl: this.baseUrl, height: this.height }), children)),
|
|
@@ -348,6 +350,16 @@ export class LidoHome {
|
|
|
348
350
|
this.containers = containers;
|
|
349
351
|
console.log("container :::", containers);
|
|
350
352
|
}
|
|
353
|
+
areAllDropsFilled() {
|
|
354
|
+
const drops = Array.from(document.querySelectorAll('[type="drop"]'));
|
|
355
|
+
const drags = Array.from(document.querySelectorAll('[type="drag"]')).filter(drag => drag.getAttribute('drop-to'));
|
|
356
|
+
console.log('drops', drops);
|
|
357
|
+
console.log('drags', drags);
|
|
358
|
+
return drops.every(drop => {
|
|
359
|
+
const dropId = drop.id;
|
|
360
|
+
return drags.some(drag => drag.getAttribute('drop-to') === dropId);
|
|
361
|
+
});
|
|
362
|
+
}
|
|
351
363
|
async btnpopup() {
|
|
352
364
|
setCancelBtnPopup(false);
|
|
353
365
|
await AudioPlayer.getI().stop();
|
|
@@ -367,6 +379,18 @@ export class LidoHome {
|
|
|
367
379
|
await new Promise(resolve => setTimeout(resolve, 300));
|
|
368
380
|
}
|
|
369
381
|
}
|
|
382
|
+
if (this.areAllDropsFilled()) {
|
|
383
|
+
const objectiveString = container['objective'];
|
|
384
|
+
const objectiveArray = JSON.parse(localStorage.getItem(SelectedValuesKey) || '[]');
|
|
385
|
+
const res = matchStringPattern(objectiveString, objectiveArray);
|
|
386
|
+
console.log('Resultt', res);
|
|
387
|
+
if (res) {
|
|
388
|
+
triggerNextContainer();
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
console.log('Not yet filled ');
|
|
393
|
+
}
|
|
370
394
|
}
|
|
371
395
|
scaleNavbarContainer() {
|
|
372
396
|
setTimeout(() => {
|
|
@@ -33,6 +33,7 @@ export class LidoTrace {
|
|
|
33
33
|
this.fileIndex = -1;
|
|
34
34
|
this.isDragging = false;
|
|
35
35
|
this.activePointerId = null;
|
|
36
|
+
this.freeTraceUpdateCounter = 0;
|
|
36
37
|
this.idleTimer = null;
|
|
37
38
|
this.fingerImg = null;
|
|
38
39
|
}
|
|
@@ -49,8 +50,8 @@ export class LidoTrace {
|
|
|
49
50
|
circle: null,
|
|
50
51
|
paths: [],
|
|
51
52
|
svg: null,
|
|
52
|
-
proximityThreshold:
|
|
53
|
-
freeTraceProximityThreshold:
|
|
53
|
+
proximityThreshold: 375, // Increased general proximity threshold (was 100)
|
|
54
|
+
freeTraceProximityThreshold: 350, // Increased proximity for free trace (was 50)
|
|
54
55
|
rafId: null,
|
|
55
56
|
pointerMoveEvent: null,
|
|
56
57
|
activePointerId: null,
|
|
@@ -386,7 +387,7 @@ export class LidoTrace {
|
|
|
386
387
|
}
|
|
387
388
|
// Modified handlePointerMove function
|
|
388
389
|
handlePointerMove(state) {
|
|
389
|
-
var _a, _b, _c, _d;
|
|
390
|
+
var _a, _b, _c, _d, _e, _f;
|
|
390
391
|
if (!state.isDragging)
|
|
391
392
|
return;
|
|
392
393
|
if (!state.circle || !state.paths || state.paths.length === 0)
|
|
@@ -398,6 +399,15 @@ export class LidoTrace {
|
|
|
398
399
|
x: parseFloat(state.circle.getAttribute('cx')),
|
|
399
400
|
y: parseFloat(state.circle.getAttribute('cy')),
|
|
400
401
|
};
|
|
402
|
+
// Only update if pointer moved a minimum distance (to reduce unnecessary updates)
|
|
403
|
+
const MOVE_THRESHOLD = 1; // px
|
|
404
|
+
if (state.lastPointerPos) {
|
|
405
|
+
const dx = pointerPos.x - state.lastPointerPos.x;
|
|
406
|
+
const dy = pointerPos.y - state.lastPointerPos.y;
|
|
407
|
+
if (dx * dx + dy * dy < MOVE_THRESHOLD * MOVE_THRESHOLD) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
401
411
|
const currentPath = state.paths[state.currentPathIndex];
|
|
402
412
|
if (!currentPath) {
|
|
403
413
|
console.error('No valid path found at the current index');
|
|
@@ -425,48 +435,76 @@ export class LidoTrace {
|
|
|
425
435
|
}
|
|
426
436
|
// For free trace mode and blind free trace mode, allow free drawing only if within the reduced proximity threshold
|
|
427
437
|
if (state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace) {
|
|
438
|
+
// Throttle: Only update every 2nd event (for reducing excessive dom updates)
|
|
439
|
+
this.freeTraceUpdateCounter = (this.freeTraceUpdateCounter || 0) + 1;
|
|
440
|
+
if (this.freeTraceUpdateCounter % 2 !== 0) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
428
443
|
// Initialize the currentFreePath array if it's not created
|
|
429
444
|
if (!state.currentFreePath) {
|
|
430
445
|
state.currentFreePath = [];
|
|
431
446
|
}
|
|
432
|
-
// Create a new
|
|
447
|
+
// Create a new polyline element if it's the first trace for the current path index
|
|
433
448
|
if (!state.currentFreePath[state.currentPathIndex]) {
|
|
434
|
-
const
|
|
435
|
-
// newPath.setAttribute('stroke', 'green');
|
|
449
|
+
const newPolyline = document.createElementNS('http://www.w3.org/2000/svg', 'polyline');
|
|
436
450
|
const strokeWidth = state.paths[state.currentPathIndex].style['stroke-width'] || state.paths[state.currentPathIndex].getAttribute('stroke-width');
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
451
|
+
newPolyline.setAttribute('stroke-width', strokeWidth);
|
|
452
|
+
newPolyline.setAttribute('fill', 'none');
|
|
453
|
+
newPolyline.setAttribute('stroke-linecap', 'round');
|
|
454
|
+
newPolyline.setAttribute('stroke', 'lightgreen');
|
|
455
|
+
newPolyline.setAttribute('points', `${pointerPos.x},${pointerPos.y}`);
|
|
456
|
+
(_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPolyline);
|
|
457
|
+
state.currentFreePath[state.currentPathIndex] = newPolyline;
|
|
458
|
+
// Store points array for this polyline
|
|
459
|
+
state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
|
|
460
|
+
state.currentFreePolylinePoints[state.currentPathIndex] = [
|
|
461
|
+
{ x: pointerPos.x, y: pointerPos.y }
|
|
462
|
+
];
|
|
445
463
|
// Reset lastPointerPos for the new path
|
|
446
464
|
state.lastPointerPos = pointerPos;
|
|
465
|
+
// Add a points counter to limit path growth
|
|
466
|
+
state.freeTracePointsCount = 1;
|
|
447
467
|
}
|
|
448
|
-
//
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
//
|
|
456
|
-
state.
|
|
468
|
+
// Limit the number of points in the free trace path for performance
|
|
469
|
+
const MAX_FREE_TRACE_POINTS = 10;
|
|
470
|
+
state.freeTracePointsCount = (state.freeTracePointsCount || 1) + 1;
|
|
471
|
+
if (state.freeTracePointsCount > MAX_FREE_TRACE_POINTS) {
|
|
472
|
+
// If limit reached, skip adding more points
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
// Add the new point to the polyline's points array
|
|
476
|
+
state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
|
|
477
|
+
let pointsArr = state.currentFreePolylinePoints[state.currentPathIndex] || [];
|
|
478
|
+
pointsArr.push({ x: pointerPos.x, y: pointerPos.y });
|
|
479
|
+
state.currentFreePolylinePoints[state.currentPathIndex] = pointsArr;
|
|
480
|
+
// Update the polyline's points attribute
|
|
481
|
+
const pointsStr = pointsArr.map(pt => `${pt.x},${pt.y}`).join(' ');
|
|
482
|
+
state.currentFreePath[state.currentPathIndex].setAttribute('points', pointsStr);
|
|
457
483
|
// Move the draggable circle with the freehand trace
|
|
458
484
|
state.circle.setAttribute('cx', pointerPos.x.toString());
|
|
459
485
|
state.circle.setAttribute('cy', pointerPos.y.toString());
|
|
460
|
-
//
|
|
461
|
-
(_b = state.svg) === null || _b === void 0 ? void 0 : _b.
|
|
486
|
+
// Only re-append if not already children list
|
|
487
|
+
const childNodes = (_b = state.svg) === null || _b === void 0 ? void 0 : _b.childNodes;
|
|
488
|
+
let circleFound = false;
|
|
489
|
+
for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
|
|
490
|
+
const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
|
|
491
|
+
if (child && child.tagName === 'circle') {
|
|
492
|
+
circleFound = true;
|
|
493
|
+
break; // No need to continue once found
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
// If not found, append the circle
|
|
497
|
+
if (!circleFound && state.circle) {
|
|
498
|
+
(_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle);
|
|
499
|
+
}
|
|
462
500
|
// Update the last pointer position
|
|
463
501
|
state.lastPointerPos = pointerPos;
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
// If close to the end of the path, move to the next path
|
|
467
|
-
if (distanceToEnd < 5) {
|
|
502
|
+
// For polyline, estimate the end by number of points (not path length)
|
|
503
|
+
if (pointsArr.length >= MAX_FREE_TRACE_POINTS) {
|
|
468
504
|
this.moveToNextPath(state);
|
|
469
505
|
state.currentFreePath[state.currentPathIndex] = null; // Reset free path for next path
|
|
506
|
+
state.currentFreePolylinePoints[state.currentPathIndex] = [];
|
|
507
|
+
state.freeTracePointsCount = 0;
|
|
470
508
|
}
|
|
471
509
|
// this.resetIdleTimer(state); // ← keep timer alive
|
|
472
510
|
return; // Exit early since we're in free trace or blind free trace mode
|
|
@@ -474,24 +512,57 @@ export class LidoTrace {
|
|
|
474
512
|
// In normal modes, allow movement and drawing only within the general proximity threshold
|
|
475
513
|
if (state.isDragging && closestPoint.length >= state.lastLength) {
|
|
476
514
|
state.lastLength = closestPoint.length;
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
515
|
+
// Only update the circle if it moved enough
|
|
516
|
+
if (Math.abs(closestPoint.x - circlePos.x) > MOVE_THRESHOLD || Math.abs(closestPoint.y - circlePos.y) > MOVE_THRESHOLD) {
|
|
517
|
+
state.circle.setAttribute('cx', closestPoint.x.toString());
|
|
518
|
+
state.circle.setAttribute('cy', closestPoint.y.toString());
|
|
519
|
+
}
|
|
520
|
+
// Only re-append if not already children list
|
|
521
|
+
const childNodes = (_d = state.svg) === null || _d === void 0 ? void 0 : _d.childNodes;
|
|
522
|
+
let circleFound = false;
|
|
523
|
+
for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
|
|
524
|
+
const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
|
|
525
|
+
if (child && child.tagName === 'circle') {
|
|
526
|
+
circleFound = true;
|
|
527
|
+
break; // No need to continue once found
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
// If not found, append the circle
|
|
531
|
+
if (!circleFound && state.circle) {
|
|
532
|
+
(_e = state.svg) === null || _e === void 0 ? void 0 : _e.appendChild(state.circle);
|
|
533
|
+
}
|
|
534
|
+
(_f = currentPath.greenPath) === null || _f === void 0 ? void 0 : _f.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
|
|
535
|
+
// Completion logic for closed paths: only allow completion if almost all points are traced
|
|
536
|
+
const COMPLETION_THRESHOLD = 0.90; // 90% of the path must be traced
|
|
537
|
+
let percentComplete = state.lastLength / state.totalPathLength;
|
|
538
|
+
let startPoint = currentPath.getPointAtLength(0);
|
|
539
|
+
let endPoint = currentPath.getPointAtLength(currentPath.getTotalLength());
|
|
540
|
+
let pathIsClosed = this.getDistanceSquared(startPoint, endPoint) < 200; // threshold for overlap
|
|
541
|
+
if (pathIsClosed && state.totalPathLength > 50) {
|
|
542
|
+
if (percentComplete >= COMPLETION_THRESHOLD) {
|
|
543
|
+
if (state.currentPathIndex < state.paths.length - 1) {
|
|
544
|
+
this.moveToNextPath(state);
|
|
545
|
+
}
|
|
546
|
+
else if (state.currentPathIndex === state.paths.length - 1) {
|
|
547
|
+
this.moveToNextContainer();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
// For open paths, allow completion if near the end
|
|
553
|
+
if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
|
|
554
|
+
this.moveToNextPath(state);
|
|
555
|
+
}
|
|
556
|
+
else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
|
|
557
|
+
this.moveToNextContainer();
|
|
558
|
+
}
|
|
559
|
+
}
|
|
490
560
|
}
|
|
491
561
|
// this.resetIdleTimer(state); // ← keep timer alive
|
|
492
562
|
}
|
|
493
563
|
// Move to the next container after completing the current SVG
|
|
494
564
|
async moveToNextContainer() {
|
|
565
|
+
this.isDragging = false;
|
|
495
566
|
if (this.moving)
|
|
496
567
|
return; // Prevent multiple calls
|
|
497
568
|
this.moving = true; // Set moving to true to prevent re-entrance
|
|
@@ -510,9 +581,12 @@ export class LidoTrace {
|
|
|
510
581
|
this.moving = false;
|
|
511
582
|
return;
|
|
512
583
|
}
|
|
584
|
+
console.log('onCorrect:', this.onCorrect);
|
|
585
|
+
console.log('el :', this.el);
|
|
513
586
|
if (this.el && this.onCorrect) {
|
|
514
587
|
await executeActions(this.onCorrect, this.el);
|
|
515
588
|
}
|
|
589
|
+
console.log('All SVGs completed, hiding component.');
|
|
516
590
|
triggerNextContainer();
|
|
517
591
|
}
|
|
518
592
|
// Get the pointer position relative to the SVG
|
|
@@ -530,13 +604,13 @@ export class LidoTrace {
|
|
|
530
604
|
const dy = p1.y - p2.y;
|
|
531
605
|
return dx * dx + dy * dy;
|
|
532
606
|
}
|
|
533
|
-
// Find the closest point on the given path to the specified point using two-pass sampling
|
|
607
|
+
// Find the closest point on the given path to the specified point using two-pass sampling (optimized)
|
|
534
608
|
getClosestPointOnPath(pathNode, point) {
|
|
535
609
|
const pathLength = pathNode.getTotalLength();
|
|
536
610
|
let closestPoint = { x: 0, y: 0, length: 0 };
|
|
537
611
|
let minDistanceSquared = Infinity;
|
|
538
|
-
//
|
|
539
|
-
const coarseStep =
|
|
612
|
+
// Optimized: Increase coarse steps for better performance
|
|
613
|
+
const coarseStep = 40; // was 20
|
|
540
614
|
let coarseClosestPoint = { x: 0, y: 0, length: 0 };
|
|
541
615
|
let coarseMinDistanceSquared = Infinity;
|
|
542
616
|
for (let i = 0; i <= pathLength; i += coarseStep) {
|
|
@@ -552,7 +626,7 @@ export class LidoTrace {
|
|
|
552
626
|
}
|
|
553
627
|
}
|
|
554
628
|
// Second pass: fine sampling around coarseClosestPoint
|
|
555
|
-
const fineStep =
|
|
629
|
+
const fineStep = 6; // was 2
|
|
556
630
|
const searchStart = Math.max(coarseClosestPoint.length - coarseStep, 0);
|
|
557
631
|
const searchEnd = Math.min(coarseClosestPoint.length + coarseStep, pathLength);
|
|
558
632
|
for (let i = searchStart; i <= searchEnd; i += fineStep) {
|
|
@@ -712,7 +786,7 @@ export class LidoTrace {
|
|
|
712
786
|
};
|
|
713
787
|
}
|
|
714
788
|
render() {
|
|
715
|
-
return (h(Host, { key: '
|
|
789
|
+
return (h(Host, { key: '3f12119394502b6750874aaa50f43bf42e9f63cc', class: "lido-trace", id: this.id, audio: this.audio, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, tabindex: this.tabIndex, "disable-speak": this.disableSpeak }, h("div", { key: '4fddd90d12251c4020006690f8c769ab452c8f6a', style: this.style, id: "lido-svgContainer" })));
|
|
716
790
|
}
|
|
717
791
|
static get is() { return "lido-trace"; }
|
|
718
792
|
static get originalStyleUrls() {
|
|
@@ -1116,6 +1190,7 @@ export class LidoTrace {
|
|
|
1116
1190
|
"fileIndex": {},
|
|
1117
1191
|
"isDragging": {},
|
|
1118
1192
|
"activePointerId": {},
|
|
1193
|
+
"freeTraceUpdateCounter": {},
|
|
1119
1194
|
"idleTimer": {},
|
|
1120
1195
|
"fingerImg": {}
|
|
1121
1196
|
};
|
|
@@ -82,57 +82,58 @@ export const Blanks = {
|
|
|
82
82
|
function getContainerXml(args) {
|
|
83
83
|
return `
|
|
84
84
|
<main>
|
|
85
|
-
<lido-container id="lido-container" is-allow-only-correct="true" value="mainContainer1" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/fill-in-the-blanks/cloud.png" objective="${args.answer1},${args.answer2},${args.answer3},${args.answer4}" width="100%" bg-color="transparent" visible="true" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000'; " onEntry="this.justifyContent='space-around';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" after-drop="false">
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
<lido-container locale="hi" id="lido-container" is-allow-only-correct="true" value="mainContainer1" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/fill-in-the-blanks/cloud.png" objective="${args.answer1},${args.answer2},${args.answer3},${args.answer4}" width="100%" bg-color="transparent" visible="true" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000'; " onEntry="this.justifyContent='space-around';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="true" after-drop="false">
|
|
86
|
+
<lido-text id="fullSentence" visible="false" onEntry="this.display='none';" string="{full_sentence}" audio="{full_sentence_audio}"></lido-text>
|
|
87
|
+
<!-- Chimple Avatar -->
|
|
88
|
+
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.448px,portrait.402px" width="landscape.350px,portrait.398px" x="landscape.-227px, portrait.541px" y="landscape.470px, portrait.1304px" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="this.animation='leftToPlace 2.5s linear';">
|
|
88
89
|
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
89
90
|
</lido-avatar>
|
|
90
91
|
</lido-cell>
|
|
91
92
|
|
|
92
93
|
<!--Parent cell -->
|
|
93
|
-
<lido-cell layout="col" visible="true" width="100%" height="100%" bg-color="transparent">
|
|
94
|
+
<lido-cell layout="col" visible="true" width="100%" height="100%" bg-color="transparent" margin="landscape.0,portrait.-90px 0px 0px 0px">
|
|
94
95
|
<!-- heading -->
|
|
95
96
|
<lido-cell visible="true" margin="landscape.12px 0px -17px 0px, portrait.0px 0px 0px;">
|
|
96
|
-
<lido-text show-speak-icon="true" id="heading" tab-index="1" width="354px" visible="true" audio="${args.headingAudio}" string="${args.heading}" font-family="'Baloo Bhai 2'" fontColor="black" font-size="landscape.
|
|
97
|
+
<lido-text show-speak-icon="true" id="heading" tab-index="1" width="landscape.354px,portrait.433px" visible="true" audio="${args.headingAudio}" string="${args.heading}" font-family="'Baloo Bhai 2'" fontColor="black" font-size="landscape.45px, portrait.45px" bg-color="transparent" onEntry=" this.fontWeight='700';" margin="landscape.32px 0px 4px 0px,portrait.18px 0px 0px 0px">
|
|
97
98
|
</lido-text>
|
|
98
99
|
</lido-cell>
|
|
99
100
|
<!-- fill up based on image -->
|
|
100
101
|
|
|
101
|
-
<lido-cell show-speak-icon="true" audio="${args.sentenceAudio}" layout="landscape.row, portrait.col" visible="true" width="landscape.
|
|
102
|
+
<lido-cell show-speak-icon="true" audio="${args.sentenceAudio}" layout="landscape.row, portrait.col" visible="true" width="landscape.90%, portrait.100%" height="landscape.70%, portrait.80%" bg-color="white" onEntry="this.borderRadius='10px'; this.padding='8px';" margin="landscape.0 , portrait.-18px 0px 0px 0px">
|
|
102
103
|
|
|
103
104
|
<!-- image -->
|
|
104
|
-
${args.img.length === 0 ? '' : `<lido-image id="image1" disable-edit="true" visible="true" src="${args.img}" width="landscape.
|
|
105
|
+
${args.img.length === 0 ? '' : `<lido-image id="image1" disable-edit="true" visible="true" src="${args.img}" width="landscape.542px, portrait.100%" height="landscape.100%, portrait.62%" margin="landscape.0px 0px 0px 0px , portrait. 0">
|
|
105
106
|
</lido-image>`}
|
|
106
107
|
<!-- text -->
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
|
|
110
|
-
<lido-cell layout="flex" bg-Color="transparent" visible="true" height="landscape.100%,portrait.
|
|
111
|
+
<lido-cell layout="flex" bg-Color="transparent" visible="true" height="landscape.100%,portrait.80%" width="landscape.754px, portrait.100%" onEntry="this.align-content='center'; this.gap='32px';this.display='ruby';" margin="landscape.21px 0px 0px 61px, portrait.45px 6px 0px 64px">
|
|
111
112
|
|
|
112
|
-
<lido-text tab-index="2" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
113
|
-
<lido-text tab-index="3" drop-attr="stretch" id="drop1" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer1}" type="drop" is-allow-only-one-drop="true" drop-Attr="stretch" onEntry="this.border-radius='10px';this.box-shoadow=''; this.margin-right='35px';" ></lido-text>
|
|
114
|
-
<lido-text tab-index="4" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
115
|
-
<lido-text tab-index="5" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
116
|
-
<lido-text tab-index="6" drop-attr="stretch" id="drop2" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer2}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px';this.margin-top='17px'; " ></lido-text>
|
|
117
|
-
<lido-text tab-index="7" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
118
|
-
<lido-text tab-index="8" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
119
|
-
<lido-text tab-index="9" drop-attr="stretch" id="drop3" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer3}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px';this.margin-top='17px';
|
|
120
|
-
<lido-text tab-index="10" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
121
|
-
<lido-text tab-index="11" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
122
|
-
<lido-text tab-index="12" id="drop4" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer4}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px'; this.margin-top='17px';" ></lido-text>
|
|
123
|
-
<lido-text tab-index="13" font-family="'Baloo Bhai 2'" visible="true" font-size="
|
|
113
|
+
<lido-text tab-index="2" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text1}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px'; "></lido-text>
|
|
114
|
+
<lido-text tab-index="3" drop-attr="stretch" id="drop1" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer1}" type="drop" is-allow-only-one-drop="true" drop-Attr="stretch" onEntry="this.border-radius='10px';this.box-shoadow='';this.fontWeight='600'; this.margin-right='35px';" ></lido-text>
|
|
115
|
+
<lido-text tab-index="4" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text2}" bg-color="transparent" onEntry="this.position='relative';this.fontWeight='600';this.display='inline';this.boxShadow='0 0 0'; this.padding='0px 21px 0px 0px';"></lido-text>
|
|
116
|
+
<lido-text tab-index="5" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text3}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 18px 0px 0px';"></lido-text>
|
|
117
|
+
<lido-text tab-index="6" drop-attr="stretch" id="drop2" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer2}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px';this.margin-top='17px'; this.fontWeight='600';" ></lido-text>
|
|
118
|
+
<lido-text tab-index="7" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text4}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px'; "></lido-text>
|
|
119
|
+
<lido-text tab-index="8" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text5}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px'; "></lido-text>
|
|
120
|
+
<lido-text tab-index="9" drop-attr="stretch" id="drop3" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer3}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px';this.margin-top='17px'; this.fontWeight='600'; "></lido-text>
|
|
121
|
+
<lido-text tab-index="10" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text6}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px';"></lido-text>
|
|
122
|
+
<lido-text tab-index="11" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text7} " bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px'; "></lido-text>
|
|
123
|
+
<lido-text tab-index="12" id="drop4" disable-edit="true" visible="true" width="164px" height="landscape.73px,portrait.77px" value="${args.answer4}" drop-Attr="stretch" type="drop" is-allow-only-one-drop="true" onEntry="this.border-radius='10px'; this.margin-right='35px'; this.fontWeight='600'; this.margin-top='17px';" ></lido-text>
|
|
124
|
+
<lido-text tab-index="13" font-family="'Baloo Bhai 2'" visible="true" font-size="landscape.46px,portrait.45px" y="-10px" string="${args.text8}" bg-color="transparent" onEntry="this.position='relative'; this.fontWeight='600';this.display='inline'; this.padding='0px 20px 0px 0px'; "></lido-text>
|
|
124
125
|
|
|
125
126
|
</lido-cell>
|
|
126
127
|
|
|
127
128
|
</lido-cell>
|
|
128
|
-
<lido-cell layout="landscape.row, portrait.wrap" childElementsLength="4" onEntry="this.gap='28px'; this.gridTemplateColumns = 'repeat(2, 1fr)'; this.gridTemplateRows = 'repeat(2, 1fr)';" visible="true" margin="landscape.6px
|
|
129
|
-
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option1Audio}" id="option1" value="${args.option1}" tab-index="14" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='
|
|
129
|
+
<lido-cell layout="landscape.row, portrait.wrap" childElementsLength="4" onEntry="this.gap='28px'; this.gridTemplateColumns = 'repeat(2, 1fr)'; this.gridTemplateRows = 'repeat(2, 1fr)';" visible="true" margin="landscape.6px 0px 74px 0px, portrait.34px 128px 0px 130px">
|
|
130
|
+
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option1Audio}" id="option1" value="${args.option1}" tab-index="14" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='600';" width="auto" height="landscape.87px, portrait.91px" string="${args.option1}" fontColor="black" font-size="landscape.46px,portrait.45px" type="drag">
|
|
130
131
|
</lido-text>
|
|
131
|
-
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option2Audio}" id="option2" value="${args.option2}" tab-index="15" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='
|
|
132
|
+
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option2Audio}" id="option2" value="${args.option2}" tab-index="15" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='600'; " width="auto" height="landscape.87px, portrait.91px" string="${args.option2}" fontColor="black" font-size="landscape.46px,portrait.45px" type="drag">
|
|
132
133
|
</lido-text>
|
|
133
|
-
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option3Audio}" id="option3" value="${args.option3}" tab-index="16" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='
|
|
134
|
+
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option3Audio}" id="option3" value="${args.option3}" tab-index="16" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='600'; " width="auto" height="landscape.87px, portrait.91px" string="${args.option3}" fontColor="black" font-size="landscape.46px,portrait.45px" type="drag">
|
|
134
135
|
</lido-text>
|
|
135
|
-
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option4Audio}" id="option4" value="${args.option4}" tab-index="17" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='
|
|
136
|
+
<lido-text font-family="'Baloo Bhai 2'" audio="${args.option4Audio}" id="option4" value="${args.option4}" tab-index="17" visible="true" bg-color="#fcf3b1" onEntry="this.padding='0px 48px'; this.borderRadius='24px'; this.fontWeight='600';" width="auto" height="landscape.87px, portrait.91px" string="${args.option4}" fontColor="black" font-size="landscape.46px,portrait.45px" type="drag">
|
|
136
137
|
</lido-text>
|
|
137
138
|
</lido-cell>
|
|
138
139
|
|
|
@@ -2,6 +2,7 @@ import { html } from "lit";
|
|
|
2
2
|
const meta = {
|
|
3
3
|
title: 'Templates/letterPairing',
|
|
4
4
|
argTypes: {
|
|
5
|
+
PracticeMode: { control: 'boolean' },
|
|
5
6
|
question: { control: 'text' },
|
|
6
7
|
questionAudio: { control: {
|
|
7
8
|
type: 'file',
|
|
@@ -82,6 +83,7 @@ const meta = {
|
|
|
82
83
|
export default meta;
|
|
83
84
|
export const LetterPairing = {
|
|
84
85
|
args: {
|
|
86
|
+
PracticeMode: false,
|
|
85
87
|
question: 'Match the jump number to the number reached when skip jumping by 3.',
|
|
86
88
|
questionAudio: '',
|
|
87
89
|
dropimg1: 'https://aeakbcdznktpsbrfsgys.storage.supabase.co/v1/object/public/template-assets/LetterPair/Cat.png',
|
|
@@ -132,7 +134,7 @@ export const LetterPairing = {
|
|
|
132
134
|
};
|
|
133
135
|
function getContainerXml(args) {
|
|
134
136
|
return `<main>
|
|
135
|
-
<lido-container id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" is-allow-only-correct="
|
|
137
|
+
<lido-container id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onInCorrect="this.sleep='2000';" is-allow-only-correct="${args.PracticeMode}" objective="${args.correct1},${args.correct2},${args.correct3},${args.correct4},${args.correct5}" visible="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/phonic-tractor/bg-image.png" dropAttr="EnableAnimation">
|
|
136
138
|
<!-- Chimple Avatar -->
|
|
137
139
|
<lido-cell layout="pos" id="pos1" disableEdit="true" value="pos2" height="landscape.205px,portrait.195px" width="landscape.209px,portrait.209px" x="landscape.2%,portrait.80%" y="landscape.85px,portrait.146px" ariaHidden="true" bgColor="transparent" visible="true" onEntry="">
|
|
138
140
|
<lido-avatar id="lido-avatar" disableEdit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" altText="{chimpleCharacterRive}">
|
|
@@ -99,7 +99,7 @@ function getContainerXml(args) {
|
|
|
99
99
|
return `
|
|
100
100
|
<main>
|
|
101
101
|
|
|
102
|
-
<lido-container id="lido-container" objective="${objective}" show-drop-border="false" tab-index="1" is-allow-only-correct="${isAllowOnlyCorrect}" is-continue-on-correct="true" onCorrect="fullRrocket.animation='placeToLeft 2.5s 1s linear'; this.sleep='1000'; heading.speak='true'; " show-check="false" bg-image="
|
|
102
|
+
<lido-container id="lido-container" objective="${objective}" show-drop-border="false" tab-index="1" is-allow-only-correct="${isAllowOnlyCorrect}" is-continue-on-correct="true" onCorrect="fullRrocket.animation='placeToLeft 2.5s 1s linear'; this.sleep='1000'; heading.speak='true'; " show-check="false" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Rocket.png" visible="true" onEntry="this.overflowY='hidden'; this.overflowX='hidden'; this.background-color='transparent';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" after-drop="false" drop-action="infinite-drop">
|
|
103
103
|
<lido-cell layout="pos" id="pos1" disable-edit="true" tab-index="2" value="pos2" height="305px" width="227px" x="landscape.1270px, portrait.541px" y="landscape.-60px, portrait.250px" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="this.animation='rightToPlace 2.5s linear';">
|
|
104
104
|
<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}">
|
|
105
105
|
</lido-avatar>
|
|
@@ -30,7 +30,7 @@ export const arrangeLetters = {
|
|
|
30
30
|
};
|
|
31
31
|
function getContainerXml(args) {
|
|
32
32
|
return `<main>
|
|
33
|
-
<lido-container visible="true" objective="${args.answers}" is-continue-on-correct="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
33
|
+
<lido-container visible="true" objective="${args.answers}" is-continue-on-correct="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Arrange%20letters.png" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onEntry="this.sleep='1000'; this.slideAnimation='true';">
|
|
34
34
|
|
|
35
35
|
<!-- Chimple Avatar -->
|
|
36
36
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos1" height="landscape.372px,portrait.476px" width="landscape.366px,portrait.467px" x="landscape.71%, portrait.52%" y="landscape.105px, portrait.66%" aria-hidden="true" z="2" bg-color="transparent" type="" visible="true" audio="" onTouch="" onCorrect="">
|
|
@@ -34,7 +34,7 @@ function getContainerXml(args) {
|
|
|
34
34
|
const rightValue = escapeXml(args.rightValue);
|
|
35
35
|
return `
|
|
36
36
|
<main>
|
|
37
|
-
<lido-container visible="true" drop-action="move" objective="${objective}" equationCheck="$#lefthandle1,$#righthandle1" id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000';" show-Check="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
37
|
+
<lido-container visible="true" drop-action="move" objective="${objective}" equationCheck="$#lefthandle1,$#righthandle1" id="lido-container" onCorrect="lido-avatar.avatarAnimate='Success';this.sleep='2000';" show-Check="true" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Balancing.png" is-continue-on-correct="true">
|
|
38
38
|
<!-- Chimple Avatar -->
|
|
39
39
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.396px,portrait.400px" width="landscape.298px,portrait.369px" x="landscape.82%, portrait.32%" y="landscape.63%, portrait.78%" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
40
40
|
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
@@ -45,7 +45,7 @@ function getContainerXml(args) {
|
|
|
45
45
|
const { objective } = buildObjectiveFromNumber(args.number);
|
|
46
46
|
return `
|
|
47
47
|
<main>
|
|
48
|
-
<lido-container id="lido-container" visible="true" objective="${objective}" onCorrect="lido-avatar.avatarAnimate='Success'; sentenceText.speak='true'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" onEntry="sentenceText.speak='true';" is-continue-on-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
48
|
+
<lido-container id="lido-container" visible="true" objective="${objective}" onCorrect="lido-avatar.avatarAnimate='Success'; sentenceText.speak='true'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" onEntry="sentenceText.speak='true';" is-continue-on-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Blender.png" drop-action="infinite-drop" is-allow-only-correct="${args.isAllowOnlyCorrect}">
|
|
49
49
|
<!-- Chimple Avatar -->
|
|
50
50
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.448px,portrait.402px" width="landscape.350px,portrait.398px" x="landscape.1332px, portrait.-8%" y="landscape.547px, portrait.1%" aria-hidden="true" z="0" bg-color="transparent" visible="true" onEntry="">
|
|
51
51
|
<lido-avatar id="lido-avatar" disable-edit="true" visible="true" height="100%" width="100%" src="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/temp2/chimplecharacter.riv" alt-text="{chimpleCharacterRive}">
|
|
@@ -41,7 +41,7 @@ function getContainerXml(args) {
|
|
|
41
41
|
`)
|
|
42
42
|
.join('');
|
|
43
43
|
return `<main>
|
|
44
|
-
<lido-container id="lido-container" visible="true" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" is-continue-on-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
44
|
+
<lido-container id="lido-container" visible="true" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000';" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" is-continue-on-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Bubble%20type.png">
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
<lido-text tab-index="1" visible="false" string="Click the bubbled Letter"></lido-text>
|
|
@@ -26,7 +26,7 @@ export const calculator = {
|
|
|
26
26
|
function getContainerXml(args) {
|
|
27
27
|
return `
|
|
28
28
|
<main>
|
|
29
|
-
<lido-container visible="true" id="lido-container" objective="" equationCheck="$#numb1,$#symbol,$#numb2" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
29
|
+
<lido-container visible="true" id="lido-container" objective="" equationCheck="$#numb1,$#symbol,$#numb2" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Calculator.png" onInCorrect="lido-avatar.avatarAnimate='Fail';" is-allow-only-correct="${args.isAllowOnlyCorrect}" onCorrect="lido-avatar.avatarAnimate='Success';answer.updateCalculatorAnswer='true';this.sleep='2500';" is-continue-on-correct="${args.isContinueOnCorrect}" >
|
|
30
30
|
<lido-text visible="true" z="1" height="100px" width="400px" y="landscape.8%,portrait.-17%" x="landscape.-21%,portrait.0px" font-size="56px" font-color="white" onEntry="this.position='relative';this.font-weight='600';" string="WRITE HERE"></lido-text>
|
|
31
31
|
<lido-cell layout="col" visible="true" height="10px" width="254px" bg-color="transparent" z="1" y="landscape.18%,portrait.-15%" x="landscape.-12%,portrait.19%" onEntry="this.align-items='center'; this.jsutifyContent='space-around'; this.position='relative';">
|
|
32
32
|
<lido-text visible="true" height="100px" width="400px" id="numb1" tab-index="1" font-size="106px" font-color="black" value="${args.number1}" string="${args.number1}" y="" z="1" x="" onEntry="this.position='relative';this.font-weight='900';"></lido-text>
|
|
@@ -37,7 +37,7 @@ function getContainerXml(args) {
|
|
|
37
37
|
})
|
|
38
38
|
.join("\n");
|
|
39
39
|
return `<main>
|
|
40
|
-
<lido-container visible="true" show-next-button="true" dropAttr="math-matrix" objective="${objective}" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; all.animation='placeToLeft 1.5s linear'; this.sleep='1500';" is-continue-on-correct="true" is-allow-only-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
40
|
+
<lido-container visible="true" show-next-button="true" dropAttr="math-matrix" objective="${objective}" onCorrect="lido-avatar.avatarAnimate='Success'; this.sleep='2000'; all.animation='placeToLeft 1.5s linear'; this.sleep='1500';" is-continue-on-correct="true" is-allow-only-correct="true" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Checker%20blocks.png" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';">
|
|
41
41
|
|
|
42
42
|
<!-- Chimple Avatar -->
|
|
43
43
|
<lido-cell layout="pos" id="pos1" disable-edit="true" value="pos2" height="landscape.448px,portrait.270px" width="landscape.350px,portrait.270px" x="landscape.500px, portrait.-9%" y="landscape.522px, portrait.36%" aria-hidden="true" z="1" bg-color="transparent" visible="true" onEntry="">
|
|
@@ -19,7 +19,7 @@ function getContainerXml(args) {
|
|
|
19
19
|
const shape = generateSlots();
|
|
20
20
|
console.log("shape : ", shape);
|
|
21
21
|
return `<main>
|
|
22
|
-
<lido-container visible="true" show-next-button="true" dropAttr="math-matrix" objective="nammadha" onCorrect="this.sleep='120000';">
|
|
22
|
+
<lido-container visible="true" show-next-button="true" dropAttr="math-matrix" objective="nammadha" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Checker%20blocks.png" onCorrect="this.sleep='120000';">
|
|
23
23
|
<lido-math-matrix id="matrix3" visible="true" rows="10" cols="10" top-index="false" left-index="false" bottom-index="false" active-only-visible="false" defualtFill="100" active-bg-color="#deb3f2" clickable="false" type="checkerBlock"></lido-math-matrix>
|
|
24
24
|
|
|
25
25
|
<lido-cell visible="true" layout="pos" x="0" y="0">
|
|
@@ -96,7 +96,7 @@ export const CreateSentence = {
|
|
|
96
96
|
};
|
|
97
97
|
function getContainerXml(args) {
|
|
98
98
|
return `<main>
|
|
99
|
-
<lido-container id="lido-container" is-allow-only-correct="true" value="maincontainer" objective="${args.correct1},${args.correct2},${args.correct3},${args.correct4},${args.correct5},${args.correct6},${args.correct7},${args.correct8}" x="0" y="0" z="0" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/
|
|
99
|
+
<lido-container id="lido-container" is-allow-only-correct="true" value="maincontainer" objective="${args.correct1},${args.correct2},${args.correct3},${args.correct4},${args.correct5},${args.correct6},${args.correct7},${args.correct8}" x="0" y="0" z="0" bg-color="transparent" bg-image="https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/background-images/Create%20sentence.png" visible="true" audio="" onCorrect="lido-avatar.avatarAnimate='Success'; pos5.animation='placeToLeft 2.5s linear';pos2.animation='placeToLeft 2.5s linear'; this.sleep='2000';" onEntry="" onInCorrect="lido-avatar.avatarAnimate='Fail'; this.sleep='2000';" show-check="false" is-continue-on-correct="false" appendToDropOnCompletion="true">
|
|
100
100
|
<lido-cell visible="false" id="speak-con">
|
|
101
101
|
<lido-text id="sentenceText" string="${args.correct}"/>
|
|
102
102
|
</lido-cell>
|