lido-player 0.0.2-alpha-49 → 0.0.2-alpha-43-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-fe562525.js → index-6a69c33a.js} +36 -3
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{lido-avatar_19.cjs.entry.js → lido-avatar_21.cjs.entry.js} +431 -180
- package/dist/cjs/lido-player.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{utils-96ce5641.js → utils-079a5e7d.js} +1032 -165
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/calculator/lido-calculator.css +87 -0
- package/dist/collection/components/calculator/lido-calculator.js +321 -0
- package/dist/collection/components/cell/lido-cell.js +1 -1
- package/dist/collection/components/column/lido-col.js +1 -1
- package/dist/collection/components/container/lido-container.js +20 -1
- package/dist/collection/components/flashCard/lido-flash-card.js +1 -1
- package/dist/collection/components/float/lido-float.js +1 -1
- package/dist/collection/components/home/lido-home.js +9 -29
- package/dist/collection/components/keyboard/lido-keyboard.js +2 -2
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +10 -2
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +226 -20
- package/dist/collection/components/position/lido-pos.js +1 -1
- package/dist/collection/components/random/lido-random.js +1 -1
- package/dist/collection/components/row/lido-row.js +1 -1
- package/dist/collection/components/scale/lido-balance.css +114 -0
- package/dist/collection/components/scale/lido-balance.js +549 -0
- package/dist/collection/components/shape/lido-shape.js +1 -1
- package/dist/collection/components/slideFill/lido-slide-fill.js +1 -1
- package/dist/collection/components/text/lido-text.js +1 -1
- package/dist/collection/components/trace/lido-trace.js +49 -128
- package/dist/collection/components/wrap/lido-wrap.js +1 -1
- package/dist/collection/css/animation.css +21 -0
- package/dist/collection/css/index.css +45 -0
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +24 -25
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +0 -3
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +67 -0
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +156 -0
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +49 -0
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +66 -0
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +65 -0
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +105 -0
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +92 -0
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +47 -0
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +59 -0
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +93 -0
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +100 -0
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +212 -0
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +6 -7
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +6 -7
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +158 -0
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +102 -0
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +94 -0
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +184 -0
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +213 -0
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +109 -0
- package/dist/collection/stories/Templates/total/total.stories.js +59 -0
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +96 -0
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +55 -0
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +5 -6
- package/dist/collection/utils/utils.js +439 -81
- package/dist/collection/utils/utilsHandlers/clickHandler.js +21 -25
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +95 -42
- package/dist/collection/utils/utilsHandlers/lidoBalanceHandler.js +67 -0
- package/dist/collection/utils/utilsHandlers/lidoCalculatorHandler.js +94 -0
- package/dist/collection/utils/utilsHandlers/matrixHandler.js +298 -0
- package/dist/collection/utils/utilsHandlers/slideHandler.js +4 -2
- package/dist/collection/utils/utilsHandlers/sortHandler.js +21 -12
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.d.ts +11 -0
- package/dist/components/lido-balance.js +6 -0
- package/dist/components/lido-calculator.d.ts +11 -0
- package/dist/components/lido-calculator.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 +32 -20
- 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-08d0deab.js +254 -0
- package/dist/components/{p-b5b6ad27.js → p-15971ede.js} +1 -1
- package/dist/components/{p-0bf92c7f.js → p-1fbdb431.js} +2 -2
- package/dist/components/{p-b43ce4e1.js → p-29bdd953.js} +2 -2
- package/dist/components/{p-b8af26e6.js → p-322acda6.js} +40 -48
- package/dist/components/{p-51943db6.js → p-3f406017.js} +2 -2
- package/dist/components/p-44808985.js +186 -0
- package/dist/components/{p-4cabbf28.js → p-52844fa4.js} +2 -2
- package/dist/components/{p-4882df37.js → p-73e31a86.js} +2 -2
- package/dist/components/{p-af54a485.js → p-74849cdd.js} +4 -4
- package/dist/components/{p-9c56f378.js → p-7f7e5672.js} +2 -2
- package/dist/components/{p-4dbae73b.js → p-835b973d.js} +2 -2
- package/dist/components/{p-b55af747.js → p-90465904.js} +50 -129
- package/dist/components/{p-cae021c6.js → p-904711c8.js} +2 -2
- package/dist/components/{p-e735dce9.js → p-9be56729.js} +5 -3
- package/dist/components/{p-cac6c8bf.js → p-afbc196f.js} +2 -2
- package/dist/components/{p-cfa2aec8.js → p-bed94c37.js} +1047 -164
- package/dist/components/{p-7f11a624.js → p-cbac3cbc.js} +1 -1
- package/dist/components/{p-61d97438.js → p-d37ab4dc.js} +2 -2
- package/dist/components/p-e36ddcc1.js +166 -0
- package/dist/components/{p-03e4cafe.js → p-e4e42677.js} +2 -2
- package/dist/esm/{index-f47852d4.js → index-170e58c7.js} +36 -4
- package/dist/esm/index.js +2 -2
- package/dist/esm/{lido-avatar_19.entry.js → lido-avatar_21.entry.js} +430 -181
- package/dist/esm/lido-player.js +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{utils-9ce243d8.js → utils-5df09162.js} +1031 -164
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-player.css +1 -1
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/p-137c99ce.js +2 -0
- package/dist/lido-player/p-7556e652.js +9 -0
- package/dist/lido-player/p-eb956325.entry.js +1 -0
- package/dist/types/components/calculator/lido-calculator.d.ts +40 -0
- package/dist/types/components/container/lido-container.d.ts +4 -0
- package/dist/types/components/home/lido-home.d.ts +0 -1
- package/dist/types/components/mathMatrix/lido-math-matrix.d.ts +24 -4
- package/dist/types/components/scale/lido-balance.d.ts +160 -0
- package/dist/types/components/trace/lido-trace.d.ts +0 -1
- package/dist/types/components.d.ts +342 -14
- package/dist/types/stories/Templates/balancing/balancing.stories.d.ts +4 -0
- package/dist/types/stories/Templates/checker-block/checkerBlock.stories.d.ts +4 -0
- package/dist/types/stories/Templates/checkerBlock/checkerBlock.stories.d.ts +4 -0
- package/dist/types/stories/Templates/fillAnswer/fill-answer.stories.d.ts +4 -0
- package/dist/types/stories/Templates/foodJar/food-jar.stories.d.ts +4 -0
- package/dist/types/stories/Templates/matchBox/matchBox.stories.d.ts +4 -0
- package/dist/types/stories/Templates/matchBox/matchBox2.stories.d.ts +4 -0
- package/dist/types/stories/Templates/matchingCard/matching-card.stories.d.ts +4 -0
- package/dist/types/stories/Templates/multiplyBeeds/multiplyBeeds.stories.d.ts +9 -0
- package/dist/types/stories/Templates/nimbleTable/nimbleTable.stories.d.ts +4 -0
- package/dist/types/stories/Templates/numberBoardTwo/numberBoardTwo.stories.d.ts +4 -0
- package/dist/types/stories/Templates/numberPair/numberPair.stories.d.ts +4 -0
- package/dist/types/stories/Templates/questionBoard/questionBoard.stories.d.ts +15 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox1.stories.d.ts +11 -0
- package/dist/types/stories/Templates/sequenceBox/sequenceBox2.stories.d.ts +11 -0
- package/dist/types/stories/Templates/shapePair/shape-pair.stories.d.ts +4 -0
- package/dist/types/stories/Templates/shapeTractor/shape-tractor.stories.d.ts +12 -0
- package/dist/types/stories/Templates/sumTogether/sumTogether.stories.d.ts +11 -0
- package/dist/types/stories/Templates/total/total.stories.d.ts +4 -0
- package/dist/types/stories/Templates/writeNumber/writeNumber.stories.d.ts +13 -0
- package/dist/types/stories/Templates/writeSet/writeSet.stories.d.ts +4 -0
- package/dist/types/utils/utils.d.ts +8 -2
- package/dist/types/utils/utilsHandlers/dragDropHandler.d.ts +4 -0
- package/dist/types/utils/utilsHandlers/lidoBalanceHandler.d.ts +2 -0
- package/dist/types/utils/utilsHandlers/lidoCalculatorHandler.d.ts +1 -0
- package/dist/types/utils/utilsHandlers/matrixHandler.d.ts +1 -0
- package/package.json +1 -1
- package/dist/components/p-a8ab771b.js +0 -160
- package/dist/lido-player/p-90212aa9.js +0 -9
- package/dist/lido-player/p-d3911ee1.entry.js +0 -1
- package/dist/lido-player/p-ddf627b0.js +0 -2
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { p as proxyCustomElement, H, i as initEventsForElement, k as parseProp, h, j as Host } from './p-bed94c37.js';
|
|
2
|
+
|
|
3
|
+
const lidoBalanceCss = "#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^=\"M78.9414\"]{fill:white}";
|
|
4
|
+
const LidoBalanceStyle0 = lidoBalanceCss;
|
|
5
|
+
|
|
6
|
+
const LidoBalance = /*@__PURE__*/ proxyCustomElement(class LidoBalance extends H {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.currentAngle = 0;
|
|
11
|
+
this.pivotimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Display%20stand.svg';
|
|
12
|
+
this.scaleimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Bar.svg';
|
|
13
|
+
this.handlerimage = 'https://aeakbcdznktpsbrfsgys.supabase.co/storage/v1/object/public/template-assets/balancing/Stands.svg';
|
|
14
|
+
this.fill = 'brown';
|
|
15
|
+
this.tilt = 0;
|
|
16
|
+
this.maxTilt = 9.5;
|
|
17
|
+
this.onEntry = '';
|
|
18
|
+
this.height = 'auto';
|
|
19
|
+
this.width = 'auto';
|
|
20
|
+
this.x = '0px';
|
|
21
|
+
this.y = '0px';
|
|
22
|
+
this.z = '0';
|
|
23
|
+
this.visible = false;
|
|
24
|
+
this.margin = '';
|
|
25
|
+
this.padding = '';
|
|
26
|
+
this.balanceSymbol = '=';
|
|
27
|
+
this.showSymbol = false;
|
|
28
|
+
this.operation = 'count';
|
|
29
|
+
this.pivotSvg = '';
|
|
30
|
+
this.scaleSvg = '';
|
|
31
|
+
this.handlerSvg = '';
|
|
32
|
+
this.style = {};
|
|
33
|
+
this.tiltf = 0;
|
|
34
|
+
this.leftVal = 0;
|
|
35
|
+
this.rightVal = 0;
|
|
36
|
+
}
|
|
37
|
+
async revealSymbol() {
|
|
38
|
+
this.showSymbol = true;
|
|
39
|
+
}
|
|
40
|
+
async hideSymbol() {
|
|
41
|
+
this.showSymbol = false;
|
|
42
|
+
}
|
|
43
|
+
async componentWillLoad() {
|
|
44
|
+
this.updateStyles();
|
|
45
|
+
this.pivotSvg = await this.fetchAndApplyFill(this.pivotimage);
|
|
46
|
+
this.scaleSvg = await this.fetchAndApplyFill(this.scaleimage);
|
|
47
|
+
this.handlerSvg = await this.fetchAndApplyFill(this.handlerimage);
|
|
48
|
+
}
|
|
49
|
+
componentDidLoad() {
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
this.animateBalance();
|
|
52
|
+
}, 4000);
|
|
53
|
+
this.leftParentEl = document.getElementById("leftparent");
|
|
54
|
+
this.rightParentEl = document.getElementById("rightparent");
|
|
55
|
+
initEventsForElement(this.el);
|
|
56
|
+
}
|
|
57
|
+
disconnectedCallback() {
|
|
58
|
+
if (this.animationFrameId != null)
|
|
59
|
+
cancelAnimationFrame(this.animationFrameId);
|
|
60
|
+
}
|
|
61
|
+
async fetchAndApplyFill(url) {
|
|
62
|
+
try {
|
|
63
|
+
const res = await fetch(url);
|
|
64
|
+
if (!res.ok)
|
|
65
|
+
return '';
|
|
66
|
+
let svg = await res.text();
|
|
67
|
+
svg = svg.replace(/fill="[^"]*"/g, '');
|
|
68
|
+
svg = svg.replace(/stroke="[^"]*"/g, '');
|
|
69
|
+
svg = svg.replace(/<svg([^>]*)>/, `<svg$1 fill="${this.fill}" stroke="${this.fill}">`);
|
|
70
|
+
return svg;
|
|
71
|
+
}
|
|
72
|
+
catch (e) {
|
|
73
|
+
console.error('SVG fetch failed:', e);
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
tiltChanged(newValue) {
|
|
78
|
+
this.tiltf = newValue;
|
|
79
|
+
}
|
|
80
|
+
async updateTilt(leftVal, rightVal) {
|
|
81
|
+
const diff = rightVal - leftVal;
|
|
82
|
+
const newTilt = Math.max(-5, Math.min(5, diff));
|
|
83
|
+
this.tiltf = newTilt;
|
|
84
|
+
}
|
|
85
|
+
animateBalance() {
|
|
86
|
+
const rotate = () => {
|
|
87
|
+
let targetAngle = (this.tiltf / 5) * this.maxTilt;
|
|
88
|
+
if (targetAngle > this.maxTilt)
|
|
89
|
+
targetAngle = this.maxTilt;
|
|
90
|
+
if (targetAngle < -this.maxTilt)
|
|
91
|
+
targetAngle = -this.maxTilt;
|
|
92
|
+
this.currentAngle += (targetAngle - this.currentAngle) * 0.1;
|
|
93
|
+
if (this.currentAngle > this.maxTilt)
|
|
94
|
+
this.currentAngle = this.maxTilt;
|
|
95
|
+
if (this.currentAngle < -this.maxTilt)
|
|
96
|
+
this.currentAngle = -this.maxTilt;
|
|
97
|
+
if (this.scaleEl) {
|
|
98
|
+
this.scaleEl.style.transform = `rotate(${this.currentAngle}deg)`;
|
|
99
|
+
this.scaleEl.style.transformOrigin = '50% 80%';
|
|
100
|
+
}
|
|
101
|
+
if (this.leftParentEl && this.rightParentEl) {
|
|
102
|
+
const maxOffset = 60;
|
|
103
|
+
const offset = (this.currentAngle / this.maxTilt) * maxOffset;
|
|
104
|
+
this.leftParentEl.style.transform = `translateY(${-offset}px)`;
|
|
105
|
+
this.rightParentEl.style.transform = `translateY(${offset}px)`;
|
|
106
|
+
}
|
|
107
|
+
if (this.leftHandleEl && this.rightHandleEl) {
|
|
108
|
+
const isPortrait = window.innerHeight > window.innerWidth;
|
|
109
|
+
const maxOffset = isPortrait ? 40 : 60;
|
|
110
|
+
const offset = (this.currentAngle / this.maxTilt) * maxOffset;
|
|
111
|
+
this.leftHandleEl.style.transform = `translateY(${-offset}px)`;
|
|
112
|
+
this.rightHandleEl.style.transform = `translateY(${offset}px)`;
|
|
113
|
+
}
|
|
114
|
+
this.animationFrameId = requestAnimationFrame(rotate);
|
|
115
|
+
};
|
|
116
|
+
rotate();
|
|
117
|
+
}
|
|
118
|
+
updateStyles() {
|
|
119
|
+
const orientation = window.innerHeight > window.innerWidth ? 'portrait' : 'landscape';
|
|
120
|
+
this.style = {
|
|
121
|
+
height: parseProp(this.height, orientation),
|
|
122
|
+
width: parseProp(this.width, orientation),
|
|
123
|
+
top: parseProp(this.y, orientation),
|
|
124
|
+
left: parseProp(this.x, orientation),
|
|
125
|
+
zIndex: this.z,
|
|
126
|
+
display: parseProp(`${this.visible}`, orientation) === "true" ? 'flex' : 'none',
|
|
127
|
+
margin: parseProp(this.margin, orientation),
|
|
128
|
+
padding: parseProp(this.padding, orientation),
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
render() {
|
|
132
|
+
return (h(Host, { key: '868cc05ae503a6e04039c615815102470eb402d4', id: "lido-balance", onEntry: this.onEntry, class: "lido-balance", tilt: this.tilt.toString(), style: this.style, operation: this.operation.toString() }, h("div", { key: '2627a49d1ad5045bd9a3ac217354c9be98f1f52b', innerHTML: this.pivotSvg, id: "pivotimg", class: "pivot" }), h("div", { key: 'c5b2432f5e3c62ebbb7f17146f18e22e7e2b29bb', innerHTML: this.scaleSvg, id: "scaleimg", class: "scale", ref: (el) => (this.scaleEl = el) }), h("div", { key: 'd5e8051aedb784189f19a1e7b0dfd645e95ed4a5', innerHTML: this.handlerSvg, id: "handlerimg", class: "handler", ref: (el) => (this.leftHandleEl = el) }), h("div", { key: '3779886d4fc8dfadc0791f69cb87df78d5f843c8', innerHTML: this.handlerSvg, id: "handimg", class: "hand", ref: (el) => (this.rightHandleEl = el) }), h("div", { key: 'df5d4094c302548bf64f166643a3f05d262d95b1', id: "balanceSymbol", class: "lido-balance-symbol", "aria-hidden": !this.showSymbol }, this.showSymbol ? this.balanceSymbol : '')));
|
|
133
|
+
}
|
|
134
|
+
get el() { return this; }
|
|
135
|
+
static get watchers() { return {
|
|
136
|
+
"tilt": ["tiltChanged"]
|
|
137
|
+
}; }
|
|
138
|
+
static get style() { return LidoBalanceStyle0; }
|
|
139
|
+
}, [0, "lido-balance", {
|
|
140
|
+
"pivotimage": [1],
|
|
141
|
+
"scaleimage": [1],
|
|
142
|
+
"handlerimage": [1],
|
|
143
|
+
"fill": [1],
|
|
144
|
+
"tilt": [2],
|
|
145
|
+
"maxTilt": [2, "max-tilt"],
|
|
146
|
+
"onEntry": [1, "on-entry"],
|
|
147
|
+
"height": [1],
|
|
148
|
+
"width": [1],
|
|
149
|
+
"x": [1],
|
|
150
|
+
"y": [1],
|
|
151
|
+
"z": [1],
|
|
152
|
+
"visible": [8],
|
|
153
|
+
"margin": [1],
|
|
154
|
+
"padding": [1],
|
|
155
|
+
"balanceSymbol": [1537, "balance-symbol"],
|
|
156
|
+
"showSymbol": [1540, "show-symbol"],
|
|
157
|
+
"operation": [1],
|
|
158
|
+
"pivotSvg": [32],
|
|
159
|
+
"scaleSvg": [32],
|
|
160
|
+
"handlerSvg": [32],
|
|
161
|
+
"style": [32],
|
|
162
|
+
"tiltf": [32],
|
|
163
|
+
"leftVal": [32],
|
|
164
|
+
"rightVal": [32],
|
|
165
|
+
"revealSymbol": [64],
|
|
166
|
+
"hideSymbol": [64],
|
|
167
|
+
"updateTilt": [64]
|
|
168
|
+
}, undefined, {
|
|
169
|
+
"tilt": ["tiltChanged"]
|
|
170
|
+
}]);
|
|
171
|
+
function defineCustomElement() {
|
|
172
|
+
if (typeof customElements === "undefined") {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const components = ["lido-balance"];
|
|
176
|
+
components.forEach(tagName => { switch (tagName) {
|
|
177
|
+
case "lido-balance":
|
|
178
|
+
if (!customElements.get(tagName)) {
|
|
179
|
+
customElements.define(tagName, LidoBalance);
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
} });
|
|
183
|
+
}
|
|
184
|
+
defineCustomElement();
|
|
185
|
+
|
|
186
|
+
export { LidoBalance as L, defineCustomElement as d };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, i as initEventsForElement,
|
|
1
|
+
import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, e as convertUrlToRelative, k as parseProp, h, j as Host } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoColCss = ".lido-col{top:var(--y, 0);left:var(--x, 0);height:var(--height, 100%);width:var(--width, 100%);background-color:var(--bgColor, #eeeeee);padding:15px;border-radius:10px;display:flex;justify-content:space-around;flex-direction:column;align-items:center}.lido-col>*{}";
|
|
4
4
|
const LidoColStyle0 = lidoColCss;
|
|
@@ -80,7 +80,7 @@ const LidoCol = /*@__PURE__*/ proxyCustomElement(class LidoCol extends H {
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
render() {
|
|
83
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: '1cf21bb1e817c9078213312aa7165423eaf54ea7', id: this.id, class: "lido-col", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, minDrops: this.minDrops, maxDrops: this.maxDrops, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry }, h("slot", { key: 'c3bc168ccccacf1425b5d93853bc27ab2962436f' })));
|
|
84
84
|
}
|
|
85
85
|
get el() { return this; }
|
|
86
86
|
static get style() { return LidoColStyle0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, e as convertUrlToRelative, d as setVisibilityWithDelay, i as initEventsForElement,
|
|
1
|
+
import { p as proxyCustomElement, H, e as convertUrlToRelative, d as setVisibilityWithDelay, i as initEventsForElement, k as parseProp, U as fraction, h, j as Host } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoSlideFillCss = ".svg-element,svg{width:100%;height:100%}";
|
|
4
4
|
const LidoSlideFillStyle0 = lidoSlideFillCss;
|
|
@@ -194,7 +194,7 @@ const LidoSlideFill = /*@__PURE__*/ proxyCustomElement(class LidoSlideFill exten
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
render() {
|
|
197
|
-
return (h(Host, { key: '
|
|
197
|
+
return (h(Host, { key: '57ee54a6a0e7d3bbac893ce535a3375ea529e75a', id: this.id, class: "lido-slide-fill", src: this.src, fill: this.fill, fillDirection: this.fillDirection, slider: this.slider, style: this.style, min: this.min, max: this.max, division: this.division, numberType: this.numberType, onEntry: this.onEntry, type: this.type, "disable-speak": this.disableSpeak }, h("div", { key: '386330e0562851f2f00aba169018c23bf5ffa4b7', innerHTML: this.svgContent, class: "svg-element" })));
|
|
198
198
|
}
|
|
199
199
|
get el() { return this; }
|
|
200
200
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, S as SelectedValuesKey, L as LidoContainer,
|
|
2
|
-
import { d as defineCustomElement$1 } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, S as SelectedValuesKey, L as LidoContainer, o as executeActions, O as triggerNextContainer, u as handleFloatElementPosition, n as storingEachActivityScore, Q as DropAction, k as parseProp, h, j as Host } from './p-bed94c37.js';
|
|
2
|
+
import { d as defineCustomElement$1 } from './p-afbc196f.js';
|
|
3
3
|
|
|
4
4
|
const lidoKeyboardCss = ".lido-keyboard{display:flex;flex-direction:column;align-items:center;gap:30px}.input-area{display:flex;gap:15px}input[type=\"text\"]{font-size:30px;font-weight:600;padding-left:20px;width:300px;height:70px;border:2px solid;background:whitesmoke;border-radius:20px;text-align:center}.keyboard-wrapper{justify-content:center;width:700px}.disabled{opacity:0.5;pointer-events:none}.key-button{background:aquamarine;font-weight:600}";
|
|
5
5
|
const LidoKeyboardStyle0 = lidoKeyboardCss;
|
|
@@ -118,10 +118,10 @@ const LidoKeyboard = /*@__PURE__*/ proxyCustomElement(class LidoKeyboard extends
|
|
|
118
118
|
const keysArray = this.keys.split(',').map(k => k.trim());
|
|
119
119
|
const container = document.getElementById(LidoContainer);
|
|
120
120
|
const showCheck = container.getAttribute('show-check') === 'true';
|
|
121
|
-
return (h(Host, { key: '
|
|
121
|
+
return (h(Host, { key: 'e4cd1fc51d8d3c87ed011120f13454bbef1883b3', class: "lido-keyboard", style: { width: this.style.width, height: this.style.height, position: 'relative', margin: this.style.margin, zIndex: this.z } }, this.keyboardInput && (h("div", { key: '114224c18345951e749db6f1eba242cc1179431f', class: "input-area" }, h("input", { key: '14741df7dc29f51420c1164ddebf60fd464fade4', type: "text", value: this.inputString, class: "input-area", readonly: true, onInput: (e) => (this.inputString = e.target.value) }), h("lido-text", { key: '3bb801fbcab03b58a628c4c365f46113e9829fdc', visible: showCheck ? 'true' : 'false', string: "<<", "bg-color": "black", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "100px", height: "70px", type: "click", onClick: () => {
|
|
122
122
|
this.inputString = this.inputString.slice(0, -1);
|
|
123
123
|
this.inputValidation(event);
|
|
124
|
-
} }), h("lido-text", { key: '
|
|
124
|
+
} }), h("lido-text", { key: '46212bcfe4e5c22744d13d8235d82bdb73bce802', visible: showCheck ? 'true' : 'false', id: "lido-checkButton", string: "Enter", "bg-color": "green", "font-color": "white", "border-radius": "20px", "font-size": "30px", width: "150px", height: "70px", type: "click" }))), this.letterLength && (h("lido-text", { key: 'a886ac1d7ceadda37eadd4bed59bd5096d46619f', visible: "true", string: `${this.numberOfClick}/${this.letterLength}`, "font-size": "60px", "font-color": "white", onEntry: "this.position='absolute'; this.right='0'; this.fontWeight='800';", x: "unset" })), h("div", { key: '5238d1dc1bafda2ffab63932d1f5d29ef449bf4b', class: "keyboard-wrapper", style: {
|
|
125
125
|
display: 'flex',
|
|
126
126
|
flexWrap: 'wrap',
|
|
127
127
|
justifyContent: 'center',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, i as initEventsForElement,
|
|
1
|
+
import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoRowCss = ".lido-row{display:flex;justify-content:space-around;align-items:center;}.lido-row>*{}";
|
|
4
4
|
const LidoRowStyle0 = lidoRowCss;
|
|
@@ -77,7 +77,7 @@ const LidoRow = /*@__PURE__*/ proxyCustomElement(class LidoRow extends H {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
render() {
|
|
80
|
-
return (h(Host, { key: '
|
|
80
|
+
return (h(Host, { key: '4c1f45afe8866df81a6a798afe348e03fa1f4292', class: "lido-row", type: this.type, "tab-index": this.tabIndex, value: this.value, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, minDrops: this.minDrops, maxDrops: this.maxDrops, audio: this.audio, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }, h("slot", { key: '194de56621025a4b1a4fdb6ccae347f34dc19fdb' })));
|
|
81
81
|
}
|
|
82
82
|
get el() { return this; }
|
|
83
83
|
static get style() { return LidoRowStyle0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, i as initEventsForElement,
|
|
1
|
+
import { p as proxyCustomElement, H, i as initEventsForElement, q as handlingChildElements, r as attachSpeakIcon, k as parseProp, h, j as Host } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoWrapCss = ".lido-wrap{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill, minmax(186px, auto))}.lido-wrap>*{padding:10px;background-color:var(--child-bg-color, #f0f0f0);box-sizing:border-box}.lido-flex{display:flex;flex-wrap:wrap;align-content:flex-start;gap:10px}";
|
|
4
4
|
const LidoWrapStyle0 = lidoWrapCss;
|
|
@@ -78,7 +78,7 @@ const LidoWrap = /*@__PURE__*/ proxyCustomElement(class LidoWrap extends H {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '7e2bb4af31b5aff0f063a9f6c3cab96cdd25f31f', class: "lido-wrap", value: this.value, type: this.type, "tab-index": this.tabIndex, style: this.style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, disableSpeak: this.disableSpeak }, h("slot", { key: '03179b28e45692e61aff0bf3634ef0a72bab0726' })));
|
|
82
82
|
}
|
|
83
83
|
get el() { return this; }
|
|
84
84
|
static get style() { return LidoWrapStyle0; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H,
|
|
1
|
+
import { p as proxyCustomElement, H, V as TraceMode, e as convertUrlToRelative, d as setVisibilityWithDelay, W as speakIcon, o as executeActions, O as triggerNextContainer, L as LidoContainer, k as parseProp, h, j as Host, X as fingerUrl } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoTraceCss = ":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}";
|
|
4
4
|
const LidoTraceStyle0 = lidoTraceCss;
|
|
@@ -36,7 +36,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
36
36
|
this.fileIndex = -1;
|
|
37
37
|
this.isDragging = false;
|
|
38
38
|
this.activePointerId = null;
|
|
39
|
-
this.freeTraceUpdateCounter = 0;
|
|
40
39
|
this.idleTimer = null;
|
|
41
40
|
this.fingerImg = null;
|
|
42
41
|
}
|
|
@@ -53,8 +52,8 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
53
52
|
circle: null,
|
|
54
53
|
paths: [],
|
|
55
54
|
svg: null,
|
|
56
|
-
proximityThreshold:
|
|
57
|
-
freeTraceProximityThreshold:
|
|
55
|
+
proximityThreshold: 100, // General proximity threshold
|
|
56
|
+
freeTraceProximityThreshold: 50, // Reduced proximity threshold for free trace
|
|
58
57
|
rafId: null,
|
|
59
58
|
pointerMoveEvent: null,
|
|
60
59
|
activePointerId: null,
|
|
@@ -390,7 +389,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
390
389
|
}
|
|
391
390
|
// Modified handlePointerMove function
|
|
392
391
|
handlePointerMove(state) {
|
|
393
|
-
var _a, _b, _c, _d
|
|
392
|
+
var _a, _b, _c, _d;
|
|
394
393
|
if (!state.isDragging)
|
|
395
394
|
return;
|
|
396
395
|
if (!state.circle || !state.paths || state.paths.length === 0)
|
|
@@ -402,15 +401,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
402
401
|
x: parseFloat(state.circle.getAttribute('cx')),
|
|
403
402
|
y: parseFloat(state.circle.getAttribute('cy')),
|
|
404
403
|
};
|
|
405
|
-
// Only update if pointer moved a minimum distance (to reduce unnecessary updates)
|
|
406
|
-
const MOVE_THRESHOLD = 1; // px
|
|
407
|
-
if (state.lastPointerPos) {
|
|
408
|
-
const dx = pointerPos.x - state.lastPointerPos.x;
|
|
409
|
-
const dy = pointerPos.y - state.lastPointerPos.y;
|
|
410
|
-
if (dx * dx + dy * dy < MOVE_THRESHOLD * MOVE_THRESHOLD) {
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
404
|
const currentPath = state.paths[state.currentPathIndex];
|
|
415
405
|
if (!currentPath) {
|
|
416
406
|
console.error('No valid path found at the current index');
|
|
@@ -438,76 +428,48 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
438
428
|
}
|
|
439
429
|
// For free trace mode and blind free trace mode, allow free drawing only if within the reduced proximity threshold
|
|
440
430
|
if (state.mode === TraceMode.FreeTrace || state.mode === TraceMode.BlindFreeTrace) {
|
|
441
|
-
// Throttle: Only update every 2nd event (for reducing excessive dom updates)
|
|
442
|
-
this.freeTraceUpdateCounter = (this.freeTraceUpdateCounter || 0) + 1;
|
|
443
|
-
if (this.freeTraceUpdateCounter % 2 !== 0) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
431
|
// Initialize the currentFreePath array if it's not created
|
|
447
432
|
if (!state.currentFreePath) {
|
|
448
433
|
state.currentFreePath = [];
|
|
449
434
|
}
|
|
450
|
-
// Create a new
|
|
435
|
+
// Create a new path element if it's the first trace for the current path index
|
|
451
436
|
if (!state.currentFreePath[state.currentPathIndex]) {
|
|
452
|
-
const
|
|
437
|
+
const newPath = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
438
|
+
// newPath.setAttribute('stroke', 'green');
|
|
453
439
|
const strokeWidth = state.paths[state.currentPathIndex].style['stroke-width'] || state.paths[state.currentPathIndex].getAttribute('stroke-width');
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
(
|
|
460
|
-
state.
|
|
461
|
-
|
|
462
|
-
state.currentFreePolylinePoints = state.currentFreePolylinePoints || [];
|
|
463
|
-
state.currentFreePolylinePoints[state.currentPathIndex] = [
|
|
464
|
-
{ x: pointerPos.x, y: pointerPos.y }
|
|
465
|
-
];
|
|
440
|
+
newPath.setAttribute('stroke-width', strokeWidth);
|
|
441
|
+
newPath.setAttribute('fill', 'none');
|
|
442
|
+
newPath.setAttribute('stroke-linecap', 'round');
|
|
443
|
+
newPath.setAttribute('stroke', 'lightgreen');
|
|
444
|
+
// Start the new path at the current pointer position
|
|
445
|
+
newPath.setAttribute('d', `M${pointerPos.x},${pointerPos.y}`);
|
|
446
|
+
(_a = state.svg) === null || _a === void 0 ? void 0 : _a.appendChild(newPath);
|
|
447
|
+
state.currentFreePath[state.currentPathIndex] = newPath;
|
|
466
448
|
// Reset lastPointerPos for the new path
|
|
467
449
|
state.lastPointerPos = pointerPos;
|
|
468
|
-
// Add a points counter to limit path growth
|
|
469
|
-
state.freeTracePointsCount = 1;
|
|
470
450
|
}
|
|
471
|
-
//
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
//
|
|
479
|
-
state.
|
|
480
|
-
let pointsArr = state.currentFreePolylinePoints[state.currentPathIndex] || [];
|
|
481
|
-
pointsArr.push({ x: pointerPos.x, y: pointerPos.y });
|
|
482
|
-
state.currentFreePolylinePoints[state.currentPathIndex] = pointsArr;
|
|
483
|
-
// Update the polyline's points attribute
|
|
484
|
-
const pointsStr = pointsArr.map(pt => `${pt.x},${pt.y}`).join(' ');
|
|
485
|
-
state.currentFreePath[state.currentPathIndex].setAttribute('points', pointsStr);
|
|
451
|
+
// Get the previous position to draw a smooth curve
|
|
452
|
+
const previousPos = state.lastPointerPos || pointerPos;
|
|
453
|
+
// Create a quadratic curve from the previous point to the current point
|
|
454
|
+
const newPathData = state.currentFreePath[state.currentPathIndex].getAttribute('d');
|
|
455
|
+
const midPointX = (previousPos.x + pointerPos.x) / 2;
|
|
456
|
+
const midPointY = (previousPos.y + pointerPos.y) / 2;
|
|
457
|
+
const updatedPathData = `${newPathData} Q ${previousPos.x},${previousPos.y} ${midPointX},${midPointY}`;
|
|
458
|
+
// Update the path's 'd' attribute with the new curve
|
|
459
|
+
state.currentFreePath[state.currentPathIndex].setAttribute('d', updatedPathData);
|
|
486
460
|
// Move the draggable circle with the freehand trace
|
|
487
461
|
state.circle.setAttribute('cx', pointerPos.x.toString());
|
|
488
462
|
state.circle.setAttribute('cy', pointerPos.y.toString());
|
|
489
|
-
//
|
|
490
|
-
|
|
491
|
-
let circleFound = false;
|
|
492
|
-
for (let i = 0; i < ((childNodes === null || childNodes === void 0 ? void 0 : childNodes.length) || 0); i++) {
|
|
493
|
-
const child = childNodes === null || childNodes === void 0 ? void 0 : childNodes.item(i);
|
|
494
|
-
if (child && child.tagName === 'circle') {
|
|
495
|
-
circleFound = true;
|
|
496
|
-
break; // No need to continue once found
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
// If not found, append the circle
|
|
500
|
-
if (!circleFound && state.circle) {
|
|
501
|
-
(_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle);
|
|
502
|
-
}
|
|
463
|
+
// Make sure the red dot (circle) is always on top
|
|
464
|
+
(_b = state.svg) === null || _b === void 0 ? void 0 : _b.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
|
|
503
465
|
// Update the last pointer position
|
|
504
466
|
state.lastPointerPos = pointerPos;
|
|
505
|
-
|
|
506
|
-
|
|
467
|
+
const currentPathLength = currentPath.getTotalLength();
|
|
468
|
+
const distanceToEnd = currentPathLength - closestPoint.length;
|
|
469
|
+
// If close to the end of the path, move to the next path
|
|
470
|
+
if (distanceToEnd < 5) {
|
|
507
471
|
this.moveToNextPath(state);
|
|
508
472
|
state.currentFreePath[state.currentPathIndex] = null; // Reset free path for next path
|
|
509
|
-
state.currentFreePolylinePoints[state.currentPathIndex] = [];
|
|
510
|
-
state.freeTracePointsCount = 0;
|
|
511
473
|
}
|
|
512
474
|
// this.resetIdleTimer(state); // ← keep timer alive
|
|
513
475
|
return; // Exit early since we're in free trace or blind free trace mode
|
|
@@ -515,62 +477,24 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
515
477
|
// In normal modes, allow movement and drawing only within the general proximity threshold
|
|
516
478
|
if (state.isDragging && closestPoint.length >= state.lastLength) {
|
|
517
479
|
state.lastLength = closestPoint.length;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
// If not found, append the circle
|
|
534
|
-
if (!circleFound && state.circle) {
|
|
535
|
-
(_e = state.svg) === null || _e === void 0 ? void 0 : _e.appendChild(state.circle);
|
|
536
|
-
}
|
|
537
|
-
(_f = currentPath.greenPath) === null || _f === void 0 ? void 0 : _f.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
|
|
538
|
-
// Completion logic for closed paths: only allow completion if almost all points are traced
|
|
539
|
-
const COMPLETION_THRESHOLD = 0.90; // 90% of the path must be traced
|
|
540
|
-
let percentComplete = state.lastLength / state.totalPathLength;
|
|
541
|
-
let startPoint = currentPath.getPointAtLength(0);
|
|
542
|
-
let endPoint = currentPath.getPointAtLength(currentPath.getTotalLength());
|
|
543
|
-
let pathIsClosed = this.getDistanceSquared(startPoint, endPoint) < 200; // threshold for overlap
|
|
544
|
-
console.log('lastLength, totalPathLength', state.lastLength, state.totalPathLength);
|
|
545
|
-
console.log('percentComplete', percentComplete);
|
|
546
|
-
console.log('startPoint, endPoint', startPoint, endPoint);
|
|
547
|
-
console.log('distance squared between start & end:', this.getDistanceSquared(startPoint, endPoint));
|
|
548
|
-
console.log('pathIsClosed:', pathIsClosed);
|
|
549
|
-
if (pathIsClosed && state.totalPathLength > 50) {
|
|
550
|
-
if (percentComplete >= COMPLETION_THRESHOLD) {
|
|
551
|
-
if (state.currentPathIndex < state.paths.length - 1) {
|
|
552
|
-
this.moveToNextPath(state);
|
|
553
|
-
}
|
|
554
|
-
else if (state.currentPathIndex === state.paths.length - 1) {
|
|
555
|
-
this.moveToNextContainer();
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
// For open paths, allow completion if near the end
|
|
561
|
-
if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
|
|
562
|
-
this.moveToNextPath(state);
|
|
563
|
-
}
|
|
564
|
-
else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
|
|
565
|
-
this.moveToNextContainer();
|
|
566
|
-
}
|
|
567
|
-
}
|
|
480
|
+
state.circle.setAttribute('cx', closestPoint.x.toString());
|
|
481
|
+
state.circle.setAttribute('cy', closestPoint.y.toString());
|
|
482
|
+
// Make sure the red dot (circle) is always on top
|
|
483
|
+
(_c = state.svg) === null || _c === void 0 ? void 0 : _c.appendChild(state.circle); // This moves the circle to the last child, making it the topmost
|
|
484
|
+
(_d = currentPath.greenPath) === null || _d === void 0 ? void 0 : _d.setAttribute('stroke-dashoffset', (state.totalPathLength - state.lastLength).toString());
|
|
485
|
+
}
|
|
486
|
+
// Check if the current path is completed
|
|
487
|
+
if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex < state.paths.length - 1) {
|
|
488
|
+
this.moveToNextPath(state);
|
|
489
|
+
}
|
|
490
|
+
else if (state.totalPathLength - 1 - state.lastLength < 5 && state.currentPathIndex === state.paths.length - 1) {
|
|
491
|
+
// this.loadAnotherSVG(state, true);
|
|
492
|
+
this.moveToNextContainer();
|
|
568
493
|
}
|
|
569
494
|
// this.resetIdleTimer(state); // ← keep timer alive
|
|
570
495
|
}
|
|
571
496
|
// Move to the next container after completing the current SVG
|
|
572
497
|
async moveToNextContainer() {
|
|
573
|
-
this.isDragging = false;
|
|
574
498
|
if (this.moving)
|
|
575
499
|
return; // Prevent multiple calls
|
|
576
500
|
this.moving = true; // Set moving to true to prevent re-entrance
|
|
@@ -581,19 +505,17 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
581
505
|
await this.playTraceAnimation();
|
|
582
506
|
}
|
|
583
507
|
console.log(`Moving to next container after SVG index: ${this.currentSvgIndex}`);
|
|
584
|
-
|
|
508
|
+
const delay = 1000; // milliseconds
|
|
585
509
|
if (this.currentSvgIndex < this.svgUrls.length - 1) {
|
|
510
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
586
511
|
this.currentSvgIndex++;
|
|
587
512
|
await this.initializeSVG();
|
|
588
513
|
this.moving = false;
|
|
589
514
|
return;
|
|
590
515
|
}
|
|
591
|
-
console.log('onCorrect:', this.onCorrect);
|
|
592
|
-
console.log('el :', this.el);
|
|
593
516
|
if (this.el && this.onCorrect) {
|
|
594
517
|
await executeActions(this.onCorrect, this.el);
|
|
595
518
|
}
|
|
596
|
-
console.log('All SVGs completed, hiding component.');
|
|
597
519
|
triggerNextContainer();
|
|
598
520
|
}
|
|
599
521
|
// Get the pointer position relative to the SVG
|
|
@@ -611,13 +533,13 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
611
533
|
const dy = p1.y - p2.y;
|
|
612
534
|
return dx * dx + dy * dy;
|
|
613
535
|
}
|
|
614
|
-
// Find the closest point on the given path to the specified point using two-pass sampling
|
|
536
|
+
// Find the closest point on the given path to the specified point using two-pass sampling
|
|
615
537
|
getClosestPointOnPath(pathNode, point) {
|
|
616
538
|
const pathLength = pathNode.getTotalLength();
|
|
617
539
|
let closestPoint = { x: 0, y: 0, length: 0 };
|
|
618
540
|
let minDistanceSquared = Infinity;
|
|
619
|
-
//
|
|
620
|
-
const coarseStep =
|
|
541
|
+
// First pass: coarse sampling
|
|
542
|
+
const coarseStep = 20; // Increased step for better performance
|
|
621
543
|
let coarseClosestPoint = { x: 0, y: 0, length: 0 };
|
|
622
544
|
let coarseMinDistanceSquared = Infinity;
|
|
623
545
|
for (let i = 0; i <= pathLength; i += coarseStep) {
|
|
@@ -633,7 +555,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
633
555
|
}
|
|
634
556
|
}
|
|
635
557
|
// Second pass: fine sampling around coarseClosestPoint
|
|
636
|
-
const fineStep =
|
|
558
|
+
const fineStep = 2; // Increased step to reduce computations
|
|
637
559
|
const searchStart = Math.max(coarseClosestPoint.length - coarseStep, 0);
|
|
638
560
|
const searchEnd = Math.min(coarseClosestPoint.length + coarseStep, pathLength);
|
|
639
561
|
for (let i = searchStart; i <= searchEnd; i += fineStep) {
|
|
@@ -793,7 +715,7 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
793
715
|
};
|
|
794
716
|
}
|
|
795
717
|
render() {
|
|
796
|
-
return (h(Host, { key: '
|
|
718
|
+
return (h(Host, { key: '6be6d97477a80afc0275eef5b17718a5f43ce358', 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: '4e650d7142c61549aec021fd2a8da4e592eaf94e', style: this.style, id: "lido-svgContainer" })));
|
|
797
719
|
}
|
|
798
720
|
static get assetsDirs() { return ["svg", "images"]; }
|
|
799
721
|
get el() { return this; }
|
|
@@ -832,7 +754,6 @@ const LidoTrace = /*@__PURE__*/ proxyCustomElement(class LidoTrace extends H {
|
|
|
832
754
|
"fileIndex": [32],
|
|
833
755
|
"isDragging": [32],
|
|
834
756
|
"activePointerId": [32],
|
|
835
|
-
"freeTraceUpdateCounter": [32],
|
|
836
757
|
"idleTimer": [32],
|
|
837
758
|
"fingerImg": [32]
|
|
838
759
|
}, undefined, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as proxyCustomElement, H, d as setVisibilityWithDelay, i as initEventsForElement, h, j as Host } from './p-
|
|
1
|
+
import { p as proxyCustomElement, H, d as setVisibilityWithDelay, i as initEventsForElement, h, j as Host } from './p-bed94c37.js';
|
|
2
2
|
|
|
3
3
|
const lidoShapeCss = ".lido-shape{position:absolute;top:var(--y);left:var(--x);display:var(--display);z-index:var(--z)}.lido-rectangle{border-radius:0}.lido-circle{width:var(--width);height:var(--width);border-radius:50%;background-color:var(--bgColor)}.lido-ellipse{width:var(--width);height:var(--height);border-radius:50%;background-color:var(--bgColor)}.lido-triangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(50% 0%, 100% 100%, 0% 100%)}.lido-rightTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--bgColor);clip-path:polygon(100% 0%, 100% 100%, 0% 100%)}.lido-leftTriangle{width:var(--triangleWidth);height:var(--triangleHeight);background-color:var(--triangleBgColor);clip-path:polygon(0% 0%, 100% 100%, 0% 100%)}.lido-parallelogram{width:var(--paralleWidth);height:var(--paralleHeight);transform:skew(20deg)}.lido-star{width:var(--starWidth);height:var(--starHeight);background-color:var(--starBgColor);clip-path:polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)}.lido-pentagon{width:var(--pentagonWidth);height:var(--pentagonHeight);background-color:var(--pentagonBgColor);clip-path:polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)}.lido-heptagon{width:var(--heptagonWidth);height:var(--heptagonHeight);background-color:var(--heptagonBgColor);clip-path:polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)}.lido-octagon{width:var(--octagonWidth);height:var(--octagonHeight);background-color:var(--octagonBgColor);clip-path:polygon(25% 0%, 75% 0%, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0% 75%, 0% 25%)}.lido-rhombus{width:var(--rhombusWidth);height:var(--rhombusHeight);background-color:var(--rhombusBgColor);clip-path:polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)}.lido-heart{height:var(--heartHeight);width:var(--heartWidth);border-image:radial-gradient(var(--heartBgColor) 69%, #0000 70%) 84.5%/50%;clip-path:polygon(-41% 0, 50% 91%, 141% 0)}";
|
|
4
4
|
const LidoShapeStyle0 = lidoShapeCss;
|
|
@@ -52,7 +52,7 @@ const LidoShape = /*@__PURE__*/ proxyCustomElement(class LidoShape extends H {
|
|
|
52
52
|
backgroundColor: this.shapeType !== 'polygon' ? this.bgColor : 'transparent', // Apply background only if not a polygon
|
|
53
53
|
margin: this.margin,
|
|
54
54
|
};
|
|
55
|
-
return (h(Host, { key: '
|
|
55
|
+
return (h(Host, { key: '6712d974e85c5d82dabb5ed0d482ece4b18af16a', class: `lido-shape ${this.shapeType}`, value: this.value, type: this.type, "tab-index": this.tabIndex, style: style, "aria-label": this.ariaLabel, "aria-hidden": this.ariaHidden, audio: this.audio, minDrops: this.minDrops, maxDrops: this.maxDrops, onTouch: this.onTouch, onCorrect: this.onCorrect, onInCorrect: this.onInCorrect, onEntry: this.onEntry, "disable-speak": this.disableSpeak }));
|
|
56
56
|
}
|
|
57
57
|
get el() { return this; }
|
|
58
58
|
static get style() { return LidoShapeStyle0; }
|