speakid-hangman 1.0.9 → 1.0.11
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,5 +1,5 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as o, jsxs as h, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useMemo as Q, useCallback as ue, useEffect as me } from "react";
|
|
3
3
|
const a = {
|
|
4
4
|
gmCenterScreen: {
|
|
5
5
|
position: "relative",
|
|
@@ -209,8 +209,8 @@ function He({
|
|
|
209
209
|
maxMistakes: J,
|
|
210
210
|
size: _ = 200
|
|
211
211
|
}) {
|
|
212
|
-
const c = _, g = _ * 1.25, w = Math.max(3, _ / 100), C = 10 * (c / 200), x = 240 * (g / 250), y = 150 * (c / 200), b = 80 * (c / 200), ee = 20 * (g / 250), N = 240 * (g / 250), M = 80 * (c / 200), P = 20 * (g / 250), L = 150 * (c / 200), H = 150 * (c / 200),
|
|
213
|
-
return /* @__PURE__ */
|
|
212
|
+
const c = _, g = _ * 1.25, w = Math.max(3, _ / 100), C = 10 * (c / 200), x = 240 * (g / 250), y = 150 * (c / 200), b = 80 * (c / 200), ee = 20 * (g / 250), N = 240 * (g / 250), M = 80 * (c / 200), P = 20 * (g / 250), L = 150 * (c / 200), H = 150 * (c / 200), S = 20 * (g / 250), I = 50 * (g / 250), F = 150 * (c / 200), R = 70 * (g / 250), U = 20 * (c / 200), T = 150 * (c / 200), te = 90 * (g / 250), Y = 150 * (g / 250), f = 150 * (c / 200), B = 110 * (g / 250), p = 130 * (c / 200), O = 130 * (g / 250), ne = 150 * (c / 200), E = 110 * (g / 250), he = 170 * (c / 200), W = 130 * (g / 250), oe = 150 * (c / 200), V = 150 * (g / 250), d = 130 * (c / 200), re = 190 * (g / 250), j = 150 * (c / 200), ie = 150 * (g / 250), u = 170 * (c / 200), ae = 190 * (g / 250), k = r === 0 || r <= J * 0.5 ? "#1f2937" : r <= J * 0.75 ? "#f59e0b" : "#ec4c44";
|
|
213
|
+
return /* @__PURE__ */ h(
|
|
214
214
|
"svg",
|
|
215
215
|
{
|
|
216
216
|
width: c,
|
|
@@ -264,7 +264,7 @@ function He({
|
|
|
264
264
|
"line",
|
|
265
265
|
{
|
|
266
266
|
x1: H,
|
|
267
|
-
y1:
|
|
267
|
+
y1: S,
|
|
268
268
|
x2: H,
|
|
269
269
|
y2: I,
|
|
270
270
|
stroke: k,
|
|
@@ -276,7 +276,7 @@ function He({
|
|
|
276
276
|
{
|
|
277
277
|
cx: F,
|
|
278
278
|
cy: R,
|
|
279
|
-
r:
|
|
279
|
+
r: U,
|
|
280
280
|
stroke: k,
|
|
281
281
|
fill: "none",
|
|
282
282
|
strokeWidth: w
|
|
@@ -288,7 +288,7 @@ function He({
|
|
|
288
288
|
x1: T,
|
|
289
289
|
y1: te,
|
|
290
290
|
x2: T,
|
|
291
|
-
y2:
|
|
291
|
+
y2: Y,
|
|
292
292
|
stroke: k,
|
|
293
293
|
strokeWidth: w
|
|
294
294
|
}
|
|
@@ -310,7 +310,7 @@ function He({
|
|
|
310
310
|
x1: ne,
|
|
311
311
|
y1: E,
|
|
312
312
|
x2: he,
|
|
313
|
-
y2:
|
|
313
|
+
y2: W,
|
|
314
314
|
stroke: k,
|
|
315
315
|
strokeWidth: w
|
|
316
316
|
}
|
|
@@ -319,7 +319,7 @@ function He({
|
|
|
319
319
|
"line",
|
|
320
320
|
{
|
|
321
321
|
x1: oe,
|
|
322
|
-
y1:
|
|
322
|
+
y1: V,
|
|
323
323
|
x2: d,
|
|
324
324
|
y2: re,
|
|
325
325
|
stroke: k,
|
|
@@ -341,7 +341,7 @@ function He({
|
|
|
341
341
|
}
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Ae({
|
|
345
345
|
gameCubeSize: r = 400,
|
|
346
346
|
screenHeight: J = 800,
|
|
347
347
|
screenWidth: _ = 800,
|
|
@@ -367,7 +367,7 @@ function Ye({
|
|
|
367
367
|
Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
|
|
368
368
|
Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
|
|
369
369
|
Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
|
|
370
|
-
}, [x, y] =
|
|
370
|
+
}, [x, y] = m("lobby"), [b, ee] = m(""), [N] = m("Normal"), [M, P] = m(0), [L, H] = m(1), [S, I] = m(""), [F, R] = m([]), [U, T] = m(0), [te, Y] = m(0), [f, B] = m(null), [p, O] = m(null), [ne, E] = m(1), [he, W] = m([]), oe = N === "Easy" ? 8 : N === "Normal" ? 6 : 4, V = w || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [d, re] = m(!1), [j, ie] = m(!1), [u, ae] = m(!1), [$, k] = m(!1), s = Q(() => {
|
|
371
371
|
const e = (p || r || 1e3) / 400, t = u ? 0.8 : 1, i = $ ? 0.9 : 1, l = t * i;
|
|
372
372
|
return {
|
|
373
373
|
headline1: d ? Math.max(24, Math.min(30, 30 * e * l)) : Math.max(28, Math.min(32, 32 * e * i)),
|
|
@@ -393,39 +393,39 @@ function Ye({
|
|
|
393
393
|
}, [j, p, r, u, $]), n = Q(() => {
|
|
394
394
|
const e = (p || r || 1e3) / 400, t = u ? 0.65 : 1, i = $ ? 0.85 : 1;
|
|
395
395
|
return j ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e)) * t * i;
|
|
396
|
-
}, [j, p, r, u, $]),
|
|
396
|
+
}, [j, p, r, u, $]), v = Q(() => {
|
|
397
397
|
const e = (p || r || 1e3) / 400, t = $ ? 0.9 : 1;
|
|
398
398
|
return Math.max(6, Math.min(10, 8 * e * t));
|
|
399
|
-
}, [p, r, $]), we = (e, t) => e.split("").every((i) => t.includes(i)), ke = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), Me = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)),
|
|
399
|
+
}, [p, r, $]), we = (e, t) => e.split("").every((i) => t.includes(i)), ke = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), Me = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)), Z = (e, t = []) => {
|
|
400
400
|
var q;
|
|
401
401
|
if (!e || !C[e]) {
|
|
402
|
-
const
|
|
403
|
-
return ((q = C[
|
|
402
|
+
const z = Object.keys(C)[0];
|
|
403
|
+
return ((q = C[z]) == null ? void 0 : q[0]) || "";
|
|
404
404
|
}
|
|
405
405
|
const i = C[e];
|
|
406
406
|
if (!i || i.length === 0)
|
|
407
407
|
return "";
|
|
408
|
-
const l = i.filter((
|
|
409
|
-
if (
|
|
408
|
+
const l = i.filter((z) => !t.includes(z)), A = l.length > 0 ? l : i;
|
|
409
|
+
if (A.length === 0)
|
|
410
410
|
return "";
|
|
411
|
-
let
|
|
411
|
+
let X;
|
|
412
412
|
if (typeof crypto < "u" && crypto.getRandomValues) {
|
|
413
|
-
const
|
|
414
|
-
crypto.getRandomValues(
|
|
415
|
-
const ge =
|
|
416
|
-
|
|
413
|
+
const z = new Uint32Array(1);
|
|
414
|
+
crypto.getRandomValues(z);
|
|
415
|
+
const ge = z[0] / 4294967295;
|
|
416
|
+
X = Math.floor(ge * A.length);
|
|
417
417
|
} else
|
|
418
|
-
|
|
419
|
-
return
|
|
418
|
+
X = Math.floor(Math.random() * A.length);
|
|
419
|
+
return A[X];
|
|
420
420
|
}, $e = () => {
|
|
421
421
|
if (!b) return;
|
|
422
|
-
|
|
423
|
-
const e =
|
|
422
|
+
W([]);
|
|
423
|
+
const e = Z(b, []);
|
|
424
424
|
if (!e) {
|
|
425
425
|
y("category");
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
|
-
I(e),
|
|
428
|
+
I(e), W([e]), R([]), T(0), H(1), Y(0), B(null), y("game");
|
|
429
429
|
}, se = ue((e) => {
|
|
430
430
|
if (x !== "game" || f !== null) return;
|
|
431
431
|
const t = e.toLowerCase();
|
|
@@ -437,19 +437,19 @@ function Ye({
|
|
|
437
437
|
if (x === "game")
|
|
438
438
|
return window.addEventListener("keydown", le), () => window.removeEventListener("keydown", le);
|
|
439
439
|
}, [x, le]);
|
|
440
|
-
const
|
|
440
|
+
const ve = S ? ke(S, F) : "", xe = S ? we(S, F) : !1, ye = U >= 10, Se = Me(F), ce = ue(() => {
|
|
441
441
|
if (!b || L >= M) {
|
|
442
442
|
y("result");
|
|
443
443
|
return;
|
|
444
444
|
}
|
|
445
|
-
H((e) => e + 1),
|
|
446
|
-
const t =
|
|
445
|
+
H((e) => e + 1), W((e) => {
|
|
446
|
+
const t = Z(b, e);
|
|
447
447
|
return t ? (I(t), [...e, t]) : e;
|
|
448
448
|
}), R([]), T(0), B(null);
|
|
449
449
|
}, [b, L, M]);
|
|
450
450
|
me(() => {
|
|
451
451
|
if (xe && f === null) {
|
|
452
|
-
B("win"),
|
|
452
|
+
B("win"), Y((t) => t + 1);
|
|
453
453
|
const e = setTimeout(() => {
|
|
454
454
|
ce();
|
|
455
455
|
}, 2e3);
|
|
@@ -468,24 +468,24 @@ function Ye({
|
|
|
468
468
|
y("result");
|
|
469
469
|
return;
|
|
470
470
|
}
|
|
471
|
-
H((e) => e + 1),
|
|
472
|
-
const t =
|
|
471
|
+
H((e) => e + 1), W((e) => {
|
|
472
|
+
const t = Z(b, e);
|
|
473
473
|
return t ? (I(t), [...e, t]) : e;
|
|
474
474
|
}), R([]), T(0), B(null);
|
|
475
475
|
};
|
|
476
476
|
me(() => {
|
|
477
477
|
const e = () => {
|
|
478
|
-
const t = window.innerWidth, i = window.innerHeight, l = t < 768 || t === 926 && i === 428 || t === 932 && i === 430,
|
|
479
|
-
if (re(l), ie(q), ae(
|
|
478
|
+
const t = window.innerWidth, i = window.innerHeight, l = t < 768 || t === 926 && i === 428 || t === 932 && i === 430, A = i < 700, X = t / i > 1.8, q = t === 1024 && i === 600, z = l && t > i, ge = t >= 1200 && t <= 1400;
|
|
479
|
+
if (re(l), ie(q), ae(z), k(ge), l)
|
|
480
480
|
O(null), E(1);
|
|
481
|
-
else if (
|
|
481
|
+
else if (A)
|
|
482
482
|
O(null), E(1);
|
|
483
483
|
else {
|
|
484
|
-
const
|
|
484
|
+
const We = t - 80, ze = i - 80, be = Math.min(We, ze);
|
|
485
485
|
let pe;
|
|
486
486
|
r && r >= 320 ? pe = Math.min(r, be) : pe = Math.min(1e3, be * 0.9);
|
|
487
487
|
const Ce = Math.max(400, Math.min(1200, pe));
|
|
488
|
-
O(Ce), E(
|
|
488
|
+
O(Ce), E(X ? 0.85 : 1);
|
|
489
489
|
}
|
|
490
490
|
};
|
|
491
491
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
@@ -546,7 +546,7 @@ function Ye({
|
|
|
546
546
|
position: "relative",
|
|
547
547
|
boxSizing: "border-box",
|
|
548
548
|
background: "transparent"
|
|
549
|
-
},
|
|
549
|
+
}, D = Q(
|
|
550
550
|
() => {
|
|
551
551
|
if (!de)
|
|
552
552
|
return null;
|
|
@@ -554,7 +554,7 @@ function Ye({
|
|
|
554
554
|
if (d && e > window.innerHeight)
|
|
555
555
|
return null;
|
|
556
556
|
const t = c || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
|
|
557
|
-
return /* @__PURE__ */ o("div", { style: a.gmLogoFixed, children: /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ o("div", { style: a.gmLogoFixed, children: /* @__PURE__ */ h("picture", { children: [
|
|
558
558
|
/* @__PURE__ */ o(
|
|
559
559
|
"source",
|
|
560
560
|
{
|
|
@@ -574,8 +574,8 @@ function Ye({
|
|
|
574
574
|
] }) });
|
|
575
575
|
},
|
|
576
576
|
[d, de, c, x]
|
|
577
|
-
), Be = () => x === "lobby" ? /* @__PURE__ */
|
|
578
|
-
|
|
577
|
+
), Be = () => x === "lobby" ? /* @__PURE__ */ h(G, { children: [
|
|
578
|
+
D,
|
|
579
579
|
/* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
|
|
580
580
|
/* @__PURE__ */ o("h1", { style: {
|
|
581
581
|
...a.gmHeadline1,
|
|
@@ -584,7 +584,7 @@ function Ye({
|
|
|
584
584
|
position: "relative",
|
|
585
585
|
zIndex: 1
|
|
586
586
|
}, children: "HANGMAN" }),
|
|
587
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ h(
|
|
588
588
|
"button",
|
|
589
589
|
{
|
|
590
590
|
onClick: () => y("category"),
|
|
@@ -594,7 +594,7 @@ function Ye({
|
|
|
594
594
|
// Medium для более заметности
|
|
595
595
|
fontSize: `${s.button}px`,
|
|
596
596
|
padding: `${n * 1.2}px ${n * 3}px`,
|
|
597
|
-
borderRadius: `${
|
|
597
|
+
borderRadius: `${v * 1.5}px`,
|
|
598
598
|
position: "relative",
|
|
599
599
|
zIndex: 1,
|
|
600
600
|
display: "flex",
|
|
@@ -641,7 +641,7 @@ function Ye({
|
|
|
641
641
|
]
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
|
-
/* @__PURE__ */
|
|
644
|
+
/* @__PURE__ */ h("div", { style: {
|
|
645
645
|
position: "absolute",
|
|
646
646
|
top: "50%",
|
|
647
647
|
left: "50%",
|
|
@@ -654,7 +654,7 @@ function Ye({
|
|
|
654
654
|
/* @__PURE__ */ o(
|
|
655
655
|
"img",
|
|
656
656
|
{
|
|
657
|
-
src: `${
|
|
657
|
+
src: `${V}/sun.png`,
|
|
658
658
|
alt: "Sun",
|
|
659
659
|
style: {
|
|
660
660
|
position: "absolute",
|
|
@@ -671,7 +671,7 @@ function Ye({
|
|
|
671
671
|
/* @__PURE__ */ o(
|
|
672
672
|
"img",
|
|
673
673
|
{
|
|
674
|
-
src: `${
|
|
674
|
+
src: `${V}/character.png`,
|
|
675
675
|
alt: "Hangman character",
|
|
676
676
|
style: {
|
|
677
677
|
position: "absolute",
|
|
@@ -686,8 +686,8 @@ function Ye({
|
|
|
686
686
|
}
|
|
687
687
|
)
|
|
688
688
|
] })
|
|
689
|
-
] }) : x === "category" ? /* @__PURE__ */
|
|
690
|
-
|
|
689
|
+
] }) : x === "category" ? /* @__PURE__ */ h(G, { children: [
|
|
690
|
+
D,
|
|
691
691
|
/* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
|
|
692
692
|
/* @__PURE__ */ o(
|
|
693
693
|
"button",
|
|
@@ -704,7 +704,7 @@ function Ye({
|
|
|
704
704
|
...a.gmButtonSecondary,
|
|
705
705
|
fontSize: `${s.button}px`,
|
|
706
706
|
padding: `${n}px ${n * 1.5}px`,
|
|
707
|
-
borderRadius: `${
|
|
707
|
+
borderRadius: `${v}px`,
|
|
708
708
|
position: "absolute",
|
|
709
709
|
top: "60px",
|
|
710
710
|
// ✅ Под логотипом (24px top логотипа + 28px высота + 8px отступ)
|
|
@@ -732,7 +732,7 @@ function Ye({
|
|
|
732
732
|
fontWeight: 500,
|
|
733
733
|
fontSize: `${s.button}px`,
|
|
734
734
|
padding: `${n * 1.2}px ${n * 2}px`,
|
|
735
|
-
borderRadius: `${
|
|
735
|
+
borderRadius: `${v * 2}px`,
|
|
736
736
|
// Более округлые для облачков
|
|
737
737
|
margin: `${n / 2}px`,
|
|
738
738
|
background: "transparent",
|
|
@@ -746,8 +746,8 @@ function Ye({
|
|
|
746
746
|
},
|
|
747
747
|
e
|
|
748
748
|
)) })
|
|
749
|
-
] }) : x === "rounds" ? /* @__PURE__ */
|
|
750
|
-
|
|
749
|
+
] }) : x === "rounds" ? /* @__PURE__ */ h(G, { children: [
|
|
750
|
+
D,
|
|
751
751
|
/* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
|
|
752
752
|
/* @__PURE__ */ o(
|
|
753
753
|
"button",
|
|
@@ -764,7 +764,7 @@ function Ye({
|
|
|
764
764
|
...a.gmButtonSecondary,
|
|
765
765
|
fontSize: `${s.button}px`,
|
|
766
766
|
padding: `${n}px ${n * 1.5}px`,
|
|
767
|
-
borderRadius: `${
|
|
767
|
+
borderRadius: `${v}px`,
|
|
768
768
|
position: "absolute",
|
|
769
769
|
top: "60px",
|
|
770
770
|
// ✅ Под логотипом (24px top логотипа + 28px высота + 8px отступ)
|
|
@@ -793,7 +793,7 @@ function Ye({
|
|
|
793
793
|
fontWeight: 500,
|
|
794
794
|
fontSize: `${s.button}px`,
|
|
795
795
|
padding: `${n * 1.2}px ${n * 2}px`,
|
|
796
|
-
borderRadius: `${
|
|
796
|
+
borderRadius: `${v * 2}px`,
|
|
797
797
|
// Более округлые для облачков
|
|
798
798
|
margin: `${n / 2}px`,
|
|
799
799
|
background: "transparent",
|
|
@@ -807,30 +807,36 @@ function Ye({
|
|
|
807
807
|
},
|
|
808
808
|
e
|
|
809
809
|
)) })
|
|
810
|
-
] }) : x === "game" ? /* @__PURE__ */
|
|
811
|
-
|
|
810
|
+
] }) : x === "game" ? /* @__PURE__ */ h(G, { children: [
|
|
811
|
+
D,
|
|
812
812
|
!u && /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
|
|
813
813
|
" ",
|
|
814
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ h("div", { style: {
|
|
815
815
|
...a.gmInfoBox,
|
|
816
816
|
padding: `${u ? n * 0.6 : n * 0.8}px`,
|
|
817
817
|
// ✅ Уменьшаем padding в landscape
|
|
818
818
|
marginBottom: `${u ? n * 0.3 : n * 0.5}px`,
|
|
819
819
|
// ✅ Уменьшаем margin в landscape
|
|
820
|
-
maxWidth: `${(p || r) * 0.9}px
|
|
820
|
+
maxWidth: `${(p || r) * 0.9}px`,
|
|
821
|
+
textAlign: "center",
|
|
822
|
+
// ✅ Центрируем текст по плашке
|
|
823
|
+
display: "flex",
|
|
824
|
+
flexDirection: "column",
|
|
825
|
+
alignItems: "center",
|
|
826
|
+
justifyContent: "center"
|
|
821
827
|
}, children: [
|
|
822
|
-
/* @__PURE__ */
|
|
828
|
+
/* @__PURE__ */ h("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${n * 0.2}px`, textAlign: "center" }, children: [
|
|
823
829
|
"Category: ",
|
|
824
830
|
b
|
|
825
831
|
] }),
|
|
826
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ h("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px", textAlign: "center" }, children: [
|
|
827
833
|
"Round ",
|
|
828
834
|
L,
|
|
829
835
|
" of ",
|
|
830
836
|
M
|
|
831
837
|
] })
|
|
832
838
|
] }),
|
|
833
|
-
|
|
839
|
+
S && /* @__PURE__ */ h("p", { style: {
|
|
834
840
|
...a.gmBodyS,
|
|
835
841
|
fontSize: `${s.bodyS}px`,
|
|
836
842
|
marginTop: `${u ? n * 0.3 : n * 0.5}px`,
|
|
@@ -839,7 +845,7 @@ function Ye({
|
|
|
839
845
|
// ✅ Уменьшаем margin в landscape
|
|
840
846
|
}, children: [
|
|
841
847
|
"I am thinking of a word that is ",
|
|
842
|
-
/* @__PURE__ */ o("strong", { children:
|
|
848
|
+
/* @__PURE__ */ o("strong", { children: S.length }),
|
|
843
849
|
" letters long"
|
|
844
850
|
] }),
|
|
845
851
|
/* @__PURE__ */ o("div", { style: {
|
|
@@ -851,7 +857,7 @@ function Ye({
|
|
|
851
857
|
}, children: /* @__PURE__ */ o(
|
|
852
858
|
He,
|
|
853
859
|
{
|
|
854
|
-
mistakes:
|
|
860
|
+
mistakes: U,
|
|
855
861
|
maxMistakes: oe,
|
|
856
862
|
size: j ? Math.max(80, Math.min(110, (p || r) * 0.16)) : d ? u ? Math.max(70, Math.min(120, Math.min(window.innerWidth * 0.25, window.innerHeight * 0.15))) : Math.max(100, Math.min(150, Math.min(window.innerWidth * 0.3, window.innerHeight * 0.2))) : Math.max(100, Math.min(150, (p || r) * 0.2))
|
|
857
863
|
}
|
|
@@ -863,8 +869,8 @@ function Ye({
|
|
|
863
869
|
// ✅ Уменьшаем margin в landscape
|
|
864
870
|
letterSpacing: `${n * 0.8}px`,
|
|
865
871
|
minHeight: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9)) * 1.2}px`
|
|
866
|
-
}, children:
|
|
867
|
-
/* @__PURE__ */
|
|
872
|
+
}, children: ve || "Loading..." }),
|
|
873
|
+
/* @__PURE__ */ o("div", { style: {
|
|
868
874
|
...a.gmInfoBox,
|
|
869
875
|
padding: `${u ? n * 0.6 : n}px`,
|
|
870
876
|
// ✅ Уменьшаем padding в landscape
|
|
@@ -873,57 +879,53 @@ function Ye({
|
|
|
873
879
|
marginBottom: `${u ? n * 0.5 : n}px`,
|
|
874
880
|
// ✅ Уменьшаем margin в landscape
|
|
875
881
|
maxWidth: `${(p || r) * 0.95}px`
|
|
876
|
-
}, children:
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
fontFamily: '"Onest", system-ui, sans-serif'
|
|
891
|
-
}, children: ve.map((e) => /* @__PURE__ */ o(
|
|
892
|
-
"button",
|
|
893
|
-
{
|
|
894
|
-
onClick: () => se(e),
|
|
895
|
-
disabled: f !== null,
|
|
896
|
-
onMouseEnter: (t) => {
|
|
897
|
-
f === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
|
|
898
|
-
},
|
|
899
|
-
onMouseLeave: (t) => {
|
|
900
|
-
f === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
|
|
901
|
-
},
|
|
902
|
-
style: {
|
|
903
|
-
padding: `${n / 4}px ${n / 3}px`,
|
|
904
|
-
borderRadius: `${S * 0.5}px`,
|
|
905
|
-
background: "#f9f9f9",
|
|
906
|
-
color: "#1f2937",
|
|
907
|
-
border: "1px solid #e5e7eb",
|
|
908
|
-
minWidth: `${Math.max(n * 1.5, (p || r) * 0.04)}px`,
|
|
909
|
-
textAlign: "center",
|
|
910
|
-
display: "inline-block",
|
|
911
|
-
cursor: f === null ? "pointer" : "default",
|
|
912
|
-
fontFamily: '"Onest", system-ui, sans-serif',
|
|
913
|
-
fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
|
|
914
|
-
transition: "background-color 0.2s ease"
|
|
915
|
-
},
|
|
916
|
-
children: e
|
|
882
|
+
}, children: /* @__PURE__ */ o("div", { style: {
|
|
883
|
+
display: "flex",
|
|
884
|
+
flexWrap: "wrap",
|
|
885
|
+
gap: `${n / 3}px`,
|
|
886
|
+
justifyContent: "center",
|
|
887
|
+
alignItems: "center",
|
|
888
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
889
|
+
}, children: Se.map((e) => /* @__PURE__ */ o(
|
|
890
|
+
"button",
|
|
891
|
+
{
|
|
892
|
+
onClick: () => se(e),
|
|
893
|
+
disabled: f !== null,
|
|
894
|
+
onMouseEnter: (t) => {
|
|
895
|
+
f === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
|
|
917
896
|
},
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
897
|
+
onMouseLeave: (t) => {
|
|
898
|
+
f === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
|
|
899
|
+
},
|
|
900
|
+
style: {
|
|
901
|
+
flex: "1 1 auto",
|
|
902
|
+
padding: `${n * 0.5}px ${n * 0.4}px`,
|
|
903
|
+
borderRadius: `${v * 0.5}px`,
|
|
904
|
+
background: "#f9f9f9",
|
|
905
|
+
color: "#1f2937",
|
|
906
|
+
border: "1px solid #e5e7eb",
|
|
907
|
+
minWidth: `${Math.max((p || r) * 0.06, n * 2)}px`,
|
|
908
|
+
maxWidth: `${Math.max((p || r) * 0.12, n * 3)}px`,
|
|
909
|
+
textAlign: "center",
|
|
910
|
+
display: "flex",
|
|
911
|
+
alignItems: "center",
|
|
912
|
+
justifyContent: "center",
|
|
913
|
+
cursor: f === null ? "pointer" : "default",
|
|
914
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
915
|
+
fontSize: `${Math.max(14, Math.min(20, s.bodyS * 1.2))}px`,
|
|
916
|
+
fontWeight: 500,
|
|
917
|
+
transition: "background-color 0.2s ease"
|
|
918
|
+
},
|
|
919
|
+
children: e.toUpperCase()
|
|
920
|
+
},
|
|
921
|
+
e
|
|
922
|
+
)) }) }),
|
|
921
923
|
F.length > 0 && /* @__PURE__ */ o("div", { style: {
|
|
922
924
|
...a.gmGuessedLetters,
|
|
923
925
|
fontSize: `${Math.max(10, Math.min(12, s.bodyS * 0.85))}px`,
|
|
924
926
|
marginTop: `${n * 0.5}px`,
|
|
925
927
|
marginBottom: "2px"
|
|
926
|
-
}, children: /* @__PURE__ */
|
|
928
|
+
}, children: /* @__PURE__ */ h("span", { style: { color: "#6b7280" }, children: [
|
|
927
929
|
"Guessed letters: ",
|
|
928
930
|
/* @__PURE__ */ o("strong", { children: F.join(", ") })
|
|
929
931
|
] }) }),
|
|
@@ -932,13 +934,13 @@ function Ye({
|
|
|
932
934
|
fontSize: `${s.bodyL}px`,
|
|
933
935
|
margin: "2px 0"
|
|
934
936
|
}, children: "🎉 You won this round!" }),
|
|
935
|
-
f === "lose" && /* @__PURE__ */
|
|
937
|
+
f === "lose" && /* @__PURE__ */ h("div", { style: {
|
|
936
938
|
...a.gmStatusLose,
|
|
937
939
|
fontSize: `${s.bodyL}px`,
|
|
938
940
|
margin: "2px 0"
|
|
939
941
|
}, children: [
|
|
940
942
|
"The hangman is complete! The word was: ",
|
|
941
|
-
/* @__PURE__ */ o("strong", { children:
|
|
943
|
+
/* @__PURE__ */ o("strong", { children: S })
|
|
942
944
|
] }),
|
|
943
945
|
f !== null && L < M && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
|
|
944
946
|
"button",
|
|
@@ -954,7 +956,7 @@ function Ye({
|
|
|
954
956
|
...a.gmButton,
|
|
955
957
|
fontSize: `${Math.max(11, Math.min(14, s.button * 0.85))}px`,
|
|
956
958
|
padding: `${n * 0.6}px ${n * 1.2}px`,
|
|
957
|
-
borderRadius: `${
|
|
959
|
+
borderRadius: `${v}px`
|
|
958
960
|
},
|
|
959
961
|
children: "NEXT"
|
|
960
962
|
}
|
|
@@ -973,7 +975,7 @@ function Ye({
|
|
|
973
975
|
...a.gmButton,
|
|
974
976
|
fontSize: `${s.button}px`,
|
|
975
977
|
padding: `${n}px ${n * 1.5}px`,
|
|
976
|
-
borderRadius: `${
|
|
978
|
+
borderRadius: `${v}px`
|
|
977
979
|
},
|
|
978
980
|
children: "View results"
|
|
979
981
|
}
|
|
@@ -984,14 +986,14 @@ function Ye({
|
|
|
984
986
|
marginTop: `${n}px`,
|
|
985
987
|
marginBottom: `${n}px`
|
|
986
988
|
}, children: "Type a letter on your keyboard" })
|
|
987
|
-
] }) : x === "result" ? /* @__PURE__ */
|
|
988
|
-
|
|
989
|
+
] }) : x === "result" ? /* @__PURE__ */ h(G, { children: [
|
|
990
|
+
D,
|
|
989
991
|
/* @__PURE__ */ o("h1", { style: {
|
|
990
992
|
...a.gmHeadline1,
|
|
991
993
|
fontSize: `${s.headline1}px`,
|
|
992
994
|
marginBottom: `${n * 2}px`
|
|
993
995
|
}, children: "🎊 Game Finished!" }),
|
|
994
|
-
/* @__PURE__ */
|
|
996
|
+
/* @__PURE__ */ h("p", { style: {
|
|
995
997
|
...a.gmBodyL,
|
|
996
998
|
fontSize: `${s.bodyL}px`,
|
|
997
999
|
marginBottom: `${n * 2}px`
|
|
@@ -1002,7 +1004,7 @@ function Ye({
|
|
|
1002
1004
|
/* @__PURE__ */ o("strong", { children: M }),
|
|
1003
1005
|
" words correctly."
|
|
1004
1006
|
] }),
|
|
1005
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ h("div", { style: {
|
|
1006
1008
|
display: "flex",
|
|
1007
1009
|
flexDirection: "column",
|
|
1008
1010
|
gap: `${n}px`,
|
|
@@ -1016,9 +1018,9 @@ function Ye({
|
|
|
1016
1018
|
y("lobby");
|
|
1017
1019
|
return;
|
|
1018
1020
|
}
|
|
1019
|
-
|
|
1020
|
-
const e =
|
|
1021
|
-
e && (I(e),
|
|
1021
|
+
W([]);
|
|
1022
|
+
const e = Z(b, []);
|
|
1023
|
+
e && (I(e), W([e]), R([]), T(0), H(1), Y(0), B(null), y("game"));
|
|
1022
1024
|
},
|
|
1023
1025
|
onMouseEnter: (e) => {
|
|
1024
1026
|
e.currentTarget.style.backgroundColor = "#d43a32";
|
|
@@ -1030,7 +1032,7 @@ function Ye({
|
|
|
1030
1032
|
...a.gmButton,
|
|
1031
1033
|
fontSize: `${s.button}px`,
|
|
1032
1034
|
padding: `${n}px ${n * 1.5}px`,
|
|
1033
|
-
borderRadius: `${
|
|
1035
|
+
borderRadius: `${v}px`,
|
|
1034
1036
|
minWidth: "200px"
|
|
1035
1037
|
},
|
|
1036
1038
|
children: "Play again"
|
|
@@ -1051,7 +1053,7 @@ function Ye({
|
|
|
1051
1053
|
...a.gmButtonSecondary,
|
|
1052
1054
|
fontSize: `${s.button}px`,
|
|
1053
1055
|
padding: `${n}px ${n * 1.5}px`,
|
|
1054
|
-
borderRadius: `${
|
|
1056
|
+
borderRadius: `${v}px`,
|
|
1055
1057
|
minWidth: "200px"
|
|
1056
1058
|
},
|
|
1057
1059
|
children: "Exit"
|
|
@@ -1114,8 +1116,8 @@ function Ye({
|
|
|
1114
1116
|
);
|
|
1115
1117
|
}
|
|
1116
1118
|
export {
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1119
|
+
Ae as Game,
|
|
1120
|
+
Ae as HangmanLobbyGame,
|
|
1121
|
+
Ae as default
|
|
1120
1122
|
};
|
|
1121
1123
|
//# sourceMappingURL=speakid-hangman.es.js.map
|