speakid-build-a-sentence 1.0.27 → 1.0.28
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import { useState as c, useCallback as ce, useRef as re, useEffect as j, useMemo as dt, Component as pt } from "react";
|
|
3
3
|
const ut = `
|
|
4
4
|
@keyframes spin {
|
|
@@ -134,13 +134,14 @@ const Ce = {
|
|
|
134
134
|
fontFamily: '"Geist", system-ui',
|
|
135
135
|
width: "160px"
|
|
136
136
|
},
|
|
137
|
-
// ✅ Обновлено только для качества логотипа (размер как в
|
|
137
|
+
// ✅ Обновлено только для качества логотипа (размер как в Hangman)
|
|
138
138
|
gmLogoFixed: {
|
|
139
139
|
position: "absolute",
|
|
140
140
|
top: "16px",
|
|
141
141
|
left: "16px",
|
|
142
142
|
width: "auto",
|
|
143
|
-
zIndex:
|
|
143
|
+
zIndex: 30,
|
|
144
|
+
// ✅ Унифицирован zIndex для консистентности
|
|
144
145
|
pointerEvents: "none",
|
|
145
146
|
background: "transparent",
|
|
146
147
|
transform: "none",
|
|
@@ -185,7 +186,7 @@ const Ce = {
|
|
|
185
186
|
type: "characters",
|
|
186
187
|
message: "Only Latin characters, numbers, spaces and punctuation are allowed"
|
|
187
188
|
});
|
|
188
|
-
const O = h.findIndex((N,
|
|
189
|
+
const O = h.findIndex((N, b) => b !== M && N.toLowerCase().trim() === k.toLowerCase().trim());
|
|
189
190
|
return O !== -1 && w.push({
|
|
190
191
|
type: "duplicate",
|
|
191
192
|
message: `Duplicate sentence (same as sentence ${O + 1})`
|
|
@@ -257,11 +258,11 @@ function kt(f = {}) {
|
|
|
257
258
|
const { logoUrl: s, showLogo: v = !0, screenHeight: H, screenWidth: $, gameCubeSize: k } = f, M = re(null), h = () => $ ?? (typeof window < "u" ? window.innerWidth : 1920), w = () => H ?? (typeof window < "u" ? window.innerHeight : 1080), { validateAllSentences: K, errors: O } = ft(), N = () => {
|
|
258
259
|
const e = h();
|
|
259
260
|
return !!(m || e < 768 || e >= 768 && e < 1300);
|
|
260
|
-
},
|
|
261
|
+
}, b = () => {
|
|
261
262
|
const e = h(), n = w();
|
|
262
263
|
return m || e < 768 || e >= 320 && e <= 932 && n >= 390 && n <= 932;
|
|
263
264
|
}, F = (e = "medium") => {
|
|
264
|
-
if (!
|
|
265
|
+
if (!b())
|
|
265
266
|
return {
|
|
266
267
|
padding: "12px 24px",
|
|
267
268
|
fontSize: "16px",
|
|
@@ -293,7 +294,7 @@ function kt(f = {}) {
|
|
|
293
294
|
const e = document.getElementById("magic-sentence-reset");
|
|
294
295
|
e && e.remove();
|
|
295
296
|
}), []);
|
|
296
|
-
const [S, z] = c("select"), [E, de] = c(null), [pe, ue] = c(null), [T, Z] = c([]), [D, fe] = c(0), [oe, me] = c([]), [I, ie] = c([]), [W, ge] = c(20), [V, G] = c(0), [yt, he] = c(null), [X, P] = c(null), [
|
|
297
|
+
const [S, z] = c("select"), [E, de] = c(null), [pe, ue] = c(null), [T, Z] = c([]), [D, fe] = c(0), [oe, me] = c([]), [I, ie] = c([]), [W, ge] = c(20), [V, G] = c(0), [yt, he] = c(null), [X, P] = c(null), [a, _] = c(!1), [xe, se] = c(!1), [ae, Te] = c(
|
|
297
298
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
298
299
|
), q = re(null), De = re(null), ye = re(0), [x, B] = c({ list: null, id: null, side: null }), [m, Re] = c(!1), [ze, U] = c(1), [be, J] = c(null), [Ee, Pe] = c(!1), [Be, Le] = c(!1), [Me, We] = c(!1), [Ae, He] = c(!1), [$e, Oe] = c(!1), [Ne, Ge] = c(!1), [Xe, je] = c(!1), [Fe, Ve] = c(!1), [qe, Ue] = c(!1), [bt, Je] = c(!1), [wt, Ye] = c(!1);
|
|
299
300
|
j(() => {
|
|
@@ -321,7 +322,7 @@ function kt(f = {}) {
|
|
|
321
322
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
322
323
|
}, [$, H, k]);
|
|
323
324
|
const Q = (e, n, t, r) => {
|
|
324
|
-
if (
|
|
325
|
+
if (a) return;
|
|
325
326
|
let o = [...oe], p = [...I];
|
|
326
327
|
const g = e === "bank" ? o : p, i = n === "bank" ? o : p, d = g.findIndex((ne) => ne.id === t);
|
|
327
328
|
if (d === -1) return;
|
|
@@ -329,7 +330,7 @@ function kt(f = {}) {
|
|
|
329
330
|
let C = r;
|
|
330
331
|
e === n && C !== null && C !== void 0 && C > d && (C = C - 1), C == null || C < 0 || C > i.length ? i.push(R) : i.splice(C, 0, R), e === "bank" ? o = g : p = g, n === "bank" ? o = i : p = i, me(o), ie(p);
|
|
331
332
|
}, Y = (e, n, t) => {
|
|
332
|
-
if (e.preventDefault(),
|
|
333
|
+
if (e.preventDefault(), a) {
|
|
333
334
|
B({ list: null, id: null, side: null });
|
|
334
335
|
return;
|
|
335
336
|
}
|
|
@@ -382,10 +383,10 @@ function kt(f = {}) {
|
|
|
382
383
|
}));
|
|
383
384
|
me(r), ie([]), fe(e), ye.current = e, ge(pe || 20), P(null), _(!1), se(!1), z("play");
|
|
384
385
|
};
|
|
385
|
-
j(() => (S === "play" && !
|
|
386
|
+
j(() => (S === "play" && !a && (q.current !== null && window.clearTimeout(q.current), W > 0 ? q.current = window.setTimeout(() => ge((e) => e - 1), 1e3) : _(!0)), () => {
|
|
386
387
|
q.current !== null && window.clearTimeout(q.current);
|
|
387
|
-
}), [S, W,
|
|
388
|
-
if (S === "play" &&
|
|
388
|
+
}), [S, W, a]), j(() => {
|
|
389
|
+
if (S === "play" && a && W === 0) {
|
|
389
390
|
const e = T[D];
|
|
390
391
|
if (!e) {
|
|
391
392
|
P(null);
|
|
@@ -394,10 +395,10 @@ function kt(f = {}) {
|
|
|
394
395
|
const n = e.trim().split(/\s+/), t = I.map((i) => i.text), r = n.filter((i) => !t.includes(i)).length, o = t.filter((i) => !n.includes(i)).length, p = n.filter((i, d) => t.includes(i) ? t[d] !== i : !1).length, g = r + o + p;
|
|
395
396
|
g === 0 ? (P("correct"), xe || (se(!0), G((i) => i + 1)), L("correct"), A("Correct! Well done!")) : g === 1 ? (P("almost"), G((i) => i + 0.5), L("half"), A("Almost correct! Just one mistake.")) : (P("wrong"), L("wrong"), A("Not quite right. Keep trying!"));
|
|
396
397
|
}
|
|
397
|
-
}, [S,
|
|
398
|
+
}, [S, a, W, T, D, I, xe]);
|
|
398
399
|
const tt = (e = !0) => {
|
|
399
400
|
if (e) {
|
|
400
|
-
if (
|
|
401
|
+
if (a) {
|
|
401
402
|
D + 1 < (E || 0) ? ee(D + 1) : (z("results"), setTimeout(() => te(), 600));
|
|
402
403
|
return;
|
|
403
404
|
}
|
|
@@ -451,14 +452,14 @@ function kt(f = {}) {
|
|
|
451
452
|
}), Date.now() < n ? requestAnimationFrame(g) : document.body.removeChild(r);
|
|
452
453
|
};
|
|
453
454
|
g();
|
|
454
|
-
}, nt = () => /* @__PURE__ */
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
455
|
+
}, nt = () => /* @__PURE__ */ y("div", { style: u.gmCenterScreen, children: [
|
|
456
|
+
/* @__PURE__ */ l("h1", { style: u.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
457
|
+
/* @__PURE__ */ l("p", { style: u.gmBodyM, children: "Select number of rounds" }),
|
|
458
|
+
/* @__PURE__ */ l("div", { style: {
|
|
458
459
|
display: "flex",
|
|
459
|
-
gap:
|
|
460
|
+
gap: b() ? "8px" : "16px",
|
|
460
461
|
justifyContent: "center"
|
|
461
|
-
}, children: [3, 4, 5].map((e) => /* @__PURE__ */
|
|
462
|
+
}, children: [3, 4, 5].map((e) => /* @__PURE__ */ y(
|
|
462
463
|
"button",
|
|
463
464
|
{
|
|
464
465
|
onClick: () => Ke(e),
|
|
@@ -473,14 +474,14 @@ function kt(f = {}) {
|
|
|
473
474
|
},
|
|
474
475
|
e
|
|
475
476
|
)) })
|
|
476
|
-
] }), rt = () => /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */
|
|
477
|
+
] }), rt = () => /* @__PURE__ */ y("div", { style: u.gmCenterScreen, children: [
|
|
478
|
+
/* @__PURE__ */ l("h1", { style: u.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
479
|
+
/* @__PURE__ */ l("p", { style: u.gmBodyM, children: "Select time per round" }),
|
|
480
|
+
/* @__PURE__ */ l("div", { style: {
|
|
480
481
|
display: "flex",
|
|
481
|
-
gap:
|
|
482
|
+
gap: b() ? "8px" : "16px",
|
|
482
483
|
justifyContent: "center"
|
|
483
|
-
}, children: [15, 20, 30].map((e) => /* @__PURE__ */
|
|
484
|
+
}, children: [15, 20, 30].map((e) => /* @__PURE__ */ y(
|
|
484
485
|
"button",
|
|
485
486
|
{
|
|
486
487
|
onClick: () => Ze(e),
|
|
@@ -495,16 +496,16 @@ function kt(f = {}) {
|
|
|
495
496
|
},
|
|
496
497
|
e
|
|
497
498
|
)) })
|
|
498
|
-
] }), ot = () => /* @__PURE__ */
|
|
499
|
-
/* @__PURE__ */
|
|
499
|
+
] }), ot = () => /* @__PURE__ */ y("div", { style: u.gmCenterScreen, children: [
|
|
500
|
+
/* @__PURE__ */ y("h2", { style: { ...u.gmBodyM, marginBottom: "0px" }, children: [
|
|
500
501
|
"Type down ",
|
|
501
502
|
E,
|
|
502
503
|
" sentence",
|
|
503
504
|
E && E > 1 ? "s" : "",
|
|
504
505
|
" for your student"
|
|
505
506
|
] }),
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ l("p", { style: { ...u.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
|
|
508
|
+
/* @__PURE__ */ l("div", { style: {
|
|
508
509
|
display: "flex",
|
|
509
510
|
flexDirection: "column",
|
|
510
511
|
gap: 12,
|
|
@@ -514,7 +515,7 @@ function kt(f = {}) {
|
|
|
514
515
|
// Минимальная ширина по содержимому
|
|
515
516
|
maxWidth: "600px"
|
|
516
517
|
// Ограничиваем максимальную ширину
|
|
517
|
-
}, children: T.map((e, n) => /* @__PURE__ */
|
|
518
|
+
}, children: T.map((e, n) => /* @__PURE__ */ l(
|
|
518
519
|
"input",
|
|
519
520
|
{
|
|
520
521
|
value: e,
|
|
@@ -522,8 +523,8 @@ function kt(f = {}) {
|
|
|
522
523
|
onChange: (t) => _e(n, t.target.value),
|
|
523
524
|
style: {
|
|
524
525
|
...u.gmInput,
|
|
525
|
-
padding:
|
|
526
|
-
fontSize:
|
|
526
|
+
padding: b() ? "8px 12px" : "12px 16px",
|
|
527
|
+
fontSize: b() ? "14px" : "16px",
|
|
527
528
|
width: "100%",
|
|
528
529
|
// Поля теперь будут шире благодаря увеличенной ширине контейнера
|
|
529
530
|
textAlign: "center"
|
|
@@ -532,7 +533,7 @@ function kt(f = {}) {
|
|
|
532
533
|
},
|
|
533
534
|
n
|
|
534
535
|
)) }),
|
|
535
|
-
/* @__PURE__ */
|
|
536
|
+
/* @__PURE__ */ l(
|
|
536
537
|
"button",
|
|
537
538
|
{
|
|
538
539
|
onClick: et,
|
|
@@ -547,36 +548,36 @@ function kt(f = {}) {
|
|
|
547
548
|
children: "PLAY"
|
|
548
549
|
}
|
|
549
550
|
)
|
|
550
|
-
] }), it = () => /* @__PURE__ */
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
] }), it = () => /* @__PURE__ */ y("div", { style: u.gmReadyWrapper, children: [
|
|
552
|
+
/* @__PURE__ */ l("h1", { style: {
|
|
552
553
|
...u.gmHeadline1,
|
|
553
554
|
color: "#ec4c44"
|
|
554
555
|
}, children: "GET READY" }),
|
|
555
|
-
/* @__PURE__ */
|
|
556
|
-
] }), st = () => /* @__PURE__ */
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
marginBottom:
|
|
559
|
-
fontSize:
|
|
556
|
+
/* @__PURE__ */ l("div", { style: u.gmHourglass, children: "⏳" })
|
|
557
|
+
] }), st = () => /* @__PURE__ */ y("div", { style: u.gmGameLayout, children: [
|
|
558
|
+
/* @__PURE__ */ y("h2", { style: {
|
|
559
|
+
marginBottom: b() ? "5px" : "10px",
|
|
560
|
+
fontSize: b() ? "16px" : "20px"
|
|
560
561
|
}, children: [
|
|
561
562
|
"Round ",
|
|
562
563
|
D + 1,
|
|
563
564
|
"/",
|
|
564
565
|
E,
|
|
565
566
|
" — ",
|
|
566
|
-
|
|
567
|
+
a ? "TIME'S UP!" : `Time: ${W}s`
|
|
567
568
|
] }),
|
|
568
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ l(
|
|
569
570
|
"div",
|
|
570
571
|
{
|
|
571
572
|
style: {
|
|
572
573
|
width: "60%",
|
|
573
|
-
height:
|
|
574
|
+
height: b() ? "8px" : "14px",
|
|
574
575
|
borderRadius: 8,
|
|
575
576
|
background: "#eee",
|
|
576
577
|
overflow: "hidden",
|
|
577
|
-
marginBottom:
|
|
578
|
+
marginBottom: b() ? "10px" : "20px"
|
|
578
579
|
},
|
|
579
|
-
children: /* @__PURE__ */
|
|
580
|
+
children: /* @__PURE__ */ l(
|
|
580
581
|
"div",
|
|
581
582
|
{
|
|
582
583
|
style: {
|
|
@@ -589,7 +590,7 @@ function kt(f = {}) {
|
|
|
589
590
|
)
|
|
590
591
|
}
|
|
591
592
|
),
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
+
/* @__PURE__ */ l(
|
|
593
594
|
"div",
|
|
594
595
|
{
|
|
595
596
|
onDragOver: (e) => e.preventDefault(),
|
|
@@ -604,15 +605,15 @@ function kt(f = {}) {
|
|
|
604
605
|
width: "100%",
|
|
605
606
|
boxSizing: "border-box"
|
|
606
607
|
},
|
|
607
|
-
children: oe.map((e, n) => /* @__PURE__ */
|
|
608
|
+
children: oe.map((e, n) => /* @__PURE__ */ l(
|
|
608
609
|
"div",
|
|
609
610
|
{
|
|
610
|
-
draggable: !
|
|
611
|
+
draggable: !a,
|
|
611
612
|
role: "button",
|
|
612
|
-
tabIndex:
|
|
613
|
-
"aria-label":
|
|
613
|
+
tabIndex: a ? -1 : 0,
|
|
614
|
+
"aria-label": a ? `Word: ${e.text} (time expired)` : mt("Drag word", e.text, "to build sentence"),
|
|
614
615
|
onDragStart: (t) => {
|
|
615
|
-
if (
|
|
616
|
+
if (a) {
|
|
616
617
|
t.preventDefault();
|
|
617
618
|
return;
|
|
618
619
|
}
|
|
@@ -622,7 +623,7 @@ function kt(f = {}) {
|
|
|
622
623
|
), t.dataTransfer.setData("text/plain", e.id), A(`Dragging word: ${e.text}`);
|
|
623
624
|
},
|
|
624
625
|
onKeyDown: (t) => {
|
|
625
|
-
|
|
626
|
+
a || gt(t, () => Q("bank", "selected", e.id, null));
|
|
626
627
|
},
|
|
627
628
|
onDragOver: (t) => t.preventDefault(),
|
|
628
629
|
onDrop: (t) => {
|
|
@@ -630,20 +631,20 @@ function kt(f = {}) {
|
|
|
630
631
|
B({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "bank", p);
|
|
631
632
|
},
|
|
632
633
|
onDragEnter: (t) => {
|
|
633
|
-
if (
|
|
634
|
+
if (a) return;
|
|
634
635
|
const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2;
|
|
635
636
|
B({ list: "bank", id: e.id, side: t.clientX > o ? "right" : "left" });
|
|
636
637
|
},
|
|
637
638
|
onDragLeave: () => B({ list: null, id: null, side: null }),
|
|
638
639
|
onClick: () => {
|
|
639
|
-
|
|
640
|
+
a || Q("bank", "selected", e.id, null);
|
|
640
641
|
},
|
|
641
642
|
style: {
|
|
642
643
|
padding: m || h() < 768 ? "6px 10px" : "10px 16px",
|
|
643
644
|
borderRadius: m || h() < 768 ? "6px" : "10px",
|
|
644
645
|
border: "1px solid #ccc",
|
|
645
|
-
background:
|
|
646
|
-
cursor:
|
|
646
|
+
background: a ? "#f0f0f0" : "#f9f9f9",
|
|
647
|
+
cursor: a ? "not-allowed" : x.list === "bank" && x.id === e.id ? "grabbing" : "grab",
|
|
647
648
|
fontSize: (() => {
|
|
648
649
|
const t = h();
|
|
649
650
|
return m || t < 768 ? "12px" : t >= 768 && t < 1300 ? "14px" : "18px";
|
|
@@ -652,7 +653,7 @@ function kt(f = {}) {
|
|
|
652
653
|
...x.list === "bank" && x.id === e.id && x.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
|
|
653
654
|
flexShrink: 0,
|
|
654
655
|
flexBasis: "auto",
|
|
655
|
-
opacity:
|
|
656
|
+
opacity: a ? 0.6 : 1,
|
|
656
657
|
transition: "opacity 0.3s ease, transform 0.2s ease",
|
|
657
658
|
...x.list === "bank" && x.id === e.id ? {
|
|
658
659
|
transform: "scale(1.05)",
|
|
@@ -665,7 +666,7 @@ function kt(f = {}) {
|
|
|
665
666
|
))
|
|
666
667
|
}
|
|
667
668
|
),
|
|
668
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ l(
|
|
669
670
|
"div",
|
|
670
671
|
{
|
|
671
672
|
onDragOver: (e) => e.preventDefault(),
|
|
@@ -701,12 +702,12 @@ function kt(f = {}) {
|
|
|
701
702
|
overflowX: N() ? "hidden" : "auto",
|
|
702
703
|
whiteSpace: N() ? "normal" : "nowrap"
|
|
703
704
|
},
|
|
704
|
-
children: I.map((e, n) => /* @__PURE__ */
|
|
705
|
+
children: I.map((e, n) => /* @__PURE__ */ l(
|
|
705
706
|
"span",
|
|
706
707
|
{
|
|
707
|
-
draggable: !
|
|
708
|
+
draggable: !a,
|
|
708
709
|
onDragStart: (t) => {
|
|
709
|
-
if (
|
|
710
|
+
if (a) {
|
|
710
711
|
t.preventDefault();
|
|
711
712
|
return;
|
|
712
713
|
}
|
|
@@ -721,24 +722,24 @@ function kt(f = {}) {
|
|
|
721
722
|
B({ list: null, id: null, side: null }), t.stopPropagation(), Y(t, "selected", g);
|
|
722
723
|
},
|
|
723
724
|
onDragEnter: (t) => {
|
|
724
|
-
if (
|
|
725
|
+
if (a) return;
|
|
725
726
|
const r = t.currentTarget.getBoundingClientRect(), o = r.left + r.width / 2;
|
|
726
727
|
B({ list: "selected", id: e.id, side: t.clientX > o ? "right" : "left" });
|
|
727
728
|
},
|
|
728
729
|
onDragLeave: () => B({ list: null, id: null, side: null }),
|
|
729
730
|
onClick: () => {
|
|
730
|
-
|
|
731
|
+
a || Q("selected", "bank", e.id, null);
|
|
731
732
|
},
|
|
732
|
-
title:
|
|
733
|
+
title: a ? "Time expired" : "Click to remove back to bank",
|
|
733
734
|
style: {
|
|
734
|
-
padding:
|
|
735
|
-
margin:
|
|
736
|
-
borderRadius:
|
|
737
|
-
background:
|
|
738
|
-
border:
|
|
735
|
+
padding: b() ? "4px 6px" : "6px 10px",
|
|
736
|
+
margin: b() ? "2px" : "4px",
|
|
737
|
+
borderRadius: b() ? "4px" : "8px",
|
|
738
|
+
background: a ? "#f0f0f0" : "#ffe9e7",
|
|
739
|
+
border: a ? "1px solid #ccc" : "1px solid #ec4c44",
|
|
739
740
|
...x.list === "selected" && x.id === e.id && x.side === "left" ? { borderLeft: "3px solid #3b82f6" } : {},
|
|
740
741
|
...x.list === "selected" && x.id === e.id && x.side === "right" ? { borderRight: "3px solid #3b82f6" } : {},
|
|
741
|
-
cursor:
|
|
742
|
+
cursor: a ? "not-allowed" : x.list === "selected" && x.id === e.id ? "grabbing" : "grab",
|
|
742
743
|
userSelect: "none",
|
|
743
744
|
fontSize: `${we(I.length)}px`,
|
|
744
745
|
// Адаптивный размер шрифта для слов
|
|
@@ -746,7 +747,7 @@ function kt(f = {}) {
|
|
|
746
747
|
// Более плотный шрифт
|
|
747
748
|
whiteSpace: "nowrap",
|
|
748
749
|
// Запрещаем перенос слов
|
|
749
|
-
opacity:
|
|
750
|
+
opacity: a ? 0.6 : 1,
|
|
750
751
|
transition: "opacity 0.3s ease, transform 0.2s ease",
|
|
751
752
|
...x.list === "selected" && x.id === e.id ? {
|
|
752
753
|
transform: "scale(1.05)",
|
|
@@ -759,34 +760,34 @@ function kt(f = {}) {
|
|
|
759
760
|
))
|
|
760
761
|
}
|
|
761
762
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
+
/* @__PURE__ */ l(
|
|
763
764
|
"button",
|
|
764
765
|
{
|
|
765
766
|
onClick: () => tt(!0),
|
|
766
|
-
disabled: !
|
|
767
|
+
disabled: !a && I.length === 0,
|
|
767
768
|
style: {
|
|
768
|
-
marginTop:
|
|
769
|
-
fontSize:
|
|
770
|
-
padding:
|
|
771
|
-
borderRadius:
|
|
772
|
-
background:
|
|
769
|
+
marginTop: b() ? "15px" : "30px",
|
|
770
|
+
fontSize: b() ? "14px" : "20px",
|
|
771
|
+
padding: b() ? "6px 12px" : "10px 24px",
|
|
772
|
+
borderRadius: b() ? "8px" : "12px",
|
|
773
|
+
background: a || I.length > 0 ? "#ec4c44" : "#ccc",
|
|
773
774
|
color: "white",
|
|
774
775
|
border: "none",
|
|
775
|
-
cursor:
|
|
776
|
+
cursor: a || I.length > 0 ? "pointer" : "not-allowed"
|
|
776
777
|
},
|
|
777
778
|
children: "NEXT"
|
|
778
779
|
}
|
|
779
780
|
)
|
|
780
781
|
] }), at = () => {
|
|
781
782
|
const e = h(), n = w(), t = m && e > n || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430 || Be || Me || Ae || $e || Ne || Xe || Fe || qe, r = m && e <= 375 && n <= 667 || e === 896 && n === 414 || e === 844 && n === 390 || e === 926 && n === 428 || e === 932 && n === 430, o = e === 1366 && n === 766 || e === 1366 && n === 768 || e === 1280 && n === 720 || e === 1440 && n === 900;
|
|
782
|
-
return /* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ y("div", { style: u.gmCenterScreen, children: [
|
|
784
|
+
/* @__PURE__ */ l("h1", { style: {
|
|
784
785
|
...u.gmHeadline1,
|
|
785
786
|
marginTop: "0px",
|
|
786
787
|
marginBottom: t ? "2px" : "10px",
|
|
787
788
|
fontSize: r ? "32px" : "clamp(28px, 4vw, 40px)"
|
|
788
789
|
}, children: "Game Over 🎯" }),
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
+
/* @__PURE__ */ y("h2", { style: {
|
|
790
791
|
...u.gmHeadline2,
|
|
791
792
|
marginTop: "0px",
|
|
792
793
|
marginBottom: t ? "2px" : "16px",
|
|
@@ -797,7 +798,7 @@ function kt(f = {}) {
|
|
|
797
798
|
" out of ",
|
|
798
799
|
E
|
|
799
800
|
] }),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
+
/* @__PURE__ */ y("p", { style: {
|
|
801
802
|
...u.gmBodyM,
|
|
802
803
|
color: "#10b981",
|
|
803
804
|
marginTop: t ? "0px" : "12px",
|
|
@@ -807,12 +808,12 @@ function kt(f = {}) {
|
|
|
807
808
|
"Best score: ",
|
|
808
809
|
ae
|
|
809
810
|
] }),
|
|
810
|
-
/* @__PURE__ */
|
|
811
|
+
/* @__PURE__ */ y("div", { style: {
|
|
811
812
|
display: "flex",
|
|
812
813
|
gap: t || m && e <= 375 && n <= 667 ? "6px" : "12px",
|
|
813
814
|
marginTop: t || m && e <= 375 && n <= 667 ? "2px" : o || Ee ? "12px" : "24px"
|
|
814
815
|
}, children: [
|
|
815
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ l(
|
|
816
817
|
"button",
|
|
817
818
|
{
|
|
818
819
|
onClick: () => {
|
|
@@ -827,7 +828,7 @@ function kt(f = {}) {
|
|
|
827
828
|
children: "🔁 Play again"
|
|
828
829
|
}
|
|
829
830
|
),
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ l(
|
|
831
832
|
"button",
|
|
832
833
|
{
|
|
833
834
|
onClick: () => {
|
|
@@ -848,31 +849,28 @@ function kt(f = {}) {
|
|
|
848
849
|
if (m && e > n || n < 700 || !Se)
|
|
849
850
|
return null;
|
|
850
851
|
const t = s || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/magic%20sentence/logo` : "/cloud/speakid/games/magic%20sentence/logo");
|
|
851
|
-
return (
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
)
|
|
870
|
-
] }) })
|
|
871
|
-
);
|
|
852
|
+
return /* @__PURE__ */ l("div", { style: u.gmLogoFixed, children: /* @__PURE__ */ y("picture", { children: [
|
|
853
|
+
/* @__PURE__ */ l(
|
|
854
|
+
"source",
|
|
855
|
+
{
|
|
856
|
+
srcSet: `${t}.svg`,
|
|
857
|
+
type: "image/svg+xml"
|
|
858
|
+
}
|
|
859
|
+
),
|
|
860
|
+
/* @__PURE__ */ l(
|
|
861
|
+
"img",
|
|
862
|
+
{
|
|
863
|
+
src: `${t}.png`,
|
|
864
|
+
alt: "SPEAKID Logo",
|
|
865
|
+
style: u.gmLogoImg,
|
|
866
|
+
loading: "lazy"
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
] }) });
|
|
872
870
|
},
|
|
873
871
|
[m, Se, s, $, H]
|
|
874
872
|
);
|
|
875
|
-
return /* @__PURE__ */
|
|
873
|
+
return /* @__PURE__ */ l(
|
|
876
874
|
"div",
|
|
877
875
|
{
|
|
878
876
|
ref: M,
|
|
@@ -891,7 +889,7 @@ function kt(f = {}) {
|
|
|
891
889
|
right: 0,
|
|
892
890
|
bottom: 0
|
|
893
891
|
},
|
|
894
|
-
children: /* @__PURE__ */
|
|
892
|
+
children: /* @__PURE__ */ y(
|
|
895
893
|
"div",
|
|
896
894
|
{
|
|
897
895
|
style: {
|
|
@@ -910,28 +908,30 @@ function kt(f = {}) {
|
|
|
910
908
|
transform: `scale(${ze})`
|
|
911
909
|
// ✅ Применяем масштаб для широких экранов
|
|
912
910
|
},
|
|
913
|
-
children:
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
911
|
+
children: [
|
|
912
|
+
lt,
|
|
913
|
+
/* @__PURE__ */ l(
|
|
914
|
+
"div",
|
|
915
|
+
{
|
|
916
|
+
style: {
|
|
917
|
+
transform: "translateZ(0)",
|
|
918
|
+
width: "100%",
|
|
919
|
+
height: "100%",
|
|
920
|
+
display: "flex",
|
|
921
|
+
justifyContent: "center",
|
|
922
|
+
alignItems: "center"
|
|
923
|
+
},
|
|
924
|
+
children: /* @__PURE__ */ y("div", { id: "magic-sentence-root", children: [
|
|
925
|
+
S === "select" ? nt() : null,
|
|
926
|
+
S === "time" ? rt() : null,
|
|
927
|
+
S === "type" ? ot() : null,
|
|
928
|
+
S === "getready" ? it() : null,
|
|
929
|
+
S === "play" ? st() : null,
|
|
930
|
+
S === "results" ? at() : null
|
|
931
|
+
] })
|
|
932
|
+
}
|
|
933
|
+
)
|
|
934
|
+
]
|
|
935
935
|
}
|
|
936
936
|
)
|
|
937
937
|
}
|
|
@@ -957,7 +957,7 @@ class It extends pt {
|
|
|
957
957
|
this.setState({ hasError: !1, error: void 0, errorInfo: void 0 });
|
|
958
958
|
};
|
|
959
959
|
render() {
|
|
960
|
-
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */
|
|
960
|
+
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ y("div", { style: {
|
|
961
961
|
display: "flex",
|
|
962
962
|
flexDirection: "column",
|
|
963
963
|
alignItems: "center",
|
|
@@ -969,9 +969,9 @@ class It extends pt {
|
|
|
969
969
|
color: "#dc2626",
|
|
970
970
|
fontFamily: "system-ui, sans-serif"
|
|
971
971
|
}, children: [
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
/* @__PURE__ */
|
|
972
|
+
/* @__PURE__ */ l("h1", { style: { fontSize: "24px", marginBottom: "16px" }, children: "🚨 Oops! Something went wrong" }),
|
|
973
|
+
/* @__PURE__ */ l("p", { style: { fontSize: "16px", marginBottom: "24px", maxWidth: "500px" }, children: "The game encountered an unexpected error. Don't worry, your progress is saved!" }),
|
|
974
|
+
/* @__PURE__ */ l(
|
|
975
975
|
"button",
|
|
976
976
|
{
|
|
977
977
|
onClick: this.handleReset,
|
|
@@ -990,9 +990,9 @@ class It extends pt {
|
|
|
990
990
|
children: "🔄 Restart Game"
|
|
991
991
|
}
|
|
992
992
|
),
|
|
993
|
-
typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */
|
|
994
|
-
/* @__PURE__ */
|
|
995
|
-
/* @__PURE__ */
|
|
993
|
+
typeof process < "u" && process.env.NODE_ENV === "development" && this.state.error && /* @__PURE__ */ y("details", { style: { marginTop: "20px", textAlign: "left", maxWidth: "600px" }, children: [
|
|
994
|
+
/* @__PURE__ */ l("summary", { style: { cursor: "pointer", fontSize: "14px" }, children: "Technical Details (Development Only)" }),
|
|
995
|
+
/* @__PURE__ */ y("pre", { style: {
|
|
996
996
|
backgroundColor: "#f3f4f6",
|
|
997
997
|
padding: "12px",
|
|
998
998
|
borderRadius: "4px",
|