speakid-hangman 1.0.4 → 1.0.5

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 n, jsxs as u, Fragment as O } from "react/jsx-runtime";
2
- import { useState as m, useMemo as X, useCallback as ae, useEffect as le } from "react";
2
+ import { useState as m, useMemo as X, useCallback as le, useEffect as de } from "react";
3
3
  const a = {
4
4
  gmCenterScreen: {
5
5
  position: "relative",
@@ -183,7 +183,8 @@ const a = {
183
183
  top: "16px",
184
184
  left: "16px",
185
185
  width: "auto",
186
- zIndex: 10,
186
+ zIndex: 30,
187
+ // ✅ Унифицирован zIndex для консистентности
187
188
  pointerEvents: "none",
188
189
  background: "transparent",
189
190
  transform: "none",
@@ -201,42 +202,49 @@ const a = {
201
202
  display: "block"
202
203
  }
203
204
  };
204
- function ve({
205
+ function Se({
205
206
  mistakes: r,
206
207
  maxMistakes: U,
207
208
  size: D = 200
208
209
  }) {
209
- const l = D, d = D * 1.25, y = Math.max(2, D / 100), T = 10 * (l / 200), b = 240 * (d / 250), f = 150 * (l / 200), x = 80 * (l / 200), Z = 20 * (d / 250), G = 240 * (d / 250), w = 80 * (l / 200), Q = 20 * (d / 250), $ = 150 * (l / 200), B = 150 * (l / 200), M = 20 * (d / 250), z = 50 * (d / 250), v = 150 * (l / 200), C = 70 * (d / 250), N = 20 * (l / 200), S = 150 * (l / 200), K = 90 * (d / 250), E = 150 * (d / 250), h = 150 * (l / 200), F = 110 * (d / 250), g = 130 * (l / 200), W = 130 * (d / 250), q = 150 * (l / 200), H = 110 * (d / 250), ce = 170 * (l / 200), L = 130 * (d / 250), J = 150 * (l / 200), _ = 150 * (d / 250), p = 130 * (l / 200), ee = 190 * (d / 250), I = 150 * (l / 200), te = 150 * (d / 250), s = 170 * (l / 200), ne = 190 * (d / 250), c = r === 0 || r <= U * 0.5 ? "#1f2937" : r <= U * 0.75 ? "#f59e0b" : "#ec4c44";
210
+ const l = D, g = D * 1.25, b = Math.max(3, D / 100), T = 10 * (l / 200), f = 240 * (g / 250), x = 150 * (l / 200), y = 80 * (l / 200), K = 20 * (g / 250), G = 240 * (g / 250), w = 80 * (l / 200), Q = 20 * (g / 250), $ = 150 * (l / 200), B = 150 * (l / 200), M = 20 * (g / 250), z = 50 * (g / 250), v = 150 * (l / 200), W = 70 * (g / 250), N = 20 * (l / 200), S = 150 * (l / 200), q = 90 * (g / 250), E = 150 * (g / 250), h = 150 * (l / 200), F = 110 * (g / 250), p = 130 * (l / 200), C = 130 * (g / 250), J = 150 * (l / 200), H = 110 * (g / 250), ce = 170 * (l / 200), L = 130 * (g / 250), ee = 150 * (l / 200), _ = 150 * (g / 250), d = 130 * (l / 200), te = 190 * (g / 250), I = 150 * (l / 200), ne = 150 * (g / 250), s = 170 * (l / 200), V = 190 * (g / 250), c = r === 0 || r <= U * 0.5 ? "#1f2937" : r <= U * 0.75 ? "#f59e0b" : "#ec4c44";
210
211
  return /* @__PURE__ */ u(
211
212
  "svg",
212
213
  {
213
214
  width: l,
214
- height: d,
215
+ height: g,
216
+ viewBox: "0 0 200 250",
215
217
  style: {
216
218
  display: "block",
217
- margin: "0 auto"
219
+ margin: "0 auto",
220
+ overflow: "visible",
221
+ // ✅ Для корректного отображения линий
222
+ WebkitFontSmoothing: "antialiased",
223
+ // ✅ Для лучшего рендеринга на iOS
224
+ transform: "translateZ(0)"
225
+ // ✅ Включение аппаратного ускорения на iOS
218
226
  },
219
227
  children: [
220
228
  r > 0 && /* @__PURE__ */ n(
221
229
  "line",
222
230
  {
223
231
  x1: T,
224
- y1: b,
225
- x2: f,
226
- y2: b,
232
+ y1: f,
233
+ x2: x,
234
+ y2: f,
227
235
  stroke: c,
228
- strokeWidth: y
236
+ strokeWidth: b
229
237
  }
230
238
  ),
231
239
  r > 1 && /* @__PURE__ */ n(
232
240
  "line",
233
241
  {
234
- x1: x,
235
- y1: Z,
236
- x2: x,
242
+ x1: y,
243
+ y1: K,
244
+ x2: y,
237
245
  y2: G,
238
246
  stroke: c,
239
- strokeWidth: y
247
+ strokeWidth: b
240
248
  }
241
249
  ),
242
250
  r > 2 && /* @__PURE__ */ n(
@@ -247,7 +255,7 @@ function ve({
247
255
  x2: $,
248
256
  y2: Q,
249
257
  stroke: c,
250
- strokeWidth: y
258
+ strokeWidth: b
251
259
  }
252
260
  ),
253
261
  r > 3 && /* @__PURE__ */ n(
@@ -258,29 +266,29 @@ function ve({
258
266
  x2: B,
259
267
  y2: z,
260
268
  stroke: c,
261
- strokeWidth: y
269
+ strokeWidth: b
262
270
  }
263
271
  ),
264
272
  r > 4 && /* @__PURE__ */ n(
265
273
  "circle",
266
274
  {
267
275
  cx: v,
268
- cy: C,
276
+ cy: W,
269
277
  r: N,
270
278
  stroke: c,
271
279
  fill: "none",
272
- strokeWidth: y
280
+ strokeWidth: b
273
281
  }
274
282
  ),
275
283
  r > 5 && /* @__PURE__ */ n(
276
284
  "line",
277
285
  {
278
286
  x1: S,
279
- y1: K,
287
+ y1: q,
280
288
  x2: S,
281
289
  y2: E,
282
290
  stroke: c,
283
- strokeWidth: y
291
+ strokeWidth: b
284
292
  }
285
293
  ),
286
294
  r > 6 && /* @__PURE__ */ n(
@@ -288,56 +296,56 @@ function ve({
288
296
  {
289
297
  x1: h,
290
298
  y1: F,
291
- x2: g,
292
- y2: W,
299
+ x2: p,
300
+ y2: C,
293
301
  stroke: c,
294
- strokeWidth: y
302
+ strokeWidth: b
295
303
  }
296
304
  ),
297
305
  r > 7 && /* @__PURE__ */ n(
298
306
  "line",
299
307
  {
300
- x1: q,
308
+ x1: J,
301
309
  y1: H,
302
310
  x2: ce,
303
311
  y2: L,
304
312
  stroke: c,
305
- strokeWidth: y
313
+ strokeWidth: b
306
314
  }
307
315
  ),
308
316
  r > 8 && /* @__PURE__ */ n(
309
317
  "line",
310
318
  {
311
- x1: J,
319
+ x1: ee,
312
320
  y1: _,
313
- x2: p,
314
- y2: ee,
321
+ x2: d,
322
+ y2: te,
315
323
  stroke: c,
316
- strokeWidth: y
324
+ strokeWidth: b
317
325
  }
318
326
  ),
319
327
  r > 9 && /* @__PURE__ */ n(
320
328
  "line",
321
329
  {
322
330
  x1: I,
323
- y1: te,
331
+ y1: ne,
324
332
  x2: s,
325
- y2: ne,
333
+ y2: V,
326
334
  stroke: c,
327
- strokeWidth: y
335
+ strokeWidth: b
328
336
  }
329
337
  )
330
338
  ]
331
339
  }
332
340
  );
333
341
  }
334
- function Le({
342
+ function Te({
335
343
  gameCubeSize: r = 400,
336
344
  screenHeight: U = 800,
337
345
  screenWidth: D = 800,
338
346
  logoUrl: l,
339
- showLogo: d = !0,
340
- baseURL: y
347
+ showLogo: g = !0,
348
+ baseURL: b
341
349
  } = {}) {
342
350
  const T = {
343
351
  Professions: ["teacher", "doctor", "nurse", "driver", "police", "firefighter", "cook", "waiter", "farmer", "builder", "singer", "actor", "dentist", "pilot", "vet", "artist", "cleaner", "student", "baker", "mechanic"],
@@ -357,36 +365,36 @@ function Le({
357
365
  Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
358
366
  Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
359
367
  Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
360
- }, [b, f] = m("lobby"), [x, Z] = m(""), [G] = m("Normal"), [w, Q] = m(0), [$, B] = m(1), [M, z] = m(""), [v, C] = m([]), [N, S] = m(0), [K, E] = m(0), [h, F] = m(null), [g, W] = m(null), [q, H] = m(1), [ce, L] = m([]), J = G === "Easy" ? 8 : G === "Normal" ? 6 : 4, _ = y || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [p, ee] = m(!1), [I, te] = m(!1), s = X(() => {
361
- const e = (g || r || 1e3) / 400;
368
+ }, [f, x] = m("lobby"), [y, K] = m(""), [G] = m("Normal"), [w, Q] = m(0), [$, B] = m(1), [M, z] = m(""), [v, W] = m([]), [N, S] = m(0), [q, E] = m(0), [h, F] = m(null), [p, C] = m(null), [J, H] = m(1), [ce, L] = m([]), ee = G === "Easy" ? 8 : G === "Normal" ? 6 : 4, _ = b || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [d, te] = m(!1), [I, ne] = m(!1), s = X(() => {
369
+ const e = (p || r || 1e3) / 400;
362
370
  return {
363
- headline1: p ? Math.max(24, Math.min(30, 30 * e)) : Math.max(28, Math.min(32, 32 * e)),
371
+ headline1: d ? Math.max(24, Math.min(30, 30 * e)) : Math.max(28, Math.min(32, 32 * e)),
364
372
  // Desktop: 32px
365
373
  headline2: Math.max(20, Math.min(28, 24 * e)),
366
374
  // Desktop: 24px
367
- headline3: p ? Math.max(14, Math.min(18, 16 * e)) : Math.max(20, Math.min(26, 24 * e)),
375
+ headline3: d ? Math.max(14, Math.min(18, 16 * e)) : Math.max(20, Math.min(26, 24 * e)),
368
376
  // Desktop: 24px
369
377
  bodyL: Math.max(14, Math.min(20, 18 * e)),
370
378
  // Desktop: 18px
371
- bodyM: p ? Math.max(12, Math.min(16, 14 * e)) : Math.max(14, Math.min(18, 16 * e)),
379
+ bodyM: d ? Math.max(12, Math.min(16, 14 * e)) : Math.max(14, Math.min(18, 16 * e)),
372
380
  // Desktop: 16px
373
- bodyS: p ? Math.max(10, Math.min(14, 12 * e)) : Math.max(12, Math.min(16, 14 * e)),
381
+ bodyS: d ? Math.max(10, Math.min(14, 12 * e)) : Math.max(12, Math.min(16, 14 * e)),
374
382
  // Desktop: 14px
375
383
  wordDisplay: Math.max(18, Math.min(32, 26 * e)),
376
384
  // Адаптивный размер
377
385
  button: Math.max(12, Math.min(18, 16 * e))
378
386
  // Desktop: 16px
379
387
  };
380
- }, [p, g, r]), ne = X(() => {
381
- const e = (g || r || 1e3) / 400;
388
+ }, [d, p, r]), V = X(() => {
389
+ const e = (p || r || 1e3) / 400;
382
390
  return I ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e));
383
- }, [I, g, r]), o = X(() => {
384
- const e = (g || r || 1e3) / 400;
391
+ }, [I, p, r]), o = X(() => {
392
+ const e = (p || r || 1e3) / 400;
385
393
  return I ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e));
386
- }, [I, g, r]), c = X(() => {
387
- const e = (g || r || 1e3) / 400;
394
+ }, [I, p, r]), c = X(() => {
395
+ const e = (p || r || 1e3) / 400;
388
396
  return Math.max(6, Math.min(10, 8 * e));
389
- }, [g, r]), he = (e, t) => e.split("").every((i) => t.includes(i)), me = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), fe = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)), V = (e, t = []) => {
397
+ }, [p, r]), he = (e, t) => e.split("").every((i) => t.includes(i)), me = (e, t) => e.split("").map((i) => t.includes(i) ? i : "_").join(" "), fe = (e) => "abcdefghijklmnopqrstuvwxyz".split("").filter((i) => !e.includes(i)), Z = (e, t = []) => {
390
398
  var P;
391
399
  if (!e || !T[e]) {
392
400
  const k = Object.keys(T)[0];
@@ -408,77 +416,77 @@ function Le({
408
416
  A = Math.floor(Math.random() * j.length);
409
417
  return j[A];
410
418
  }, xe = () => {
411
- if (!x) return;
419
+ if (!y) return;
412
420
  L([]);
413
- const e = V(x, []);
421
+ const e = Z(y, []);
414
422
  if (!e) {
415
- f("category");
423
+ x("category");
416
424
  return;
417
425
  }
418
- z(e), L([e]), C([]), S(0), B(1), E(0), F(null), f("game");
419
- }, oe = ae((e) => {
420
- if (b !== "game" || h !== null) return;
426
+ z(e), L([e]), W([]), S(0), B(1), E(0), F(null), x("game");
427
+ }, oe = le((e) => {
428
+ if (f !== "game" || h !== null) return;
421
429
  const t = e.toLowerCase();
422
- /^[a-z]$/.test(t) && (C((i) => i.includes(t) ? i : [...i, t]), z((i) => (i && !i.includes(t) && S((R) => R + 1), i)));
423
- }, [b, h]), re = ae((e) => {
430
+ /^[a-z]$/.test(t) && (W((i) => i.includes(t) ? i : [...i, t]), z((i) => (i && !i.includes(t) && S((R) => R + 1), i)));
431
+ }, [f, h]), re = le((e) => {
424
432
  oe(e.key);
425
433
  }, [oe]);
426
- le(() => {
427
- if (b === "game")
434
+ de(() => {
435
+ if (f === "game")
428
436
  return window.addEventListener("keydown", re), () => window.removeEventListener("keydown", re);
429
- }, [b, re]);
430
- const ye = M ? me(M, v) : "", de = M ? he(M, v) : !1, ge = N >= 10, be = fe(v), ie = ae(() => {
431
- if (!x || $ >= w) {
432
- f("result");
437
+ }, [f, re]);
438
+ const ye = M ? me(M, v) : "", ge = M ? he(M, v) : !1, pe = N >= 10, be = fe(v), ie = le(() => {
439
+ if (!y || $ >= w) {
440
+ x("result");
433
441
  return;
434
442
  }
435
443
  B((e) => e + 1), L((e) => {
436
- const t = V(x, e);
444
+ const t = Z(y, e);
437
445
  return t ? (z(t), [...e, t]) : e;
438
- }), C([]), S(0), F(null);
439
- }, [x, $, w]);
440
- le(() => {
441
- if (de && h === null) {
446
+ }), W([]), S(0), F(null);
447
+ }, [y, $, w]);
448
+ de(() => {
449
+ if (ge && h === null) {
442
450
  F("win"), E((t) => t + 1);
443
451
  const e = setTimeout(() => {
444
452
  ie();
445
453
  }, 2e3);
446
454
  return () => clearTimeout(e);
447
455
  }
448
- if (ge && h === null) {
456
+ if (pe && h === null) {
449
457
  F("lose");
450
458
  const e = setTimeout(() => {
451
459
  ie();
452
460
  }, 2e3);
453
461
  return () => clearTimeout(e);
454
462
  }
455
- }, [de, ge, h, ie]);
463
+ }, [ge, pe, h, ie]);
456
464
  const ke = () => {
457
- if (!x || $ >= w) {
458
- f("result");
465
+ if (!y || $ >= w) {
466
+ x("result");
459
467
  return;
460
468
  }
461
469
  B((e) => e + 1), L((e) => {
462
- const t = V(x, e);
470
+ const t = Z(y, e);
463
471
  return t ? (z(t), [...e, t]) : e;
464
- }), C([]), S(0), F(null);
472
+ }), W([]), S(0), F(null);
465
473
  };
466
- le(() => {
474
+ de(() => {
467
475
  const e = () => {
468
476
  const t = window.innerWidth, i = window.innerHeight, R = t < 768 || t === 926 && i === 428 || t === 932 && i === 430, j = i < 700, A = t / i > 1.8, P = t === 1024 && i === 600;
469
- if (ee(R), te(P), r && r >= 320) {
470
- const $e = Math.max(320, Math.min(1200, r));
471
- W($e), H(1);
477
+ if (te(R), ne(P), r && r >= 320) {
478
+ const ve = Math.max(320, Math.min(1200, r));
479
+ C(ve), H(1);
472
480
  } else if (R)
473
- W(null), H(1);
481
+ C(null), H(1);
474
482
  else if (j)
475
- W(null), H(1);
483
+ C(null), H(1);
476
484
  else if (A) {
477
485
  const k = Math.min(1e3, Math.min(t, i) * 0.9);
478
- W(k), H(0.85);
486
+ C(k), H(0.85);
479
487
  } else {
480
488
  const k = Math.min(1e3, Math.min(t, i) * 0.9);
481
- W(k), H(1);
489
+ C(k), H(1);
482
490
  }
483
491
  };
484
492
  return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
@@ -527,22 +535,24 @@ function Le({
527
535
  <path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
528
536
  fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
529
537
  </svg>
530
- `, we = {
538
+ `, we = !d && typeof window < "u" && window.innerWidth >= 768 && window.innerWidth < 1024, ae = !d && g && (f !== "game" || we), Me = {
531
539
  ...a.gmCenterScreen,
532
540
  width: "100%",
533
541
  height: "100%",
534
- padding: `${ne}px`,
542
+ padding: `${V}px`,
543
+ paddingTop: ae ? "60px" : `${V}px`,
544
+ // ✅ Резервируем место под логотип (16px top + 28px высота + 16px отступ)
535
545
  overflow: "auto",
536
546
  position: "relative",
537
547
  boxSizing: "border-box",
538
548
  background: "transparent"
539
- }, pe = !p && d, Y = X(
549
+ }, Y = X(
540
550
  () => {
541
551
  const e = window.innerWidth, t = window.innerHeight;
542
- if (p && e > t || t < 700 || !pe)
552
+ if (d && e > t || t < 700 || !ae)
543
553
  return null;
544
554
  const i = l || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
545
- return /* @__PURE__ */ n("div", { style: { ...a.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: /* @__PURE__ */ u("picture", { children: [
555
+ return /* @__PURE__ */ n("div", { style: a.gmLogoFixed, children: /* @__PURE__ */ u("picture", { children: [
546
556
  /* @__PURE__ */ n(
547
557
  "source",
548
558
  {
@@ -561,8 +571,8 @@ function Le({
561
571
  )
562
572
  ] }) });
563
573
  },
564
- [p, pe, l]
565
- ), Me = () => b === "lobby" ? /* @__PURE__ */ u(O, { children: [
574
+ [d, ae, l, f]
575
+ ), $e = () => f === "lobby" ? /* @__PURE__ */ u(O, { children: [
566
576
  Y,
567
577
  /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
568
578
  /* @__PURE__ */ n("h1", { style: {
@@ -575,7 +585,7 @@ function Le({
575
585
  /* @__PURE__ */ u(
576
586
  "button",
577
587
  {
578
- onClick: () => f("category"),
588
+ onClick: () => x("category"),
579
589
  style: {
580
590
  fontFamily: '"Onest", system-ui, sans-serif',
581
591
  fontWeight: 500,
@@ -646,10 +656,10 @@ function Le({
646
656
  alt: "Sun",
647
657
  style: {
648
658
  position: "absolute",
649
- left: p ? "-10%" : "5%",
659
+ left: d ? "-10%" : "5%",
650
660
  top: "20%",
651
661
  width: "auto",
652
- height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
662
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || r || 1e3) * 0.33, 300)}px`,
653
663
  maxHeight: "33vh",
654
664
  objectFit: "contain",
655
665
  opacity: 0.6
@@ -663,10 +673,10 @@ function Le({
663
673
  alt: "Hangman character",
664
674
  style: {
665
675
  position: "absolute",
666
- right: p ? "5%" : "10%",
676
+ right: d ? "5%" : "10%",
667
677
  bottom: "10%",
668
678
  width: "auto",
669
- height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
679
+ height: d ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((p || r || 1e3) * 0.33, 300)}px`,
670
680
  maxHeight: "33vh",
671
681
  objectFit: "contain",
672
682
  opacity: 0.6
@@ -674,13 +684,13 @@ function Le({
674
684
  }
675
685
  )
676
686
  ] })
677
- ] }) : b === "category" ? /* @__PURE__ */ u(O, { children: [
687
+ ] }) : f === "category" ? /* @__PURE__ */ u(O, { children: [
678
688
  Y,
679
689
  /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
680
690
  /* @__PURE__ */ n(
681
691
  "button",
682
692
  {
683
- onClick: () => f("lobby"),
693
+ onClick: () => x("lobby"),
684
694
  onMouseEnter: (e) => {
685
695
  e.currentTarget.style.backgroundColor = "#e5e7eb";
686
696
  },
@@ -707,7 +717,7 @@ function Le({
707
717
  "button",
708
718
  {
709
719
  onClick: () => {
710
- Z(e), f("rounds");
720
+ K(e), x("rounds");
711
721
  },
712
722
  onMouseEnter: (t) => {
713
723
  t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
@@ -734,13 +744,13 @@ function Le({
734
744
  },
735
745
  e
736
746
  )) })
737
- ] }) : b === "rounds" ? /* @__PURE__ */ u(O, { children: [
747
+ ] }) : f === "rounds" ? /* @__PURE__ */ u(O, { children: [
738
748
  Y,
739
749
  /* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
740
750
  /* @__PURE__ */ n(
741
751
  "button",
742
752
  {
743
- onClick: () => f("category"),
753
+ onClick: () => x("category"),
744
754
  onMouseEnter: (e) => {
745
755
  e.currentTarget.style.backgroundColor = "#e5e7eb";
746
756
  },
@@ -795,17 +805,17 @@ function Le({
795
805
  },
796
806
  e
797
807
  )) })
798
- ] }) : b === "game" ? /* @__PURE__ */ u(O, { children: [
808
+ ] }) : f === "game" ? /* @__PURE__ */ u(O, { children: [
799
809
  Y,
800
810
  /* @__PURE__ */ u("div", { style: {
801
811
  ...a.gmInfoBox,
802
812
  padding: `${o * 0.8}px`,
803
813
  marginBottom: `${o * 0.5}px`,
804
- maxWidth: `${(g || r) * 0.9}px`
814
+ maxWidth: `${(p || r) * 0.9}px`
805
815
  }, children: [
806
816
  /* @__PURE__ */ u("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${o * 0.5}px` }, children: [
807
817
  "Category: ",
808
- x
818
+ y
809
819
  ] }),
810
820
  /* @__PURE__ */ u("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px" }, children: [
811
821
  "Round ",
@@ -830,11 +840,11 @@ function Le({
830
840
  justifyContent: "center",
831
841
  alignItems: "center"
832
842
  }, children: /* @__PURE__ */ n(
833
- ve,
843
+ Se,
834
844
  {
835
845
  mistakes: N,
836
- maxMistakes: J,
837
- size: I ? Math.max(80, Math.min(110, (g || r) * 0.16)) : Math.max(100, Math.min(150, (g || r) * 0.2))
846
+ maxMistakes: ee,
847
+ size: I ? Math.max(80, Math.min(110, (p || r) * 0.16)) : d ? 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))
838
848
  }
839
849
  ) }),
840
850
  /* @__PURE__ */ n("div", { style: {
@@ -849,7 +859,7 @@ function Le({
849
859
  padding: `${o}px`,
850
860
  marginTop: `${o}px`,
851
861
  marginBottom: `${o}px`,
852
- maxWidth: `${(g || r) * 0.95}px`
862
+ maxWidth: `${(p || r) * 0.95}px`
853
863
  }, children: [
854
864
  /* @__PURE__ */ n("p", { style: {
855
865
  ...a.gmBodyS,
@@ -882,7 +892,7 @@ function Le({
882
892
  background: "#f9f9f9",
883
893
  color: "#1f2937",
884
894
  border: "1px solid #e5e7eb",
885
- minWidth: `${Math.max(o * 1.5, (g || r) * 0.04)}px`,
895
+ minWidth: `${Math.max(o * 1.5, (p || r) * 0.04)}px`,
886
896
  textAlign: "center",
887
897
  display: "inline-block",
888
898
  cursor: h === null ? "pointer" : "default",
@@ -939,7 +949,7 @@ function Le({
939
949
  h !== null && $ >= w && /* @__PURE__ */ n("div", { style: { marginTop: "2px", marginBottom: `${o}px` }, children: /* @__PURE__ */ n(
940
950
  "button",
941
951
  {
942
- onClick: () => f("result"),
952
+ onClick: () => x("result"),
943
953
  onMouseEnter: (e) => {
944
954
  e.currentTarget.style.backgroundColor = "#d43a32";
945
955
  },
@@ -952,7 +962,7 @@ function Le({
952
962
  padding: `${o}px ${o * 1.5}px`,
953
963
  borderRadius: `${c}px`
954
964
  },
955
- children: "View Results →"
965
+ children: "View results"
956
966
  }
957
967
  ) }),
958
968
  h === null && v.length === 0 && /* @__PURE__ */ n("p", { style: {
@@ -961,7 +971,7 @@ function Le({
961
971
  marginTop: `${o}px`,
962
972
  marginBottom: `${o}px`
963
973
  }, children: "Type a letter on your keyboard" })
964
- ] }) : b === "result" ? /* @__PURE__ */ u(O, { children: [
974
+ ] }) : f === "result" ? /* @__PURE__ */ u(O, { children: [
965
975
  Y,
966
976
  /* @__PURE__ */ n("h1", { style: {
967
977
  ...a.gmHeadline1,
@@ -974,7 +984,7 @@ function Le({
974
984
  marginBottom: `${o * 2}px`
975
985
  }, children: [
976
986
  "You guessed ",
977
- /* @__PURE__ */ n("strong", { children: K }),
987
+ /* @__PURE__ */ n("strong", { children: q }),
978
988
  " out of ",
979
989
  /* @__PURE__ */ n("strong", { children: w }),
980
990
  " words correctly."
@@ -989,13 +999,13 @@ function Le({
989
999
  "button",
990
1000
  {
991
1001
  onClick: () => {
992
- if (!x || w === 0) {
993
- f("lobby");
1002
+ if (!y || w === 0) {
1003
+ x("lobby");
994
1004
  return;
995
1005
  }
996
1006
  L([]);
997
- const e = V(x, []);
998
- e && (z(e), L([e]), C([]), S(0), B(1), E(0), F(null), f("game"));
1007
+ const e = Z(y, []);
1008
+ e && (z(e), L([e]), W([]), S(0), B(1), E(0), F(null), x("game"));
999
1009
  },
1000
1010
  onMouseEnter: (e) => {
1001
1011
  e.currentTarget.style.backgroundColor = "#d43a32";
@@ -1016,7 +1026,7 @@ function Le({
1016
1026
  /* @__PURE__ */ n(
1017
1027
  "button",
1018
1028
  {
1019
- onClick: () => f("lobby"),
1029
+ onClick: () => x("lobby"),
1020
1030
  onMouseEnter: (e) => {
1021
1031
  e.currentTarget.style.backgroundColor = "#e5e7eb";
1022
1032
  },
@@ -1057,19 +1067,19 @@ function Le({
1057
1067
  "div",
1058
1068
  {
1059
1069
  style: {
1060
- width: p ? "100%" : g || r || 1e3,
1061
- height: p ? "100%" : g || r || 1e3,
1070
+ width: d ? "100%" : p || r || 1e3,
1071
+ height: d ? "100%" : p || r || 1e3,
1062
1072
  display: "flex",
1063
1073
  justifyContent: "center",
1064
1074
  alignItems: "center",
1065
1075
  overflow: "hidden",
1066
- borderRadius: p ? 0 : "20px",
1076
+ borderRadius: d ? 0 : "20px",
1067
1077
  background: "#ffffff",
1068
- boxShadow: p ? "none" : "0 0 40px rgba(0,0,0,0.1)",
1069
- margin: p ? "0 auto" : "unset",
1078
+ boxShadow: d ? "none" : "0 0 40px rgba(0,0,0,0.1)",
1079
+ margin: d ? "0 auto" : "unset",
1070
1080
  position: "relative",
1071
1081
  // needed so absolute logo is inside the square
1072
- transform: `scale(${q})`
1082
+ transform: `scale(${J})`
1073
1083
  },
1074
1084
  children: /* @__PURE__ */ n(
1075
1085
  "div",
@@ -1082,7 +1092,7 @@ function Le({
1082
1092
  justifyContent: "center",
1083
1093
  alignItems: "center"
1084
1094
  },
1085
- children: /* @__PURE__ */ n("div", { style: we, children: Me() })
1095
+ children: /* @__PURE__ */ n("div", { style: Me, children: $e() })
1086
1096
  }
1087
1097
  )
1088
1098
  }
@@ -1091,8 +1101,8 @@ function Le({
1091
1101
  );
1092
1102
  }
1093
1103
  export {
1094
- Le as Game,
1095
- Le as HangmanLobbyGame,
1096
- Le as default
1104
+ Te as Game,
1105
+ Te as HangmanLobbyGame,
1106
+ Te as default
1097
1107
  };
1098
1108
  //# sourceMappingURL=speakid-hangman.es.js.map