speakid-hangman 1.0.8 → 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
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 he } from "react";
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",
@@ -205,11 +205,11 @@ const a = {
205
205
  }
206
206
  };
207
207
  function He({
208
- mistakes: i,
208
+ mistakes: r,
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), v = 20 * (g / 250), I = 50 * (g / 250), F = 150 * (c / 200), R = 70 * (g / 250), V = 20 * (c / 200), T = 150 * (c / 200), te = 90 * (g / 250), A = 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), me = 170 * (c / 200), z = 130 * (g / 250), oe = 150 * (c / 200), Z = 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 = i === 0 || i <= J * 0.5 ? "#1f2937" : i <= J * 0.75 ? "#f59e0b" : "#ec4c44";
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
213
  return /* @__PURE__ */ h(
214
214
  "svg",
215
215
  {
@@ -227,7 +227,7 @@ function He({
227
227
  // ✅ Включение аппаратного ускорения на iOS
228
228
  },
229
229
  children: [
230
- i > 0 && /* @__PURE__ */ o(
230
+ r > 0 && /* @__PURE__ */ o(
231
231
  "line",
232
232
  {
233
233
  x1: C,
@@ -238,7 +238,7 @@ function He({
238
238
  strokeWidth: w
239
239
  }
240
240
  ),
241
- i > 1 && /* @__PURE__ */ o(
241
+ r > 1 && /* @__PURE__ */ o(
242
242
  "line",
243
243
  {
244
244
  x1: b,
@@ -249,7 +249,7 @@ function He({
249
249
  strokeWidth: w
250
250
  }
251
251
  ),
252
- i > 2 && /* @__PURE__ */ o(
252
+ r > 2 && /* @__PURE__ */ o(
253
253
  "line",
254
254
  {
255
255
  x1: M,
@@ -260,40 +260,40 @@ function He({
260
260
  strokeWidth: w
261
261
  }
262
262
  ),
263
- i > 3 && /* @__PURE__ */ o(
263
+ r > 3 && /* @__PURE__ */ o(
264
264
  "line",
265
265
  {
266
266
  x1: H,
267
- y1: v,
267
+ y1: S,
268
268
  x2: H,
269
269
  y2: I,
270
270
  stroke: k,
271
271
  strokeWidth: w
272
272
  }
273
273
  ),
274
- i > 4 && /* @__PURE__ */ o(
274
+ r > 4 && /* @__PURE__ */ o(
275
275
  "circle",
276
276
  {
277
277
  cx: F,
278
278
  cy: R,
279
- r: V,
279
+ r: U,
280
280
  stroke: k,
281
281
  fill: "none",
282
282
  strokeWidth: w
283
283
  }
284
284
  ),
285
- i > 5 && /* @__PURE__ */ o(
285
+ r > 5 && /* @__PURE__ */ o(
286
286
  "line",
287
287
  {
288
288
  x1: T,
289
289
  y1: te,
290
290
  x2: T,
291
- y2: A,
291
+ y2: Y,
292
292
  stroke: k,
293
293
  strokeWidth: w
294
294
  }
295
295
  ),
296
- i > 6 && /* @__PURE__ */ o(
296
+ r > 6 && /* @__PURE__ */ o(
297
297
  "line",
298
298
  {
299
299
  x1: f,
@@ -304,29 +304,29 @@ function He({
304
304
  strokeWidth: w
305
305
  }
306
306
  ),
307
- i > 7 && /* @__PURE__ */ o(
307
+ r > 7 && /* @__PURE__ */ o(
308
308
  "line",
309
309
  {
310
310
  x1: ne,
311
311
  y1: E,
312
- x2: me,
313
- y2: z,
312
+ x2: he,
313
+ y2: W,
314
314
  stroke: k,
315
315
  strokeWidth: w
316
316
  }
317
317
  ),
318
- i > 8 && /* @__PURE__ */ o(
318
+ r > 8 && /* @__PURE__ */ o(
319
319
  "line",
320
320
  {
321
321
  x1: oe,
322
- y1: Z,
322
+ y1: V,
323
323
  x2: d,
324
324
  y2: re,
325
325
  stroke: k,
326
326
  strokeWidth: w
327
327
  }
328
328
  ),
329
- i > 9 && /* @__PURE__ */ o(
329
+ r > 9 && /* @__PURE__ */ o(
330
330
  "line",
331
331
  {
332
332
  x1: j,
@@ -341,8 +341,8 @@ function He({
341
341
  }
342
342
  );
343
343
  }
344
- function Ye({
345
- gameCubeSize: i = 400,
344
+ function Ae({
345
+ gameCubeSize: r = 400,
346
346
  screenHeight: J = 800,
347
347
  screenWidth: _ = 800,
348
348
  logoUrl: c,
@@ -367,10 +367,10 @@ 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] = m("lobby"), [b, ee] = m(""), [N] = m("Normal"), [M, P] = m(0), [L, H] = m(1), [v, I] = m(""), [F, R] = m([]), [V, T] = m(0), [te, A] = m(0), [f, B] = m(null), [p, O] = m(null), [ne, E] = m(1), [me, z] = m([]), oe = N === "Easy" ? 8 : N === "Normal" ? 6 : 4, Z = 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
- const e = (p || i || 1e3) / 400, t = u ? 0.8 : 1, r = $ ? 0.9 : 1, l = t * r;
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
+ const e = (p || r || 1e3) / 400, t = u ? 0.8 : 1, i = $ ? 0.9 : 1, l = t * i;
372
372
  return {
373
- headline1: d ? Math.max(24, Math.min(30, 30 * e * l)) : Math.max(28, Math.min(32, 32 * e * r)),
373
+ headline1: d ? Math.max(24, Math.min(30, 30 * e * l)) : Math.max(28, Math.min(32, 32 * e * i)),
374
374
  // Desktop: 32px
375
375
  headline2: Math.max(20, Math.min(28, 24 * e * l)),
376
376
  // Desktop: 24px
@@ -387,69 +387,69 @@ function Ye({
387
387
  button: Math.max(12, Math.min(18, 16 * e * l))
388
388
  // Desktop: 16px
389
389
  };
390
- }, [d, p, i, u, $]), fe = Q(() => {
391
- const e = (p || i || 1e3) / 400, t = u ? 0.65 : 1, r = $ ? 0.85 : 1;
392
- return j ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e)) * t * r;
393
- }, [j, p, i, u, $]), n = Q(() => {
394
- const e = (p || i || 1e3) / 400, t = u ? 0.65 : 1, r = $ ? 0.85 : 1;
395
- return j ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e)) * t * r;
396
- }, [j, p, i, u, $]), S = Q(() => {
397
- const e = (p || i || 1e3) / 400, t = $ ? 0.9 : 1;
390
+ }, [d, p, r, u, $]), fe = Q(() => {
391
+ const e = (p || r || 1e3) / 400, t = u ? 0.65 : 1, i = $ ? 0.85 : 1;
392
+ return j ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e)) * t * i;
393
+ }, [j, p, r, u, $]), n = Q(() => {
394
+ const e = (p || r || 1e3) / 400, t = u ? 0.65 : 1, i = $ ? 0.85 : 1;
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, $]), v = Q(() => {
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, i, $]), we = (e, t) => e.split("").every((r) => t.includes(r)), ke = (e, t) => e.split("").map((r) => t.includes(r) ? r : "_").join(" "), Me = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((r) => !e.includes(r)), U = (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)), Z = (e, t = []) => {
400
400
  var q;
401
401
  if (!e || !C[e]) {
402
- const W = Object.keys(C)[0];
403
- return ((q = C[W]) == null ? void 0 : q[0]) || "";
402
+ const z = Object.keys(C)[0];
403
+ return ((q = C[z]) == null ? void 0 : q[0]) || "";
404
404
  }
405
- const r = C[e];
406
- if (!r || r.length === 0)
405
+ const i = C[e];
406
+ if (!i || i.length === 0)
407
407
  return "";
408
- const l = r.filter((W) => !t.includes(W)), Y = l.length > 0 ? l : r;
409
- if (Y.length === 0)
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 D;
411
+ let X;
412
412
  if (typeof crypto < "u" && crypto.getRandomValues) {
413
- const W = new Uint32Array(1);
414
- crypto.getRandomValues(W);
415
- const ge = W[0] / 4294967295;
416
- D = Math.floor(ge * Y.length);
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
- D = Math.floor(Math.random() * Y.length);
419
- return Y[D];
418
+ X = Math.floor(Math.random() * A.length);
419
+ return A[X];
420
420
  }, $e = () => {
421
421
  if (!b) return;
422
- z([]);
423
- const e = U(b, []);
422
+ W([]);
423
+ const e = Z(b, []);
424
424
  if (!e) {
425
425
  y("category");
426
426
  return;
427
427
  }
428
- I(e), z([e]), R([]), T(0), H(1), A(0), B(null), y("game");
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();
432
- /^[a-z]$/.test(t) && (R((r) => r.includes(t) ? r : [...r, t]), I((r) => (r && !r.includes(t) && T((l) => l + 1), r)));
432
+ /^[a-z]$/.test(t) && (R((i) => i.includes(t) ? i : [...i, t]), I((i) => (i && !i.includes(t) && T((l) => l + 1), i)));
433
433
  }, [x, f]), le = ue((e) => {
434
434
  se(e.key);
435
435
  }, [se]);
436
- he(() => {
436
+ me(() => {
437
437
  if (x === "game")
438
438
  return window.addEventListener("keydown", le), () => window.removeEventListener("keydown", le);
439
439
  }, [x, le]);
440
- const Se = v ? ke(v, F) : "", xe = v ? we(v, F) : !1, ye = V >= 10, ve = Me(F), ce = ue(() => {
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), z((e) => {
446
- const t = U(b, e);
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
- he(() => {
450
+ me(() => {
451
451
  if (xe && f === null) {
452
- B("win"), A((t) => t + 1);
452
+ B("win"), Y((t) => t + 1);
453
453
  const e = setTimeout(() => {
454
454
  ce();
455
455
  }, 2e3);
@@ -468,28 +468,28 @@ function Ye({
468
468
  y("result");
469
469
  return;
470
470
  }
471
- H((e) => e + 1), z((e) => {
472
- const t = U(b, e);
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
- he(() => {
476
+ me(() => {
477
477
  const e = () => {
478
- const t = window.innerWidth, r = window.innerHeight, l = t < 768 || t === 926 && r === 428 || t === 932 && r === 430, Y = r < 700, D = t / r > 1.8, q = t === 1024 && r === 600, W = l && t > r, ge = t >= 1200 && t <= 1400;
479
- if (re(l), ie(q), ae(W), k(ge), l)
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 (Y)
481
+ else if (A)
482
482
  O(null), E(1);
483
483
  else {
484
- const ze = t - 80, We = r - 80, be = Math.min(ze, We);
484
+ const We = t - 80, ze = i - 80, be = Math.min(We, ze);
485
485
  let pe;
486
- i && i >= 320 ? pe = Math.min(i, be) : pe = Math.min(1e3, be * 0.9);
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(D ? 0.85 : 1);
488
+ O(Ce), E(X ? 0.85 : 1);
489
489
  }
490
490
  };
491
491
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
492
- }, [i]);
492
+ }, [r]);
493
493
  const K = `
494
494
  <svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
495
495
  <!-- Каракули мелками и фломастерами -->
@@ -546,24 +546,26 @@ function Ye({
546
546
  position: "relative",
547
547
  boxSizing: "border-box",
548
548
  background: "transparent"
549
- }, X = Q(
549
+ }, D = Q(
550
550
  () => {
551
- const e = window.innerWidth, t = window.innerHeight;
552
- if (d && e > t || t < 700 || !de)
551
+ if (!de)
553
552
  return null;
554
- const r = c || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
553
+ const e = window.innerWidth;
554
+ if (d && e > window.innerHeight)
555
+ return null;
556
+ const t = c || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
555
557
  return /* @__PURE__ */ o("div", { style: a.gmLogoFixed, children: /* @__PURE__ */ h("picture", { children: [
556
558
  /* @__PURE__ */ o(
557
559
  "source",
558
560
  {
559
- srcSet: `${r}.svg`,
561
+ srcSet: `${t}.svg`,
560
562
  type: "image/svg+xml"
561
563
  }
562
564
  ),
563
565
  /* @__PURE__ */ o(
564
566
  "img",
565
567
  {
566
- src: `${r}.png`,
568
+ src: `${t}.png`,
567
569
  alt: "SPEAKID Logo",
568
570
  style: a.gmLogoImg,
569
571
  loading: "lazy"
@@ -573,7 +575,7 @@ function Ye({
573
575
  },
574
576
  [d, de, c, x]
575
577
  ), Be = () => x === "lobby" ? /* @__PURE__ */ h(G, { children: [
576
- X,
578
+ D,
577
579
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
578
580
  /* @__PURE__ */ o("h1", { style: {
579
581
  ...a.gmHeadline1,
@@ -592,7 +594,7 @@ function Ye({
592
594
  // Medium для более заметности
593
595
  fontSize: `${s.button}px`,
594
596
  padding: `${n * 1.2}px ${n * 3}px`,
595
- borderRadius: `${S * 1.5}px`,
597
+ borderRadius: `${v * 1.5}px`,
596
598
  position: "relative",
597
599
  zIndex: 1,
598
600
  display: "flex",
@@ -652,14 +654,14 @@ function Ye({
652
654
  /* @__PURE__ */ o(
653
655
  "img",
654
656
  {
655
- src: `${Z}/sun.png`,
657
+ src: `${V}/sun.png`,
656
658
  alt: "Sun",
657
659
  style: {
658
660
  position: "absolute",
659
661
  left: d ? "-10%" : "5%",
660
662
  top: "20%",
661
663
  width: "auto",
662
- height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || i || 1e3) * 0.33, 300)}px`,
664
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || r || 1e3) * 0.33, 300)}px`,
663
665
  maxHeight: "33vh",
664
666
  objectFit: "contain",
665
667
  opacity: 0.6
@@ -669,14 +671,14 @@ function Ye({
669
671
  /* @__PURE__ */ o(
670
672
  "img",
671
673
  {
672
- src: `${Z}/character.png`,
674
+ src: `${V}/character.png`,
673
675
  alt: "Hangman character",
674
676
  style: {
675
677
  position: "absolute",
676
678
  right: d ? "5%" : "10%",
677
679
  bottom: "10%",
678
680
  width: "auto",
679
- height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || i || 1e3) * 0.33, 300)}px`,
681
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || r || 1e3) * 0.33, 300)}px`,
680
682
  maxHeight: "33vh",
681
683
  objectFit: "contain",
682
684
  opacity: 0.6
@@ -685,7 +687,7 @@ function Ye({
685
687
  )
686
688
  ] })
687
689
  ] }) : x === "category" ? /* @__PURE__ */ h(G, { children: [
688
- X,
690
+ D,
689
691
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
690
692
  /* @__PURE__ */ o(
691
693
  "button",
@@ -702,7 +704,7 @@ function Ye({
702
704
  ...a.gmButtonSecondary,
703
705
  fontSize: `${s.button}px`,
704
706
  padding: `${n}px ${n * 1.5}px`,
705
- borderRadius: `${S}px`,
707
+ borderRadius: `${v}px`,
706
708
  position: "absolute",
707
709
  top: "60px",
708
710
  // ✅ Под логотипом (24px top логотипа + 28px высота + 8px отступ)
@@ -730,7 +732,7 @@ function Ye({
730
732
  fontWeight: 500,
731
733
  fontSize: `${s.button}px`,
732
734
  padding: `${n * 1.2}px ${n * 2}px`,
733
- borderRadius: `${S * 2}px`,
735
+ borderRadius: `${v * 2}px`,
734
736
  // Более округлые для облачков
735
737
  margin: `${n / 2}px`,
736
738
  background: "transparent",
@@ -745,7 +747,7 @@ function Ye({
745
747
  e
746
748
  )) })
747
749
  ] }) : x === "rounds" ? /* @__PURE__ */ h(G, { children: [
748
- X,
750
+ D,
749
751
  /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
750
752
  /* @__PURE__ */ o(
751
753
  "button",
@@ -762,7 +764,7 @@ function Ye({
762
764
  ...a.gmButtonSecondary,
763
765
  fontSize: `${s.button}px`,
764
766
  padding: `${n}px ${n * 1.5}px`,
765
- borderRadius: `${S}px`,
767
+ borderRadius: `${v}px`,
766
768
  position: "absolute",
767
769
  top: "60px",
768
770
  // ✅ Под логотипом (24px top логотипа + 28px высота + 8px отступ)
@@ -791,7 +793,7 @@ function Ye({
791
793
  fontWeight: 500,
792
794
  fontSize: `${s.button}px`,
793
795
  padding: `${n * 1.2}px ${n * 2}px`,
794
- borderRadius: `${S * 2}px`,
796
+ borderRadius: `${v * 2}px`,
795
797
  // Более округлые для облачков
796
798
  margin: `${n / 2}px`,
797
799
  background: "transparent",
@@ -806,7 +808,7 @@ function Ye({
806
808
  e
807
809
  )) })
808
810
  ] }) : x === "game" ? /* @__PURE__ */ h(G, { children: [
809
- X,
811
+ D,
810
812
  !u && /* @__PURE__ */ o("div", { dangerouslySetInnerHTML: { __html: K } }),
811
813
  " ",
812
814
  /* @__PURE__ */ h("div", { style: {
@@ -815,20 +817,26 @@ function Ye({
815
817
  // ✅ Уменьшаем padding в landscape
816
818
  marginBottom: `${u ? n * 0.3 : n * 0.5}px`,
817
819
  // ✅ Уменьшаем margin в landscape
818
- maxWidth: `${(p || i) * 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"
819
827
  }, children: [
820
- /* @__PURE__ */ h("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${n * 0.5}px` }, children: [
828
+ /* @__PURE__ */ h("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${n * 0.2}px`, textAlign: "center" }, children: [
821
829
  "Category: ",
822
830
  b
823
831
  ] }),
824
- /* @__PURE__ */ h("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px" }, children: [
832
+ /* @__PURE__ */ h("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px", textAlign: "center" }, children: [
825
833
  "Round ",
826
834
  L,
827
835
  " of ",
828
836
  M
829
837
  ] })
830
838
  ] }),
831
- v && /* @__PURE__ */ h("p", { style: {
839
+ S && /* @__PURE__ */ h("p", { style: {
832
840
  ...a.gmBodyS,
833
841
  fontSize: `${s.bodyS}px`,
834
842
  marginTop: `${u ? n * 0.3 : n * 0.5}px`,
@@ -837,7 +845,7 @@ function Ye({
837
845
  // ✅ Уменьшаем margin в landscape
838
846
  }, children: [
839
847
  "I am thinking of a word that is ",
840
- /* @__PURE__ */ o("strong", { children: v.length }),
848
+ /* @__PURE__ */ o("strong", { children: S.length }),
841
849
  " letters long"
842
850
  ] }),
843
851
  /* @__PURE__ */ o("div", { style: {
@@ -849,9 +857,9 @@ function Ye({
849
857
  }, children: /* @__PURE__ */ o(
850
858
  He,
851
859
  {
852
- mistakes: V,
860
+ mistakes: U,
853
861
  maxMistakes: oe,
854
- size: j ? Math.max(80, Math.min(110, (p || i) * 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 || i) * 0.2))
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))
855
863
  }
856
864
  ) }),
857
865
  /* @__PURE__ */ o("div", { style: {
@@ -861,8 +869,8 @@ function Ye({
861
869
  // ✅ Уменьшаем margin в landscape
862
870
  letterSpacing: `${n * 0.8}px`,
863
871
  minHeight: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9)) * 1.2}px`
864
- }, children: Se || "Loading..." }),
865
- /* @__PURE__ */ h("div", { style: {
872
+ }, children: ve || "Loading..." }),
873
+ /* @__PURE__ */ o("div", { style: {
866
874
  ...a.gmInfoBox,
867
875
  padding: `${u ? n * 0.6 : n}px`,
868
876
  // ✅ Уменьшаем padding в landscape
@@ -870,52 +878,48 @@ function Ye({
870
878
  // ✅ Уменьшаем margin в landscape
871
879
  marginBottom: `${u ? n * 0.5 : n}px`,
872
880
  // ✅ Уменьшаем margin в landscape
873
- maxWidth: `${(p || i) * 0.95}px`
874
- }, children: [
875
- /* @__PURE__ */ o("p", { style: {
876
- ...a.gmBodyS,
877
- fontSize: `${s.bodyS}px`,
878
- marginBottom: `${n}px`,
879
- fontWeight: 500
880
- // Medium
881
- }, children: "Available letters:" }),
882
- /* @__PURE__ */ o("div", { style: {
883
- display: "flex",
884
- flexWrap: "wrap",
885
- gap: `${n / 3}px`,
886
- justifyContent: "center",
887
- fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
888
- fontFamily: '"Onest", system-ui, sans-serif'
889
- }, children: ve.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");
896
- },
897
- onMouseLeave: (t) => {
898
- f === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
899
- },
900
- style: {
901
- padding: `${n / 4}px ${n / 3}px`,
902
- borderRadius: `${S * 0.5}px`,
903
- background: "#f9f9f9",
904
- color: "#1f2937",
905
- border: "1px solid #e5e7eb",
906
- minWidth: `${Math.max(n * 1.5, (p || i) * 0.04)}px`,
907
- textAlign: "center",
908
- display: "inline-block",
909
- cursor: f === null ? "pointer" : "default",
910
- fontFamily: '"Onest", system-ui, sans-serif',
911
- fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
912
- transition: "background-color 0.2s ease"
913
- },
914
- children: e
881
+ maxWidth: `${(p || r) * 0.95}px`
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");
915
896
  },
916
- e
917
- )) })
918
- ] }),
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
+ )) }) }),
919
923
  F.length > 0 && /* @__PURE__ */ o("div", { style: {
920
924
  ...a.gmGuessedLetters,
921
925
  fontSize: `${Math.max(10, Math.min(12, s.bodyS * 0.85))}px`,
@@ -936,7 +940,7 @@ function Ye({
936
940
  margin: "2px 0"
937
941
  }, children: [
938
942
  "The hangman is complete! The word was: ",
939
- /* @__PURE__ */ o("strong", { children: v })
943
+ /* @__PURE__ */ o("strong", { children: S })
940
944
  ] }),
941
945
  f !== null && L < M && /* @__PURE__ */ o("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ o(
942
946
  "button",
@@ -952,7 +956,7 @@ function Ye({
952
956
  ...a.gmButton,
953
957
  fontSize: `${Math.max(11, Math.min(14, s.button * 0.85))}px`,
954
958
  padding: `${n * 0.6}px ${n * 1.2}px`,
955
- borderRadius: `${S}px`
959
+ borderRadius: `${v}px`
956
960
  },
957
961
  children: "NEXT"
958
962
  }
@@ -971,7 +975,7 @@ function Ye({
971
975
  ...a.gmButton,
972
976
  fontSize: `${s.button}px`,
973
977
  padding: `${n}px ${n * 1.5}px`,
974
- borderRadius: `${S}px`
978
+ borderRadius: `${v}px`
975
979
  },
976
980
  children: "View results"
977
981
  }
@@ -983,7 +987,7 @@ function Ye({
983
987
  marginBottom: `${n}px`
984
988
  }, children: "Type a letter on your keyboard" })
985
989
  ] }) : x === "result" ? /* @__PURE__ */ h(G, { children: [
986
- X,
990
+ D,
987
991
  /* @__PURE__ */ o("h1", { style: {
988
992
  ...a.gmHeadline1,
989
993
  fontSize: `${s.headline1}px`,
@@ -1014,9 +1018,9 @@ function Ye({
1014
1018
  y("lobby");
1015
1019
  return;
1016
1020
  }
1017
- z([]);
1018
- const e = U(b, []);
1019
- e && (I(e), z([e]), R([]), T(0), H(1), A(0), B(null), y("game"));
1021
+ W([]);
1022
+ const e = Z(b, []);
1023
+ e && (I(e), W([e]), R([]), T(0), H(1), Y(0), B(null), y("game"));
1020
1024
  },
1021
1025
  onMouseEnter: (e) => {
1022
1026
  e.currentTarget.style.backgroundColor = "#d43a32";
@@ -1028,7 +1032,7 @@ function Ye({
1028
1032
  ...a.gmButton,
1029
1033
  fontSize: `${s.button}px`,
1030
1034
  padding: `${n}px ${n * 1.5}px`,
1031
- borderRadius: `${S}px`,
1035
+ borderRadius: `${v}px`,
1032
1036
  minWidth: "200px"
1033
1037
  },
1034
1038
  children: "Play again"
@@ -1049,7 +1053,7 @@ function Ye({
1049
1053
  ...a.gmButtonSecondary,
1050
1054
  fontSize: `${s.button}px`,
1051
1055
  padding: `${n}px ${n * 1.5}px`,
1052
- borderRadius: `${S}px`,
1056
+ borderRadius: `${v}px`,
1053
1057
  minWidth: "200px"
1054
1058
  },
1055
1059
  children: "Exit"
@@ -1078,8 +1082,8 @@ function Ye({
1078
1082
  "div",
1079
1083
  {
1080
1084
  style: {
1081
- width: d ? "100%" : p || i || 1e3,
1082
- height: d ? "100%" : p || i || 1e3,
1085
+ width: d ? "100%" : p || r || 1e3,
1086
+ height: d ? "100%" : p || r || 1e3,
1083
1087
  display: "flex",
1084
1088
  justifyContent: "center",
1085
1089
  alignItems: "center",
@@ -1112,8 +1116,8 @@ function Ye({
1112
1116
  );
1113
1117
  }
1114
1118
  export {
1115
- Ye as Game,
1116
- Ye as HangmanLobbyGame,
1117
- Ye as default
1119
+ Ae as Game,
1120
+ Ae as HangmanLobbyGame,
1121
+ Ae as default
1118
1122
  };
1119
1123
  //# sourceMappingURL=speakid-hangman.es.js.map