speakid-build-a-sentence 1.0.10 → 1.0.12
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/Game.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Game.d.ts","sourceRoot":"","sources":["../src/Game.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6C/B,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Game.d.ts","sourceRoot":"","sources":["../src/Game.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA6C/B,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,GAAE,SAAc,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA09BrE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import on, { useState as g, useCallback as Ee, useRef as je, useEffect as ue, Component as sn } from "react";
|
|
2
2
|
var ve = { exports: {} }, pe = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -9,12 +9,12 @@ var ve = { exports: {} }, pe = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
12
|
+
var Pe;
|
|
13
13
|
function an() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
14
|
+
if (Pe) return pe;
|
|
15
|
+
Pe = 1;
|
|
16
16
|
var p = Symbol.for("react.transitional.element"), l = Symbol.for("react.fragment");
|
|
17
|
-
function S(
|
|
17
|
+
function S(j, W, w) {
|
|
18
18
|
var P = null;
|
|
19
19
|
if (w !== void 0 && (P = "" + w), W.key !== void 0 && (P = "" + W.key), "key" in W) {
|
|
20
20
|
w = {};
|
|
@@ -23,7 +23,7 @@ function an() {
|
|
|
23
23
|
} else w = W;
|
|
24
24
|
return W = w.ref, {
|
|
25
25
|
$$typeof: p,
|
|
26
|
-
type:
|
|
26
|
+
type: j,
|
|
27
27
|
key: P,
|
|
28
28
|
ref: W !== void 0 ? W : null,
|
|
29
29
|
props: w
|
|
@@ -41,9 +41,9 @@ var fe = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
44
|
+
var He;
|
|
45
45
|
function dn() {
|
|
46
|
-
return
|
|
46
|
+
return He || (He = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
47
|
function p(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
@@ -56,7 +56,7 @@ function dn() {
|
|
|
56
56
|
return "Profiler";
|
|
57
57
|
case U:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case I:
|
|
60
60
|
return "Suspense";
|
|
61
61
|
case ae:
|
|
62
62
|
return "SuspenseList";
|
|
@@ -107,7 +107,7 @@ function dn() {
|
|
|
107
107
|
), l(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function j(e) {
|
|
111
111
|
if (e === E) return "<>";
|
|
112
112
|
if (typeof e == "object" && e !== null && e.$$typeof === J)
|
|
113
113
|
return "<...>";
|
|
@@ -189,13 +189,13 @@ function dn() {
|
|
|
189
189
|
if (b)
|
|
190
190
|
if (M(x)) {
|
|
191
191
|
for (b = 0; b < x.length; b++)
|
|
192
|
-
|
|
192
|
+
T(x[b]);
|
|
193
193
|
Object.freeze && Object.freeze(x);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else
|
|
198
|
+
else T(x);
|
|
199
199
|
if (de.call(a, "key")) {
|
|
200
200
|
x = p(e);
|
|
201
201
|
var O = Object.keys(a).filter(function(Se) {
|
|
@@ -231,13 +231,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
231
231
|
G
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function T(e) {
|
|
235
235
|
H(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === J && (e._payload.status === "fulfilled" ? H(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
236
|
}
|
|
237
237
|
function H(e) {
|
|
238
238
|
return typeof e == "object" && e !== null && e.$$typeof === oe;
|
|
239
239
|
}
|
|
240
|
-
var B =
|
|
240
|
+
var B = on, oe = Symbol.for("react.transitional.element"), ge = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), _ = Symbol.for("react.profiler"), he = Symbol.for("react.consumer"), se = Symbol.for("react.context"), me = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), ae = Symbol.for("react.suspense_list"), z = Symbol.for("react.memo"), J = Symbol.for("react.lazy"), $ = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), we = B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, de = Object.prototype.hasOwnProperty, M = Array.isArray, A = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
243
|
B = {
|
|
@@ -248,7 +248,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
248
248
|
var c, F = {}, X = B.react_stack_bottom_frame.bind(
|
|
249
249
|
B,
|
|
250
250
|
w
|
|
251
|
-
)(), xe = A(
|
|
251
|
+
)(), xe = A(j(w)), L = {};
|
|
252
252
|
fe.Fragment = E, fe.jsx = function(e, a, r) {
|
|
253
253
|
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
254
254
|
return y(
|
|
@@ -257,7 +257,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
257
257
|
r,
|
|
258
258
|
!1,
|
|
259
259
|
b ? Error("react-stack-top-frame") : X,
|
|
260
|
-
b ? A(
|
|
260
|
+
b ? A(j(e)) : xe
|
|
261
261
|
);
|
|
262
262
|
}, fe.jsxs = function(e, a, r) {
|
|
263
263
|
var b = 1e4 > we.recentlyCreatedOwnerStacks++;
|
|
@@ -267,14 +267,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
267
267
|
r,
|
|
268
268
|
!0,
|
|
269
269
|
b ? Error("react-stack-top-frame") : X,
|
|
270
|
-
b ? A(
|
|
270
|
+
b ? A(j(e)) : xe
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
273
|
})()), fe;
|
|
274
274
|
}
|
|
275
|
-
var
|
|
275
|
+
var Ce;
|
|
276
276
|
function ln() {
|
|
277
|
-
return
|
|
277
|
+
return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ve.exports = an() : ve.exports = dn()), ve.exports;
|
|
278
278
|
}
|
|
279
279
|
var s = ln();
|
|
280
280
|
const cn = `
|
|
@@ -315,7 +315,7 @@ if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes"
|
|
|
315
315
|
const p = document.createElement("style");
|
|
316
316
|
p.id = "magic-sentence-keyframes", p.innerHTML = cn, document.head.appendChild(p);
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const Ae = {
|
|
319
319
|
spin: {
|
|
320
320
|
animation: "magic-sentence-spin 1.4s linear infinite"
|
|
321
321
|
},
|
|
@@ -448,10 +448,10 @@ const Ce = {
|
|
|
448
448
|
},
|
|
449
449
|
gmHourglass: {
|
|
450
450
|
fontSize: "42px",
|
|
451
|
-
...
|
|
451
|
+
...Ae.spin
|
|
452
452
|
},
|
|
453
453
|
// ===== Анимационные стили =====
|
|
454
|
-
...
|
|
454
|
+
...Ae
|
|
455
455
|
}, un = () => {
|
|
456
456
|
const [p, l] = g([]), S = Ee((w, P, R) => {
|
|
457
457
|
const f = [];
|
|
@@ -465,7 +465,7 @@ const Ce = {
|
|
|
465
465
|
type: "characters",
|
|
466
466
|
message: "Only Latin characters, numbers, spaces and punctuation are allowed"
|
|
467
467
|
});
|
|
468
|
-
const y = R.findIndex((
|
|
468
|
+
const y = R.findIndex((T, H) => H !== P && T.toLowerCase().trim() === w.toLowerCase().trim());
|
|
469
469
|
return y !== -1 && f.push({
|
|
470
470
|
type: "duplicate",
|
|
471
471
|
message: `Duplicate sentence (same as sentence ${y + 1})`
|
|
@@ -473,7 +473,7 @@ const Ce = {
|
|
|
473
473
|
isValid: f.length === 0,
|
|
474
474
|
errors: f
|
|
475
475
|
};
|
|
476
|
-
}, []),
|
|
476
|
+
}, []), j = Ee((w) => {
|
|
477
477
|
const P = [];
|
|
478
478
|
return w.forEach((R, f) => {
|
|
479
479
|
const D = S(R, f, w);
|
|
@@ -491,7 +491,7 @@ const Ce = {
|
|
|
491
491
|
return {
|
|
492
492
|
errors: p,
|
|
493
493
|
validateSentence: S,
|
|
494
|
-
validateAllSentences:
|
|
494
|
+
validateAllSentences: j,
|
|
495
495
|
clearErrors: W
|
|
496
496
|
};
|
|
497
497
|
}, pn = (p, l, S) => l && S ? `${p} word "${l}" ${S}` : l ? `${p} word "${l}"` : p, fn = (p, l, S = ["Enter", " "]) => {
|
|
@@ -532,7 +532,7 @@ const Ce = {
|
|
|
532
532
|
`, document.head.appendChild(p);
|
|
533
533
|
}, hn = (p) => [...p].sort(() => Math.random() - 0.5);
|
|
534
534
|
function wn(p = {}) {
|
|
535
|
-
const { logoUrl: l, showLogo: S = !0, baseURL:
|
|
535
|
+
const { logoUrl: l, showLogo: S = !0, baseURL: j } = p, W = je(null), { validateAllSentences: w, errors: P } = un(), R = () => r || window.innerWidth < 768, f = () => r || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, D = (n = "medium") => {
|
|
536
536
|
if (!f())
|
|
537
537
|
return {
|
|
538
538
|
padding: "12px 24px",
|
|
@@ -563,26 +563,26 @@ function wn(p = {}) {
|
|
|
563
563
|
ue(() => (gn(), () => {
|
|
564
564
|
document.body.style.overflow = "";
|
|
565
565
|
}), []);
|
|
566
|
-
const [y,
|
|
566
|
+
const [y, T] = g("select"), [H, B] = g(null), [oe, ge] = g(null), [E, U] = g([]), [_, he] = g(0), [se, me] = g([]), [I, ae] = g([]), [z, J] = g(20), [$, V] = g(0), [we, de] = g(null), [M, A] = g(null), [c, F] = g(!1), [X, xe] = g(
|
|
567
567
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
568
|
-
), L =
|
|
568
|
+
), L = je(null), [e, a] = g({ list: null, index: null, side: null }), [r, b] = g(!1), [le, G] = g(1), [x, O] = g(null), [ce, Se] = g(!1), [q, De] = g(!1), [Z, _e] = g(!1), [Q, Oe] = g(!1), [K, ze] = g(!1), [ee, Me] = g(!1), [ne, Le] = g(!1), [te, Ne] = g(!1), [ie, Be] = g(!1);
|
|
569
569
|
ue(() => {
|
|
570
570
|
const n = () => {
|
|
571
|
-
const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, d = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366,
|
|
572
|
-
if (Se(
|
|
571
|
+
const i = window.innerWidth, t = window.innerHeight, o = i < 768 || i === 926 && t === 428 || i === 932 && t === 430, d = t < 700, v = i === 768 && t === 1024, k = i === 1024 && t === 768, u = i === 820 && t === 1180, m = i === 1180 && t === 820, re = i === 540 && t === 720, C = i === 720 && t === 540, Re = i === 1024 && t === 1366, nn = i === 1366 && t === 1024, tn = i >= 1200 && t >= 600 && !o;
|
|
572
|
+
if (Se(tn), De(v), _e(k), Oe(u), ze(m), Me(re), Le(C), Ne(Re), Be(nn), b(o), o)
|
|
573
573
|
O(null), G(1);
|
|
574
574
|
else if (d)
|
|
575
575
|
O(null), G(1);
|
|
576
576
|
else {
|
|
577
|
-
const
|
|
578
|
-
O(
|
|
577
|
+
const rn = Math.min(1e3, Math.min(i, t) * 0.9);
|
|
578
|
+
O(rn), G(1);
|
|
579
579
|
}
|
|
580
580
|
};
|
|
581
581
|
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
582
582
|
}, []);
|
|
583
583
|
const ye = (n, i, t, o) => {
|
|
584
584
|
if (c) return;
|
|
585
|
-
let d = [...se], v = [...
|
|
585
|
+
let d = [...se], v = [...I];
|
|
586
586
|
const k = n === "bank" ? d : v, u = i === "bank" ? d : v, m = k.findIndex((Re) => Re.id === t);
|
|
587
587
|
if (m === -1) return;
|
|
588
588
|
const [re] = k.splice(m, 1);
|
|
@@ -596,7 +596,7 @@ function wn(p = {}) {
|
|
|
596
596
|
const o = n.dataTransfer.getData("application/x-token") || (() => {
|
|
597
597
|
const d = n.dataTransfer.getData("text/plain");
|
|
598
598
|
if (!d) return "";
|
|
599
|
-
const v = se.some((m) => m.id === d), k =
|
|
599
|
+
const v = se.some((m) => m.id === d), k = I.some((m) => m.id === d), u = v ? "bank" : k ? "selected" : null;
|
|
600
600
|
return u ? JSON.stringify({ from: u, id: d }) : "";
|
|
601
601
|
})();
|
|
602
602
|
if (o) {
|
|
@@ -608,19 +608,19 @@ function wn(p = {}) {
|
|
|
608
608
|
}
|
|
609
609
|
a({ list: null, index: null, side: null });
|
|
610
610
|
}
|
|
611
|
-
}, Be = (n) => {
|
|
612
|
-
B(n), U(Array(n).fill("")), I("time");
|
|
613
611
|
}, $e = (n) => {
|
|
614
|
-
|
|
615
|
-
}, Fe = (n
|
|
612
|
+
B(n), U(Array(n).fill("")), T("time");
|
|
613
|
+
}, Fe = (n) => {
|
|
614
|
+
ge(n), T("type");
|
|
615
|
+
}, Ge = (n, i) => {
|
|
616
616
|
if (i.length > 41 || i && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(i))
|
|
617
617
|
return;
|
|
618
618
|
const o = [...E];
|
|
619
619
|
o[n] = i, U(o);
|
|
620
620
|
const d = w(o);
|
|
621
621
|
d.isValid || console.warn("Validation errors:", d.errors);
|
|
622
|
-
},
|
|
623
|
-
E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) =>
|
|
622
|
+
}, Ye = (n) => n.trim().replace(/\s+/g, " "), Te = (n) => n <= 3 ? 20 : n <= 5 ? 18 : n <= 7 ? 16 : n <= 9 ? 14 : 12, Ue = () => {
|
|
623
|
+
E.some((i) => i.trim().length === 0) || (U((i) => i.map((t) => Ye(t))), V(0), he(0), de(null), T("getready"));
|
|
624
624
|
};
|
|
625
625
|
ue(() => {
|
|
626
626
|
if (y === "getready") {
|
|
@@ -637,7 +637,7 @@ function wn(p = {}) {
|
|
|
637
637
|
id: `${Date.now()}-${n}-${v}-${Math.random().toString(36).slice(2)}`,
|
|
638
638
|
text: d
|
|
639
639
|
}));
|
|
640
|
-
me(o), ae([]), he(n), J(oe || 20), A(null), F(!1),
|
|
640
|
+
me(o), ae([]), he(n), J(oe || 20), A(null), F(!1), T("play");
|
|
641
641
|
};
|
|
642
642
|
ue(() => {
|
|
643
643
|
if (y === "play" && !c)
|
|
@@ -645,21 +645,21 @@ function wn(p = {}) {
|
|
|
645
645
|
L.current = window.setTimeout(() => J((n) => n - 1), 1e3);
|
|
646
646
|
else {
|
|
647
647
|
F(!0);
|
|
648
|
-
const i = E[_].trim().split(/\s+/), t =
|
|
648
|
+
const i = E[_].trim().split(/\s+/), t = I.map((u) => u.text), o = i.filter((u) => !t.includes(u)).length, d = t.filter((u) => !i.includes(u)).length, v = i.filter((u, m) => u !== t[m]).length, k = o + d + v;
|
|
649
649
|
k === 0 ? (A("correct"), N("correct"), Y("Correct! Well done!")) : k === 1 ? (A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!"));
|
|
650
650
|
}
|
|
651
651
|
return () => {
|
|
652
652
|
L.current !== null && window.clearTimeout(L.current);
|
|
653
653
|
};
|
|
654
|
-
}, [y, z, c, E, _,
|
|
655
|
-
const
|
|
654
|
+
}, [y, z, c, E, _, I]);
|
|
655
|
+
const Je = (n = !0) => {
|
|
656
656
|
if (c && n) {
|
|
657
|
-
_ + 1 < (H || 0) ? ke(_ + 1) : (
|
|
657
|
+
_ + 1 < (H || 0) ? ke(_ + 1) : (T("results"), setTimeout(() => We(), 600));
|
|
658
658
|
return;
|
|
659
659
|
}
|
|
660
660
|
if (n && !c) {
|
|
661
|
-
const t = E[_].trim().split(/\s+/), o =
|
|
662
|
-
u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (
|
|
661
|
+
const t = E[_].trim().split(/\s+/), o = I.map((m) => m.text), d = t.filter((m) => !o.includes(m)).length, v = o.filter((m) => !t.includes(m)).length, k = t.filter((m, re) => m !== o[re]).length, u = d + v + k;
|
|
662
|
+
u === 0 && z > 0 ? (V((m) => m + 1), A("correct"), N("correct"), Y("Correct! Well done!")) : u === 1 ? (V((m) => m + 0.5), A("almost"), N("half"), Y("Almost correct! Just one mistake.")) : (A("wrong"), N("wrong"), Y("Not quite right. Keep trying!")), _ + 1 < (H || 0) ? setTimeout(() => ke(_ + 1), 800) : (T("results"), setTimeout(() => We(), 600));
|
|
663
663
|
}
|
|
664
664
|
};
|
|
665
665
|
ue(() => {
|
|
@@ -701,7 +701,7 @@ function wn(p = {}) {
|
|
|
701
701
|
}), Date.now() < i ? requestAnimationFrame(k) : document.body.removeChild(o);
|
|
702
702
|
};
|
|
703
703
|
k();
|
|
704
|
-
},
|
|
704
|
+
}, Ve = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
705
705
|
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
706
706
|
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select number of rounds" }),
|
|
707
707
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
@@ -711,7 +711,7 @@ function wn(p = {}) {
|
|
|
711
711
|
}, children: [3, 4, 5].map((n) => /* @__PURE__ */ s.jsxs(
|
|
712
712
|
"button",
|
|
713
713
|
{
|
|
714
|
-
onClick: () =>
|
|
714
|
+
onClick: () => $e(n),
|
|
715
715
|
style: {
|
|
716
716
|
...h.gmButton,
|
|
717
717
|
...D("medium")
|
|
@@ -723,7 +723,7 @@ function wn(p = {}) {
|
|
|
723
723
|
},
|
|
724
724
|
n
|
|
725
725
|
)) })
|
|
726
|
-
] }),
|
|
726
|
+
] }), Xe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
727
727
|
/* @__PURE__ */ s.jsx("h1", { style: h.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
728
728
|
/* @__PURE__ */ s.jsx("p", { style: h.gmBodyM, children: "Select time per round" }),
|
|
729
729
|
/* @__PURE__ */ s.jsx("div", { style: {
|
|
@@ -733,7 +733,7 @@ function wn(p = {}) {
|
|
|
733
733
|
}, children: [15, 20, 30].map((n) => /* @__PURE__ */ s.jsxs(
|
|
734
734
|
"button",
|
|
735
735
|
{
|
|
736
|
-
onClick: () =>
|
|
736
|
+
onClick: () => Fe(n),
|
|
737
737
|
style: {
|
|
738
738
|
...h.gmButton,
|
|
739
739
|
...D("medium")
|
|
@@ -745,7 +745,7 @@ function wn(p = {}) {
|
|
|
745
745
|
},
|
|
746
746
|
n
|
|
747
747
|
)) })
|
|
748
|
-
] }),
|
|
748
|
+
] }), qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
749
749
|
/* @__PURE__ */ s.jsxs("h2", { style: { ...h.gmBodyM, marginBottom: "0px" }, children: [
|
|
750
750
|
"Type down ",
|
|
751
751
|
H,
|
|
@@ -769,7 +769,7 @@ function wn(p = {}) {
|
|
|
769
769
|
{
|
|
770
770
|
value: n,
|
|
771
771
|
placeholder: `Sentence ${i + 1}`,
|
|
772
|
-
onChange: (t) =>
|
|
772
|
+
onChange: (t) => Ge(i, t.target.value),
|
|
773
773
|
style: {
|
|
774
774
|
...h.gmInput,
|
|
775
775
|
padding: f() ? "8px 12px" : "12px 16px",
|
|
@@ -785,7 +785,7 @@ function wn(p = {}) {
|
|
|
785
785
|
/* @__PURE__ */ s.jsx(
|
|
786
786
|
"button",
|
|
787
787
|
{
|
|
788
|
-
onClick:
|
|
788
|
+
onClick: Ue,
|
|
789
789
|
disabled: E.some((n) => n.trim().length === 0),
|
|
790
790
|
style: {
|
|
791
791
|
...h.gmButton,
|
|
@@ -797,7 +797,7 @@ function wn(p = {}) {
|
|
|
797
797
|
children: "PLAY"
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
|
-
] }),
|
|
800
|
+
] }), Ze = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmReadyWrapper, children: [
|
|
801
801
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
802
802
|
...h.gmHeadline1,
|
|
803
803
|
fontSize: f() ? "36px" : "72px",
|
|
@@ -806,7 +806,7 @@ function wn(p = {}) {
|
|
|
806
806
|
animation: "pulse 1s ease-in-out infinite"
|
|
807
807
|
}, children: "GET READY" }),
|
|
808
808
|
/* @__PURE__ */ s.jsx("div", { style: h.gmHourglass, children: "⏳" })
|
|
809
|
-
] }),
|
|
809
|
+
] }), Qe = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmGameLayout, children: [
|
|
810
810
|
/* @__PURE__ */ s.jsxs("h2", { style: {
|
|
811
811
|
marginBottom: f() ? "5px" : "10px",
|
|
812
812
|
fontSize: f() ? "16px" : "20px"
|
|
@@ -931,12 +931,12 @@ function wn(p = {}) {
|
|
|
931
931
|
flexWrap: R() ? "wrap" : "nowrap",
|
|
932
932
|
alignItems: "center",
|
|
933
933
|
justifyContent: "center",
|
|
934
|
-
fontSize: `${Te(
|
|
934
|
+
fontSize: `${Te(I.length)}px`,
|
|
935
935
|
background: M === "correct" ? "#e8f5e8" : M === "almost" ? "#fff3e0" : M === "wrong" ? "#ffebee" : "#fafafa",
|
|
936
936
|
overflowX: R() ? "hidden" : "auto",
|
|
937
937
|
whiteSpace: R() ? "normal" : "nowrap"
|
|
938
938
|
},
|
|
939
|
-
children:
|
|
939
|
+
children: I.map((n, i) => /* @__PURE__ */ s.jsx(
|
|
940
940
|
"span",
|
|
941
941
|
{
|
|
942
942
|
draggable: !c,
|
|
@@ -975,7 +975,7 @@ function wn(p = {}) {
|
|
|
975
975
|
borderRight: e.list === "selected" && e.index === i && e.side === "right" ? "3px solid #3b82f6" : void 0,
|
|
976
976
|
cursor: c ? "not-allowed" : "pointer",
|
|
977
977
|
userSelect: "none",
|
|
978
|
-
fontSize: `${Te(
|
|
978
|
+
fontSize: `${Te(I.length)}px`,
|
|
979
979
|
// Адаптивный размер шрифта для слов
|
|
980
980
|
fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
|
|
981
981
|
// Более плотный шрифт
|
|
@@ -993,22 +993,22 @@ function wn(p = {}) {
|
|
|
993
993
|
/* @__PURE__ */ s.jsx(
|
|
994
994
|
"button",
|
|
995
995
|
{
|
|
996
|
-
onClick: () =>
|
|
997
|
-
disabled: !c &&
|
|
996
|
+
onClick: () => Je(!0),
|
|
997
|
+
disabled: !c && I.length === 0,
|
|
998
998
|
style: {
|
|
999
999
|
marginTop: f() ? "15px" : "30px",
|
|
1000
1000
|
fontSize: f() ? "14px" : "20px",
|
|
1001
1001
|
padding: f() ? "6px 12px" : "10px 24px",
|
|
1002
1002
|
borderRadius: f() ? "8px" : "12px",
|
|
1003
|
-
background: c ||
|
|
1003
|
+
background: c || I.length > 0 ? "#ec4c44" : "#ccc",
|
|
1004
1004
|
color: "white",
|
|
1005
1005
|
border: "none",
|
|
1006
|
-
cursor: c ||
|
|
1006
|
+
cursor: c || I.length > 0 ? "pointer" : "not-allowed"
|
|
1007
1007
|
},
|
|
1008
1008
|
children: "NEXT"
|
|
1009
1009
|
}
|
|
1010
1010
|
)
|
|
1011
|
-
] }),
|
|
1011
|
+
] }), Ke = () => /* @__PURE__ */ s.jsxs("div", { style: h.gmCenterScreen, children: [
|
|
1012
1012
|
/* @__PURE__ */ s.jsx("h1", { style: {
|
|
1013
1013
|
...h.gmHeadline1,
|
|
1014
1014
|
marginTop: (r && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || q || Z || Q || K || ee || ne || te || ie, "0px"),
|
|
@@ -1046,7 +1046,7 @@ function wn(p = {}) {
|
|
|
1046
1046
|
{
|
|
1047
1047
|
onClick: () => {
|
|
1048
1048
|
We(), N("start"), setTimeout(() => {
|
|
1049
|
-
|
|
1049
|
+
T("getready"), de(null), F(!1);
|
|
1050
1050
|
}, 800);
|
|
1051
1051
|
},
|
|
1052
1052
|
style: {
|
|
@@ -1060,7 +1060,7 @@ function wn(p = {}) {
|
|
|
1060
1060
|
"button",
|
|
1061
1061
|
{
|
|
1062
1062
|
onClick: () => {
|
|
1063
|
-
N("click"),
|
|
1063
|
+
N("click"), T("select"), B(null), ge(null), U([]), V(0), ae([]), F(!1);
|
|
1064
1064
|
},
|
|
1065
1065
|
style: {
|
|
1066
1066
|
...h.gmButton,
|
|
@@ -1070,24 +1070,7 @@ function wn(p = {}) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
)
|
|
1072
1072
|
] })
|
|
1073
|
-
] }),
|
|
1074
|
-
() => {
|
|
1075
|
-
let n = l;
|
|
1076
|
-
return n || (T ? n = `${T.endsWith("/") ? T.slice(0, -1) : T}/logo.svg` : typeof window < "u" && window.origin && (n = `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg`)), /* @__PURE__ */ s.jsx("div", { style: {
|
|
1077
|
-
...h.gmLogoFixed,
|
|
1078
|
-
display: !S || r && window.innerWidth > window.innerHeight || window.innerHeight < 700 ? "none" : "block"
|
|
1079
|
-
}, children: n ? /* @__PURE__ */ s.jsx(
|
|
1080
|
-
"img",
|
|
1081
|
-
{
|
|
1082
|
-
src: n,
|
|
1083
|
-
alt: "SPEAKID Logo",
|
|
1084
|
-
style: h.gmLogoImg,
|
|
1085
|
-
loading: "lazy"
|
|
1086
|
-
}
|
|
1087
|
-
) : /* @__PURE__ */ s.jsx("div", { style: h.gmLogoImg, children: "SPEAKID" }) });
|
|
1088
|
-
},
|
|
1089
|
-
[r, S, l, T]
|
|
1090
|
-
);
|
|
1073
|
+
] }), Ie = l || (j ? `${j.endsWith("/") ? j.slice(0, -1) : j}/logo.svg` : typeof window < "u" && window.origin ? `${window.origin}/browser/speakid/games/magic%20sentence/logo.svg` : null), en = !r && S && !(window.innerWidth > window.innerHeight) && window.innerHeight >= 700;
|
|
1091
1074
|
return /* @__PURE__ */ s.jsx(
|
|
1092
1075
|
"div",
|
|
1093
1076
|
{
|
|
@@ -1135,13 +1118,24 @@ function wn(p = {}) {
|
|
|
1135
1118
|
alignItems: "center"
|
|
1136
1119
|
},
|
|
1137
1120
|
children: /* @__PURE__ */ s.jsxs("div", { id: "magic-sentence-root", children: [
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1121
|
+
en && /* @__PURE__ */ s.jsx("div", { style: {
|
|
1122
|
+
...h.gmLogoFixed,
|
|
1123
|
+
display: "block"
|
|
1124
|
+
}, children: Ie ? /* @__PURE__ */ s.jsx(
|
|
1125
|
+
"img",
|
|
1126
|
+
{
|
|
1127
|
+
src: Ie,
|
|
1128
|
+
alt: "SPEAKID Logo",
|
|
1129
|
+
style: h.gmLogoImg,
|
|
1130
|
+
loading: "lazy"
|
|
1131
|
+
}
|
|
1132
|
+
) : /* @__PURE__ */ s.jsx("div", { style: h.gmLogoImg, children: "SPEAKID" }) }),
|
|
1133
|
+
y === "select" && Ve(),
|
|
1134
|
+
y === "time" && Xe(),
|
|
1135
|
+
y === "type" && qe(),
|
|
1136
|
+
y === "getready" && Ze(),
|
|
1137
|
+
y === "play" && Qe(),
|
|
1138
|
+
y === "results" && Ke()
|
|
1145
1139
|
] })
|
|
1146
1140
|
}
|
|
1147
1141
|
)
|