lido-player 0.0.2-alpha-78 → 0.0.2-alpha-80
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/{decode-C8i5r2rz.js → decode-BoJO3btM.js} +1 -1
- package/dist/cjs/{index-BrME-8br.js → index-7Dh-uOww.js} +24 -15
- package/dist/cjs/{index-CTFlNIYW.js → index-CgaE1GjD.js} +98 -15
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/lido-avatar_22.cjs.entry.js +100 -130
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/calculator/lido-calculator.css +2 -2
- package/dist/collection/components/calculator/lido-calculator.js +4 -2
- package/dist/collection/components/container/lido-container.js +11 -1
- package/dist/collection/components/float/lido-float.js +8 -2
- package/dist/collection/components/home/lido-home.js +5 -5
- package/dist/collection/components/keyboard/lido-keyboard.js +13 -5
- package/dist/collection/components/root/lido-root.js +5 -5
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +5 -5
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +1 -1
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +12 -12
- package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +4 -4
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +1 -1
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +1 -1
- package/dist/collection/utils/customEvents.js +1 -1
- package/dist/collection/utils/utils.js +6 -0
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +4 -0
- package/dist/collection/utils/utilsHandlers/floatHandler.js +80 -10
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.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-random.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-DgB4pFUj.js → p-0px10m_v.js} +1 -1
- package/dist/components/{p-C4rRkRc8.js → p-B3HgEpJG.js} +1 -1
- package/dist/components/{p-DI3YQ1ap.js → p-BP8urjEF.js} +1 -1
- package/dist/components/p-B_riwB43.js +1 -0
- package/dist/components/{p-DDa8Yzr9.js → p-BdmwURgL.js} +1 -1
- package/dist/components/{p-C4JlwGnv.js → p-BgobUKTe.js} +1 -1
- package/dist/components/p-BlUc8I1X.js +1 -0
- package/dist/components/{p-BHL7G-y0.js → p-CFm5fhyW.js} +1 -1
- package/dist/components/{p-CeRGpl37.js → p-CLKF3KKQ.js} +1 -1
- package/dist/components/{p-CRF2oUXd.js → p-CtAIatJL.js} +1 -1
- package/dist/components/p-D03VKJGo.js +1 -0
- package/dist/components/{p-BpyuUL_l.js → p-DABXleaM.js} +1 -1
- package/dist/components/{p-DgaDcUWF.js → p-DBU82Fut.js} +1 -1
- package/dist/components/p-DfzpwbRE.js +1 -0
- package/dist/components/{p-CkriJpbA.js → p-DhMA5bRq.js} +1 -1
- package/dist/components/p-DoQSBz_M.js +1 -0
- package/dist/components/{p-BMLH8kUS.js → p-IcMu8wni.js} +1 -1
- package/dist/components/p-XuYuvQ2t.js +1 -0
- package/dist/components/p-hMN8yrUc.js +1 -0
- package/dist/components/{p-DBZ3cqpl.js → p-td_1ZVnU.js} +1 -1
- package/dist/esm/{decode-CjZMblKw.js → decode-DV1UnYqp.js} +1 -1
- package/dist/esm/{index-DoO-CWOR.js → index-CBmYf7sZ.js} +24 -15
- package/dist/esm/{index-DCps0gjn.js → index-p0FP9pjT.js} +97 -16
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +100 -130
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +2 -2
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-CBmYf7sZ.js +2 -0
- package/dist/lido-player/p-DPc00RI5.js +1 -0
- package/dist/lido-player/{p-IuhYLpZG.js → p-DShqXa4A.js} +1 -1
- package/dist/lido-player/p-dc5b0534.entry.js +1 -0
- package/dist/types/stencil-public-runtime.d.ts +3 -1
- package/dist/types/utils/constants.d.ts +7 -0
- package/dist/types/utils/utilsHandlers/floatHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-B5eWaJMV.js +0 -1
- package/dist/components/p-BLF0bf8W.js +0 -1
- package/dist/components/p-C1t5EKXt.js +0 -1
- package/dist/components/p-C6dOKhfu.js +0 -1
- package/dist/components/p-DMzmB_5i.js +0 -1
- package/dist/components/p-DdIEm_9-.js +0 -1
- package/dist/components/p-DsG2NUdT.js +0 -1
- package/dist/lido-player/p--1NtfUQc.js +0 -1
- package/dist/lido-player/p-90b611c9.entry.js +0 -1
- package/dist/lido-player/p-DoO-CWOR.js +0 -2
|
@@ -25,9 +25,22 @@ const globalScripts = () => {};
|
|
|
25
25
|
const globalStyles = "@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400..800&display=swap'); @import url('https://fonts.googleapis.com/css2?family=Baloo+Bhai+2:wght@400..800&display=swap'); body{overflow:hidden;background-position:center;background-size:cover;background-repeat:no-repeat;height:100vh}*{user-select:none}.lido-disable-check-button{pointer-events:none;background-color:#9393935c !important;color:white}.lido-element-selected{border:2px solid;background-color:#ffdf7d !important}.diagonal-target,.diagonal-drop *{transform:scale(0.8) !important;opacity:1 !important}.cloned-element{display:flex !important;position:absolute !important;filter:grayscale(100%);pointer-events:none}.removeShadow{box-shadow:0px 0px 0px 0px #ff8900 !important}.highlight-element{border:2px solid white;box-shadow:rgb(243, 77, 8) 0px 0px 40px !important}.drop-element.empty{border:4px dashed #f34d08 !important}.drop-element.filled{border:'none' !important}.drag-element{box-shadow:0px 15px 11px rgba(43, 0, 0, 0.3) !important}.drag-element.dropped{box-shadow:none !important}.click-element{background-color:var(--btn-bg-color, rgba(255, 172, 76, 1)) !important;box-shadow:var(--btn-shadow-px) var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;cursor:pointer;transition:box-shadow 0.1s ease-out, transform 0.2s ease-out;}.click-element:active{box-shadow:0px 0px 0px var(--btn-shadow-color, rgba(225, 121, 76, 1)) !important;transform:translateY(var(--btn-active));}.click-element:focus{outline:2px solid dodgerblue;outline-offset:3px}.after-drop-popup-container{width:200%;height:200%;background-color:rgba(0, 0, 0, 0.8);position:absolute;display:flex;flex-direction:row-reverse;align-items:center;justify-content:center !important;gap:80px}.after-drop-popup-drag-element{scale:1.5;border-radius:8px;transform:none !important;position:unset !important}.after-drop-popup-drop-element{scale:1.5;border:unset;border-radius:8px;transform:none !important;position:unset !important}@keyframes zoomFadeIn{0%{transform:scale(0.6);opacity:0}100%{transform:scale(1);opacity:1}}.zoom-fade-in{animation:zoomFadeIn 0.8s ease-out forwards}@keyframes zoomFadeOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0.6);opacity:0}}.zoom-fade-out{animation:zoomFadeOut 0.8s ease-in forwards}.slide-numbers{width:70px;height:70px;border:1px solid #f57139;background-color:white;font-weight:500;color:#f57139;font-size:44px;border-radius:40px;display:flex;align-items:center;justify-content:center;font-family:'Baloo Bhai 2', serif}.slide-numbers-bottom{position:absolute;display:flex;justify-content:space-around;align-items:center;bottom:-25px;width:100%;height:50px}.slide-numbers-left{position:absolute;display:flex;flex-direction:column;justify-content:space-around;height:100%;width:50px;left:-25px;bottom:0px}.lido-speak-icon{width:56px;height:56px;position:absolute;top:-25px;right:-25px;z-index:10;background-image:url(\"https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/template/audioIcon.png\");background-color:white;border:4px solid #F34D08;border-radius:16px;box-shadow:0px 4px 0px 0px #F34D08;background-size:contain;background-repeat:no-repeat;cursor:pointer}.lido-speak-icon:active{transform:translateY(8px);box-shadow:0px 0px 0px 0px !important}.lido-strong-shake{animation:strongShake 0.3s ease}.lido-scaled-shake{animation:scaledShake 0.6s ease-in-out}.lido-horizontal-shake{animation:horizontalShake 0.6s ease-in-out;border-radius:20px}.lido-vertical-shake{animation:verticalShake 0.6s ease-in-out;border-radius:20px}.lido-diagonal-shake{animation:diagonalShake 0.5s ease-in-out;border-radius:20px;will-change:transform}.lido-glow{animation:glowPulse 1s infinite alternate;transition:opacity 0.5s ease-in-out}.lido-box-highlight{animation:topToPlace 0.3s linear}.lido-display-hiddenvalue{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:80px;font-weight:1000;color:brown;-webkit-text-stroke:2px white;font-family:'Baloo Bhai 2', sans-serif;pointer-events:none}.lido-image-colorize{position:relative;display:inline-block}.lido-image-colorize::after{content:'';position:absolute;inset:0;background:var(--tint-color);mix-blend-mode:multiply;opacity:0.8;pointer-events:none;mask-image:var(--mask-url);mask-size:cover;mask-repeat:no-repeat;mask-position:center}.lido-tts-highlight-overlay{position:fixed;pointer-events:none;z-index:9999;background:linear-gradient(\r\n 180deg,\r\n rgba(255, 235, 59, 0.95),\r\n rgba(255, 214, 0, 0.95)\r\n );border-radius:6px;box-shadow:0 2px 6px rgba(0, 0, 0, 0.18),\r\n inset 0 -1px 0 rgba(255, 255, 255, 0.25);transition:left 55ms linear,\r\n top 55ms linear,\r\n width 55ms ease-out,\r\n height 55ms ease-out,\r\n opacity 80ms ease-out;opacity:0.95;will-change:transform, width, height}";
|
|
26
26
|
|
|
27
27
|
/*
|
|
28
|
-
Stencil Client Platform v4.43.
|
|
28
|
+
Stencil Client Platform v4.43.2 | MIT Licensed | https://stenciljs.com
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
|
|
32
|
+
// src/utils/get-prop-descriptor.ts
|
|
33
|
+
function getPropertyDescriptor(obj, memberName, getOnly) {
|
|
34
|
+
const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
|
|
35
|
+
while (obj && obj !== stopAt) {
|
|
36
|
+
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
37
|
+
if (desc && (!getOnly || desc.get)) return desc;
|
|
38
|
+
obj = Object.getPrototypeOf(obj);
|
|
39
|
+
}
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
31
44
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
32
45
|
var _a;
|
|
33
46
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -35,7 +48,7 @@ var reWireGetterSetter = (instance, hostRef) => {
|
|
|
35
48
|
members.map(([memberName, [memberFlags]]) => {
|
|
36
49
|
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
37
50
|
const ogValue = instance[memberName];
|
|
38
|
-
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
51
|
+
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
39
52
|
if (ogDescriptor) {
|
|
40
53
|
Object.defineProperty(instance, memberName, {
|
|
41
54
|
get() {
|
|
@@ -48,18 +61,14 @@ var reWireGetterSetter = (instance, hostRef) => {
|
|
|
48
61
|
enumerable: true
|
|
49
62
|
});
|
|
50
63
|
}
|
|
51
|
-
|
|
64
|
+
if (hostRef.$instanceValues$.has(memberName)) {
|
|
65
|
+
instance[memberName] = hostRef.$instanceValues$.get(memberName);
|
|
66
|
+
} else if (ogValue !== void 0) {
|
|
67
|
+
instance[memberName] = ogValue;
|
|
68
|
+
}
|
|
52
69
|
}
|
|
53
70
|
});
|
|
54
71
|
};
|
|
55
|
-
function getPropertyDescriptor(obj, memberName) {
|
|
56
|
-
while (obj) {
|
|
57
|
-
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
58
|
-
if (desc == null ? void 0 : desc.get) return desc;
|
|
59
|
-
obj = Object.getPrototypeOf(obj);
|
|
60
|
-
}
|
|
61
|
-
return void 0;
|
|
62
|
-
}
|
|
63
72
|
|
|
64
73
|
// src/client/client-host-ref.ts
|
|
65
74
|
var getHostRef = (ref) => {
|
|
@@ -443,7 +452,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
443
452
|
}
|
|
444
453
|
} else {
|
|
445
454
|
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
446
|
-
if (existingStyleContainer) {
|
|
455
|
+
if (existingStyleContainer && true) {
|
|
447
456
|
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
|
|
448
457
|
} else {
|
|
449
458
|
styleContainerNode.prepend(styleElm);
|
|
@@ -721,7 +730,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
721
730
|
return;
|
|
722
731
|
} else {
|
|
723
732
|
const isComplex = isComplexType(newValue);
|
|
724
|
-
if ((isProp || isComplex && newValue !== null) &&
|
|
733
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
725
734
|
try {
|
|
726
735
|
if (!elm.tagName.includes("-")) {
|
|
727
736
|
const n = newValue == null ? "" : newValue;
|
|
@@ -1585,7 +1594,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1585
1594
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1586
1595
|
members.map(([memberName, [memberFlags]]) => {
|
|
1587
1596
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1588
|
-
const { get: origGetter, set: origSetter } =
|
|
1597
|
+
const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
|
|
1589
1598
|
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1590
1599
|
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1591
1600
|
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
@@ -1847,7 +1856,7 @@ var connectedCallback = (elm) => {
|
|
|
1847
1856
|
}
|
|
1848
1857
|
if (cmpMeta.$members$) {
|
|
1849
1858
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1850
|
-
if (memberFlags & 31 /* Prop */ &&
|
|
1859
|
+
if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
|
|
1851
1860
|
const value = elm[memberName];
|
|
1852
1861
|
delete elm[memberName];
|
|
1853
1862
|
elm[memberName] = value;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$1 = require('./index-
|
|
3
|
+
var index$1 = require('./index-7Dh-uOww.js');
|
|
4
4
|
|
|
5
5
|
const DragMapKey = 'lidoDragMap';
|
|
6
6
|
const SelectedValuesKey = 'lidoSelectedValues';
|
|
@@ -117,7 +117,7 @@ function dispatchActivityEndEvent(totalIndex, currentIndex, score, rightMoves, w
|
|
|
117
117
|
dispatchCustomEvent(ActivityEndKey, { currentIndex, totalIndex, score, rightMoves, wrongMoves, timeSpentForActivity });
|
|
118
118
|
}
|
|
119
119
|
function dispatchLessonEndEvent(totalIndex, rightMoves, wrongMoves, finalScore, timeSpendForLesson) {
|
|
120
|
-
dispatchCustomEvent(LessonEndKey, { totalIndex, rightMoves, wrongMoves, finalScore, timeSpendForLesson });
|
|
120
|
+
dispatchCustomEvent(LessonEndKey, { totalIndex, rightMoves, wrongMoves, finalScore, score: finalScore, timeSpendForLesson });
|
|
121
121
|
}
|
|
122
122
|
function dispatchNextContainerEvent() {
|
|
123
123
|
dispatchCustomEvent(NextContainerKey, {});
|
|
@@ -343,6 +343,8 @@ function enableDraggingWithScaling(element) {
|
|
|
343
343
|
handlingElementFlexibleWidth(element, 'drag');
|
|
344
344
|
const onStart = (event) => {
|
|
345
345
|
var _a, _b;
|
|
346
|
+
if (container && container.getAttribute("game-completed") === "true")
|
|
347
|
+
return;
|
|
346
348
|
console.log("moving start");
|
|
347
349
|
if (isDraggingDisabled) {
|
|
348
350
|
isDragging = false;
|
|
@@ -605,6 +607,8 @@ function enableDraggingWithScaling(element) {
|
|
|
605
607
|
element.addEventListener('click', ev => {
|
|
606
608
|
if (isClicked) {
|
|
607
609
|
console.log("clicked drag elkement");
|
|
610
|
+
if (container && container.getAttribute("game-completed") === "true")
|
|
611
|
+
return;
|
|
608
612
|
onClickDropOrDragElement(element, 'drag');
|
|
609
613
|
}
|
|
610
614
|
});
|
|
@@ -7195,7 +7199,7 @@ var tanh$2 = Math.tanh || function (x) {
|
|
|
7195
7199
|
function copysign(x, y) {
|
|
7196
7200
|
var signx = true ;
|
|
7197
7201
|
var signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity;
|
|
7198
|
-
return signx ^ signy ? -
|
|
7202
|
+
return signx ^ signy ? -x : x;
|
|
7199
7203
|
}
|
|
7200
7204
|
function _toNumberOrThrow(value, onError) {
|
|
7201
7205
|
if (isNumber(value)) {
|
|
@@ -7818,7 +7822,7 @@ var EXP_LIMIT = 9e15, // 0 to 9e15
|
|
|
7818
7822
|
|
|
7819
7823
|
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
7820
7824
|
// JavaScript numbers: -324 (5e-324)
|
|
7821
|
-
minE: -
|
|
7825
|
+
minE: -EXP_LIMIT, // -1 to -EXP_LIMIT
|
|
7822
7826
|
|
|
7823
7827
|
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
7824
7828
|
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
@@ -11944,10 +11948,10 @@ function config(obj) {
|
|
|
11944
11948
|
ps = [
|
|
11945
11949
|
'precision', 1, MAX_DIGITS,
|
|
11946
11950
|
'rounding', 0, 8,
|
|
11947
|
-
'toExpNeg', -
|
|
11951
|
+
'toExpNeg', -EXP_LIMIT, 0,
|
|
11948
11952
|
'toExpPos', 0, EXP_LIMIT,
|
|
11949
11953
|
'maxE', 0, EXP_LIMIT,
|
|
11950
|
-
'minE', -
|
|
11954
|
+
'minE', -EXP_LIMIT, 0,
|
|
11951
11955
|
'modulo', 0, 9
|
|
11952
11956
|
];
|
|
11953
11957
|
|
|
@@ -71467,8 +71471,11 @@ async function handleElementClick(element) {
|
|
|
71467
71471
|
if (fillValue === 100 && !fillCompleted) {
|
|
71468
71472
|
fillCompleted = true;
|
|
71469
71473
|
container.style.pointerEvents = 'none';
|
|
71470
|
-
|
|
71471
|
-
|
|
71474
|
+
if (!container.getAttribute('game-completed') || container.getAttribute('game-completed') === 'false' || container.getAttribute('game-completed') === null || container.getAttribute('game-completed') === undefined || container.getAttribute('game-completed') === '') {
|
|
71475
|
+
container.setAttribute('game-completed', 'true');
|
|
71476
|
+
triggerNextContainer();
|
|
71477
|
+
calculateScore();
|
|
71478
|
+
}
|
|
71472
71479
|
}
|
|
71473
71480
|
else {
|
|
71474
71481
|
fillCompleted = false;
|
|
@@ -71479,40 +71486,107 @@ async function handleElementClick(element) {
|
|
|
71479
71486
|
await executeActions(onInCorrect, container);
|
|
71480
71487
|
}
|
|
71481
71488
|
}
|
|
71489
|
+
let floatDelay = 0;
|
|
71490
|
+
const laneNextStartAtMs = [];
|
|
71491
|
+
const BUBBLE_VERTICAL_GAP = 12;
|
|
71492
|
+
const BUBBLE_TIME_GAP_SECONDS = 0.5;
|
|
71493
|
+
function getEarliestLaneIndex(laneCount) {
|
|
71494
|
+
let laneIndex = 0;
|
|
71495
|
+
let earliestTime = Number.POSITIVE_INFINITY;
|
|
71496
|
+
// Find the lane that becomes available the earliest.
|
|
71497
|
+
for (let i = 0; i < laneCount; i++) {
|
|
71498
|
+
const laneTime = laneNextStartAtMs[i] || 0;
|
|
71499
|
+
if (laneTime < earliestTime) {
|
|
71500
|
+
earliestTime = laneTime;
|
|
71501
|
+
laneIndex = i;
|
|
71502
|
+
}
|
|
71503
|
+
}
|
|
71504
|
+
return laneIndex;
|
|
71505
|
+
}
|
|
71506
|
+
function resetFloatState() {
|
|
71507
|
+
// Reset all module-level float state so a fresh screen starts from initial behavior.
|
|
71508
|
+
fillCompleted = false;
|
|
71509
|
+
floatDelay = 0;
|
|
71510
|
+
laneNextStartAtMs.length = 0;
|
|
71511
|
+
}
|
|
71482
71512
|
function handleFloatElementPosition(element) {
|
|
71513
|
+
// Step 1: Resolve the main game container.
|
|
71483
71514
|
const container = document.getElementById(LidoContainer);
|
|
71484
71515
|
if (!container) {
|
|
71485
71516
|
console.error(`No container found with id: lido-container`);
|
|
71486
71517
|
return;
|
|
71487
71518
|
}
|
|
71519
|
+
// Step 2: Stop speaking highlight before repositioning.
|
|
71488
71520
|
stopHighlightForSpeakingElement(element);
|
|
71521
|
+
// Step 3: Resolve the float area that owns moving elements.
|
|
71489
71522
|
const floatContainer = container.querySelector('.lido-float');
|
|
71490
71523
|
if (!floatContainer)
|
|
71491
71524
|
return;
|
|
71525
|
+
// Step 4: Read movement direction from the container.
|
|
71492
71526
|
const direction = floatContainer.getAttribute('float-direction') || 'bottomToTop';
|
|
71527
|
+
// Step 5: Generate a random delay used by the vertical float mode.
|
|
71493
71528
|
const delay = Math.random() * 5;
|
|
71494
71529
|
// const isFirstEntry = element.getAttribute('data-entry') !== 'true';
|
|
71495
71530
|
// if (isFirstEntry) {
|
|
71496
71531
|
// element.setAttribute('data-entry', 'true');
|
|
71497
71532
|
// entryValue += 10;
|
|
71498
71533
|
// }
|
|
71534
|
+
// Step 6: Ensure element is absolutely positioned for animation.
|
|
71499
71535
|
element.style.position = 'absolute';
|
|
71500
71536
|
if (direction === 'leftToRight') {
|
|
71537
|
+
// Step 7: Prepare horizontal floating setup.
|
|
71501
71538
|
const containerHeight = floatContainer.offsetHeight;
|
|
71502
71539
|
// Add class for bubble elements to identify them later for input matching and scoring
|
|
71503
71540
|
element.classList.add("bubble-element");
|
|
71504
|
-
element.style.left =
|
|
71505
|
-
element.style.right = `${window.innerWidth +
|
|
71506
|
-
//
|
|
71507
|
-
|
|
71508
|
-
|
|
71541
|
+
element.style.left = `unset`;
|
|
71542
|
+
element.style.right = `${(1600 - window.innerWidth) + window.innerWidth + element.offsetWidth}px`;
|
|
71543
|
+
// Step 8: Split available height into lanes with a vertical gap.
|
|
71544
|
+
const laneHeight = Math.max(1, element.clientHeight + BUBBLE_VERTICAL_GAP);
|
|
71545
|
+
const laneCount = Math.max(1, Math.floor(containerHeight / laneHeight));
|
|
71546
|
+
// Keep lane timer array length in sync with current lane count.
|
|
71547
|
+
if (laneNextStartAtMs.length > laneCount) {
|
|
71548
|
+
laneNextStartAtMs.length = laneCount;
|
|
71549
|
+
}
|
|
71550
|
+
// Step 9: Find all lanes that are currently free.
|
|
71551
|
+
const now = performance.now();
|
|
71552
|
+
const availableLaneIndexes = [];
|
|
71553
|
+
for (let i = 0; i < laneCount; i++) {
|
|
71554
|
+
const laneReadyAt = laneNextStartAtMs[i] || 0;
|
|
71555
|
+
if (laneReadyAt <= now) {
|
|
71556
|
+
availableLaneIndexes.push(i);
|
|
71557
|
+
}
|
|
71558
|
+
}
|
|
71559
|
+
// Step 10: Choose a random free lane, else fallback to earliest available lane.
|
|
71560
|
+
let laneIndex = 0;
|
|
71561
|
+
if (availableLaneIndexes.length > 0) {
|
|
71562
|
+
const randomAvailableIndex = Math.floor(Math.random() * availableLaneIndexes.length);
|
|
71563
|
+
laneIndex = availableLaneIndexes[randomAvailableIndex];
|
|
71564
|
+
}
|
|
71565
|
+
else {
|
|
71566
|
+
laneIndex = getEarliestLaneIndex(laneCount);
|
|
71567
|
+
}
|
|
71568
|
+
// Step 11: Convert lane index to top position.
|
|
71569
|
+
const resolvedLaneIndex = laneIndex !== null && laneIndex !== void 0 ? laneIndex : 0;
|
|
71570
|
+
const maxTop = Math.max(0, containerHeight - element.clientHeight);
|
|
71571
|
+
const laneStep = laneCount > 1 ? maxTop / (laneCount - 1) : 0;
|
|
71572
|
+
element.style.top = `${Math.round(resolvedLaneIndex * laneStep)}px`;
|
|
71573
|
+
// Step 12: Set animation start position and compute spacing delay.
|
|
71509
71574
|
element.style.setProperty('--el-left', element.style.right);
|
|
71510
|
-
element.
|
|
71575
|
+
const timePerElement = element.offsetWidth / (container.offsetWidth / 60);
|
|
71576
|
+
const laneReadyAt = laneNextStartAtMs[resolvedLaneIndex] || 0;
|
|
71577
|
+
const laneDelaySeconds = Math.max(0, (laneReadyAt - now) / 1000);
|
|
71578
|
+
const appliedDelay = Math.max(floatDelay, laneDelaySeconds);
|
|
71579
|
+
// Step 13: Start horizontal animation and reserve lane time to avoid overlap.
|
|
71580
|
+
element.style.animation = `float-lr 40s linear ${appliedDelay}s`;
|
|
71581
|
+
laneNextStartAtMs[resolvedLaneIndex] = now + (appliedDelay + timePerElement + BUBBLE_TIME_GAP_SECONDS) * 1000;
|
|
71582
|
+
// Step 14: Reset legacy delay after applying once.
|
|
71583
|
+
floatDelay = 0;
|
|
71511
71584
|
}
|
|
71512
71585
|
else {
|
|
71586
|
+
// Step 7 (vertical mode): pick a random x-position in container.
|
|
71513
71587
|
const containerWidth = floatContainer.offsetWidth;
|
|
71514
|
-
// element.style.left = isFirstEntry ? `${entryValue}%` : `${Math.floor(Math.random() * (containerWidth - element.clientWidth))}px`;
|
|
71515
71588
|
element.style.left = `${Math.floor(Math.random() * (containerWidth - element.clientWidth))}px`;
|
|
71589
|
+
// Step 8 (vertical mode): place below viewport and animate upward.
|
|
71516
71590
|
const startTop = document.body.offsetHeight + element.offsetHeight * (1 / calculateScale());
|
|
71517
71591
|
element.style.top = `${startTop}px`;
|
|
71518
71592
|
const duration = 5 + Math.random() * 5;
|
|
@@ -71520,6 +71594,7 @@ function handleFloatElementPosition(element) {
|
|
|
71520
71594
|
element.style.animation = `float-up ${duration}s linear ${delay}s`;
|
|
71521
71595
|
element.id = 'removeShadow';
|
|
71522
71596
|
}
|
|
71597
|
+
// Step 15: Requeue the same element once current animation finishes.
|
|
71523
71598
|
element.addEventListener('animationend', () => {
|
|
71524
71599
|
element.style.animation = 'none';
|
|
71525
71600
|
handleFloatElementPosition(element);
|
|
@@ -72593,6 +72668,12 @@ async function onActivityComplete(dragElement, dropElement) {
|
|
|
72593
72668
|
await executeActions(onCorrect, dropElement, dragElement);
|
|
72594
72669
|
}
|
|
72595
72670
|
}
|
|
72671
|
+
else {
|
|
72672
|
+
const onInCorrect = dropElement.getAttribute('onInCorrect');
|
|
72673
|
+
if (onInCorrect) {
|
|
72674
|
+
await executeActions(onInCorrect, dropElement, dragElement);
|
|
72675
|
+
}
|
|
72676
|
+
}
|
|
72596
72677
|
}
|
|
72597
72678
|
let dragScore = buildDragSelectedMapFromDOM();
|
|
72598
72679
|
const sortedValues = getSortedValuesArrayFromMap(dragScore);
|
|
@@ -73472,10 +73553,12 @@ exports.matchStringPattern = matchStringPattern;
|
|
|
73472
73553
|
exports.nextUrl = nextUrl;
|
|
73473
73554
|
exports.parseProp = parseProp;
|
|
73474
73555
|
exports.prevUrl = prevUrl;
|
|
73556
|
+
exports.resetFloatState = resetFloatState;
|
|
73475
73557
|
exports.setCancelBtnPopup = setCancelBtnPopup;
|
|
73476
73558
|
exports.setVisibilityWithDelay = setVisibilityWithDelay;
|
|
73477
73559
|
exports.speakIcon = speakIcon;
|
|
73478
73560
|
exports.speakUrl = speakUrl;
|
|
73561
|
+
exports.stopHighlightForSpeakingElement = stopHighlightForSpeakingElement;
|
|
73479
73562
|
exports.storingEachActivityScore = storingEachActivityScore;
|
|
73480
73563
|
exports.tinycolor = tinycolor;
|
|
73481
73564
|
exports.triggerNextContainer = triggerNextContainer;
|