speakid-hangman 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/HangmanLobbyGame.d.ts +1 -1
- package/dist/components/HangmanLobbyGame.d.ts.map +1 -1
- package/dist/speakid-hangman.cjs.js +2 -2
- package/dist/speakid-hangman.cjs.js.map +1 -1
- package/dist/speakid-hangman.es.js +471 -416
- package/dist/speakid-hangman.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsx as n, jsxs as u, Fragment as X } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useMemo as D, useCallback as ae, useEffect as le } from "react";
|
|
3
3
|
const a = {
|
|
4
4
|
gmCenterScreen: {
|
|
5
5
|
position: "relative",
|
|
@@ -201,145 +201,145 @@ const a = {
|
|
|
201
201
|
display: "block"
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
function
|
|
204
|
+
function ve({
|
|
205
205
|
mistakes: r,
|
|
206
|
-
maxMistakes:
|
|
207
|
-
size:
|
|
206
|
+
maxMistakes: Z,
|
|
207
|
+
size: G = 200
|
|
208
208
|
}) {
|
|
209
|
-
const l =
|
|
210
|
-
return /* @__PURE__ */
|
|
209
|
+
const l = G, d = G * 1.25, y = Math.max(2, G / 100), T = 10 * (l / 200), b = 240 * (d / 250), f = 150 * (l / 200), x = 80 * (l / 200), K = 20 * (d / 250), Q = 240 * (d / 250), w = 80 * (l / 200), N = 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), _ = 20 * (l / 200), S = 150 * (l / 200), q = 90 * (d / 250), Y = 150 * (d / 250), h = 150 * (l / 200), F = 110 * (d / 250), g = 130 * (l / 200), W = 130 * (d / 250), J = 150 * (l / 200), H = 110 * (d / 250), ce = 170 * (l / 200), L = 130 * (d / 250), ee = 150 * (l / 200), V = 150 * (d / 250), p = 130 * (l / 200), te = 190 * (d / 250), I = 150 * (l / 200), ne = 150 * (d / 250), s = 170 * (l / 200), R = 190 * (d / 250), c = r === 0 || r <= Z * 0.5 ? "#1f2937" : r <= Z * 0.75 ? "#f59e0b" : "#ec4c44";
|
|
210
|
+
return /* @__PURE__ */ u(
|
|
211
211
|
"svg",
|
|
212
212
|
{
|
|
213
213
|
width: l,
|
|
214
|
-
height:
|
|
214
|
+
height: d,
|
|
215
215
|
style: {
|
|
216
216
|
display: "block",
|
|
217
217
|
margin: "0 auto"
|
|
218
218
|
},
|
|
219
219
|
children: [
|
|
220
|
-
r > 0 && /* @__PURE__ */
|
|
220
|
+
r > 0 && /* @__PURE__ */ n(
|
|
221
221
|
"line",
|
|
222
222
|
{
|
|
223
|
-
x1:
|
|
224
|
-
y1:
|
|
225
|
-
x2:
|
|
226
|
-
y2:
|
|
227
|
-
stroke:
|
|
228
|
-
strokeWidth:
|
|
223
|
+
x1: T,
|
|
224
|
+
y1: b,
|
|
225
|
+
x2: f,
|
|
226
|
+
y2: b,
|
|
227
|
+
stroke: c,
|
|
228
|
+
strokeWidth: y
|
|
229
229
|
}
|
|
230
230
|
),
|
|
231
|
-
r > 1 && /* @__PURE__ */
|
|
231
|
+
r > 1 && /* @__PURE__ */ n(
|
|
232
232
|
"line",
|
|
233
233
|
{
|
|
234
|
-
x1:
|
|
234
|
+
x1: x,
|
|
235
235
|
y1: K,
|
|
236
|
-
x2:
|
|
237
|
-
y2:
|
|
238
|
-
stroke:
|
|
239
|
-
strokeWidth:
|
|
236
|
+
x2: x,
|
|
237
|
+
y2: Q,
|
|
238
|
+
stroke: c,
|
|
239
|
+
strokeWidth: y
|
|
240
240
|
}
|
|
241
241
|
),
|
|
242
|
-
r > 2 && /* @__PURE__ */
|
|
242
|
+
r > 2 && /* @__PURE__ */ n(
|
|
243
243
|
"line",
|
|
244
244
|
{
|
|
245
|
-
x1:
|
|
246
|
-
y1:
|
|
247
|
-
x2:
|
|
248
|
-
y2:
|
|
249
|
-
stroke:
|
|
250
|
-
strokeWidth:
|
|
245
|
+
x1: w,
|
|
246
|
+
y1: N,
|
|
247
|
+
x2: $,
|
|
248
|
+
y2: N,
|
|
249
|
+
stroke: c,
|
|
250
|
+
strokeWidth: y
|
|
251
251
|
}
|
|
252
252
|
),
|
|
253
|
-
r > 3 && /* @__PURE__ */
|
|
253
|
+
r > 3 && /* @__PURE__ */ n(
|
|
254
254
|
"line",
|
|
255
255
|
{
|
|
256
|
-
x1:
|
|
257
|
-
y1:
|
|
258
|
-
x2:
|
|
259
|
-
y2:
|
|
260
|
-
stroke:
|
|
261
|
-
strokeWidth:
|
|
256
|
+
x1: B,
|
|
257
|
+
y1: M,
|
|
258
|
+
x2: B,
|
|
259
|
+
y2: z,
|
|
260
|
+
stroke: c,
|
|
261
|
+
strokeWidth: y
|
|
262
262
|
}
|
|
263
263
|
),
|
|
264
|
-
r > 4 && /* @__PURE__ */
|
|
264
|
+
r > 4 && /* @__PURE__ */ n(
|
|
265
265
|
"circle",
|
|
266
266
|
{
|
|
267
|
-
cx:
|
|
268
|
-
cy:
|
|
269
|
-
r:
|
|
270
|
-
stroke:
|
|
267
|
+
cx: v,
|
|
268
|
+
cy: C,
|
|
269
|
+
r: _,
|
|
270
|
+
stroke: c,
|
|
271
271
|
fill: "none",
|
|
272
|
-
strokeWidth:
|
|
272
|
+
strokeWidth: y
|
|
273
273
|
}
|
|
274
274
|
),
|
|
275
|
-
r > 5 && /* @__PURE__ */
|
|
275
|
+
r > 5 && /* @__PURE__ */ n(
|
|
276
276
|
"line",
|
|
277
277
|
{
|
|
278
|
-
x1:
|
|
278
|
+
x1: S,
|
|
279
279
|
y1: q,
|
|
280
|
-
x2:
|
|
281
|
-
y2:
|
|
282
|
-
stroke:
|
|
283
|
-
strokeWidth:
|
|
280
|
+
x2: S,
|
|
281
|
+
y2: Y,
|
|
282
|
+
stroke: c,
|
|
283
|
+
strokeWidth: y
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
|
-
r > 6 && /* @__PURE__ */
|
|
286
|
+
r > 6 && /* @__PURE__ */ n(
|
|
287
287
|
"line",
|
|
288
288
|
{
|
|
289
|
-
x1:
|
|
290
|
-
y1:
|
|
291
|
-
x2:
|
|
292
|
-
y2:
|
|
293
|
-
stroke:
|
|
294
|
-
strokeWidth:
|
|
289
|
+
x1: h,
|
|
290
|
+
y1: F,
|
|
291
|
+
x2: g,
|
|
292
|
+
y2: W,
|
|
293
|
+
stroke: c,
|
|
294
|
+
strokeWidth: y
|
|
295
295
|
}
|
|
296
296
|
),
|
|
297
|
-
r > 7 && /* @__PURE__ */
|
|
297
|
+
r > 7 && /* @__PURE__ */ n(
|
|
298
298
|
"line",
|
|
299
299
|
{
|
|
300
|
-
x1:
|
|
301
|
-
y1:
|
|
302
|
-
x2:
|
|
303
|
-
y2:
|
|
304
|
-
stroke:
|
|
305
|
-
strokeWidth:
|
|
300
|
+
x1: J,
|
|
301
|
+
y1: H,
|
|
302
|
+
x2: ce,
|
|
303
|
+
y2: L,
|
|
304
|
+
stroke: c,
|
|
305
|
+
strokeWidth: y
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
|
-
r > 8 && /* @__PURE__ */
|
|
308
|
+
r > 8 && /* @__PURE__ */ n(
|
|
309
309
|
"line",
|
|
310
310
|
{
|
|
311
|
-
x1:
|
|
312
|
-
y1:
|
|
313
|
-
x2:
|
|
314
|
-
y2:
|
|
315
|
-
stroke:
|
|
316
|
-
strokeWidth:
|
|
311
|
+
x1: ee,
|
|
312
|
+
y1: V,
|
|
313
|
+
x2: p,
|
|
314
|
+
y2: te,
|
|
315
|
+
stroke: c,
|
|
316
|
+
strokeWidth: y
|
|
317
317
|
}
|
|
318
318
|
),
|
|
319
|
-
r > 9 && /* @__PURE__ */
|
|
319
|
+
r > 9 && /* @__PURE__ */ n(
|
|
320
320
|
"line",
|
|
321
321
|
{
|
|
322
|
-
x1:
|
|
323
|
-
y1:
|
|
324
|
-
x2:
|
|
325
|
-
y2:
|
|
326
|
-
stroke:
|
|
327
|
-
strokeWidth:
|
|
322
|
+
x1: I,
|
|
323
|
+
y1: ne,
|
|
324
|
+
x2: s,
|
|
325
|
+
y2: R,
|
|
326
|
+
stroke: c,
|
|
327
|
+
strokeWidth: y
|
|
328
328
|
}
|
|
329
329
|
)
|
|
330
330
|
]
|
|
331
331
|
}
|
|
332
332
|
);
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function Le({
|
|
335
335
|
gameCubeSize: r = 400,
|
|
336
|
-
screenHeight:
|
|
337
|
-
screenWidth:
|
|
336
|
+
screenHeight: Z = 800,
|
|
337
|
+
screenWidth: G = 800,
|
|
338
338
|
logoUrl: l,
|
|
339
|
-
showLogo:
|
|
340
|
-
baseURL:
|
|
339
|
+
showLogo: d = !0,
|
|
340
|
+
baseURL: y
|
|
341
341
|
} = {}) {
|
|
342
|
-
const
|
|
342
|
+
const T = {
|
|
343
343
|
Professions: ["teacher", "doctor", "nurse", "driver", "police", "firefighter", "cook", "waiter", "farmer", "builder", "singer", "actor", "dentist", "pilot", "vet", "artist", "cleaner", "student", "baker", "mechanic"],
|
|
344
344
|
Family: ["mother", "father", "sister", "brother", "grandmother", "grandfather", "aunt", "uncle", "cousin", "baby", "parents", "children", "wife", "husband", "son", "daughter", "family", "twins", "relatives"],
|
|
345
345
|
"Farm animals": ["cow", "pig", "horse", "sheep", "goat", "duck", "chicken", "rooster", "turkey", "goose", "rabbit", "mouse", "donkey", "bee", "hen", "lamb", "bull", "pony"],
|
|
@@ -357,126 +357,133 @@ function Mt({
|
|
|
357
357
|
Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
|
|
358
358
|
Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
|
|
359
359
|
Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
|
|
360
|
-
}, [
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
360
|
+
}, [b, f] = m("lobby"), [x, K] = m(""), [Q] = m("Normal"), [w, N] = m(0), [$, B] = m(1), [M, z] = m(""), [v, C] = m([]), [_, S] = m(0), [q, Y] = m(0), [h, F] = m(null), [g, W] = m(null), [J, H] = m(1), [ce, L] = m([]), ee = Q === "Easy" ? 8 : Q === "Normal" ? 6 : 4, V = y || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), [p, te] = m(!1), [I, ne] = m(!1), s = D(() => {
|
|
361
|
+
const e = (g || r || 1e3) / 400;
|
|
362
|
+
return {
|
|
363
|
+
headline1: p ? Math.max(24, Math.min(30, 30 * e)) : Math.max(28, Math.min(32, 32 * e)),
|
|
364
|
+
// Desktop: 32px
|
|
365
|
+
headline2: Math.max(20, Math.min(28, 24 * e)),
|
|
366
|
+
// Desktop: 24px
|
|
367
|
+
headline3: p ? Math.max(14, Math.min(18, 16 * e)) : Math.max(20, Math.min(26, 24 * e)),
|
|
368
|
+
// Desktop: 24px
|
|
369
|
+
bodyL: Math.max(14, Math.min(20, 18 * e)),
|
|
370
|
+
// Desktop: 18px
|
|
371
|
+
bodyM: p ? Math.max(12, Math.min(16, 14 * e)) : Math.max(14, Math.min(18, 16 * e)),
|
|
372
|
+
// Desktop: 16px
|
|
373
|
+
bodyS: p ? Math.max(10, Math.min(14, 12 * e)) : Math.max(12, Math.min(16, 14 * e)),
|
|
374
|
+
// Desktop: 14px
|
|
375
|
+
wordDisplay: Math.max(18, Math.min(32, 26 * e)),
|
|
376
|
+
// Адаптивный размер
|
|
377
|
+
button: Math.max(12, Math.min(18, 16 * e))
|
|
378
|
+
// Desktop: 16px
|
|
379
|
+
};
|
|
380
|
+
}, [p, g, r]), R = D(() => {
|
|
381
|
+
const e = (g || r || 1e3) / 400;
|
|
382
|
+
return I ? Math.max(8, Math.min(12, 10 * e)) : Math.max(12, Math.min(24, 16 * e));
|
|
383
|
+
}, [I, g, r]), o = D(() => {
|
|
384
|
+
const e = (g || r || 1e3) / 400;
|
|
385
|
+
return I ? Math.max(3, Math.min(6, 5 * e)) : Math.max(4, Math.min(12, 8 * e));
|
|
386
|
+
}, [I, g, r]), c = D(() => {
|
|
387
|
+
const e = (g || r || 1e3) / 400;
|
|
388
|
+
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)), P = (e, t = []) => {
|
|
390
|
+
var U;
|
|
391
|
+
if (!e || !T[e]) {
|
|
392
|
+
const k = Object.keys(T)[0];
|
|
393
|
+
return ((U = T[k]) == null ? void 0 : U[0]) || "";
|
|
380
394
|
}
|
|
381
|
-
const
|
|
382
|
-
if (!
|
|
395
|
+
const i = T[e];
|
|
396
|
+
if (!i || i.length === 0)
|
|
383
397
|
return "";
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
398
|
+
const j = i.filter((k) => !t.includes(k)), E = j.length > 0 ? j : i;
|
|
399
|
+
if (E.length === 0)
|
|
386
400
|
return "";
|
|
387
|
-
let
|
|
401
|
+
let O;
|
|
388
402
|
if (typeof crypto < "u" && crypto.getRandomValues) {
|
|
389
|
-
const
|
|
390
|
-
crypto.getRandomValues(
|
|
391
|
-
const
|
|
392
|
-
|
|
403
|
+
const k = new Uint32Array(1);
|
|
404
|
+
crypto.getRandomValues(k);
|
|
405
|
+
const ue = k[0] / 4294967295;
|
|
406
|
+
O = Math.floor(ue * E.length);
|
|
393
407
|
} else
|
|
394
|
-
|
|
395
|
-
return
|
|
396
|
-
},
|
|
397
|
-
if (!
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
if (!
|
|
401
|
-
|
|
408
|
+
O = Math.floor(Math.random() * E.length);
|
|
409
|
+
return E[O];
|
|
410
|
+
}, xe = () => {
|
|
411
|
+
if (!x) return;
|
|
412
|
+
L([]);
|
|
413
|
+
const e = P(x, []);
|
|
414
|
+
if (!e) {
|
|
415
|
+
f("category");
|
|
402
416
|
return;
|
|
403
417
|
}
|
|
404
|
-
|
|
405
|
-
},
|
|
406
|
-
if (
|
|
407
|
-
const
|
|
408
|
-
/^[a-z]$/.test(
|
|
409
|
-
}, [
|
|
410
|
-
|
|
411
|
-
}, [
|
|
412
|
-
|
|
413
|
-
if (
|
|
414
|
-
return window.addEventListener("keydown",
|
|
415
|
-
}, [
|
|
416
|
-
const
|
|
417
|
-
if (!
|
|
418
|
-
|
|
418
|
+
z(e), L([e]), C([]), S(0), B(1), Y(0), F(null), f("game");
|
|
419
|
+
}, oe = ae((e) => {
|
|
420
|
+
if (b !== "game" || h !== null) return;
|
|
421
|
+
const t = e.toLowerCase();
|
|
422
|
+
/^[a-z]$/.test(t) && (C((i) => i.includes(t) ? i : [...i, t]), z((i) => (i && !i.includes(t) && S((j) => j + 1), i)));
|
|
423
|
+
}, [b, h]), re = ae((e) => {
|
|
424
|
+
oe(e.key);
|
|
425
|
+
}, [oe]);
|
|
426
|
+
le(() => {
|
|
427
|
+
if (b === "game")
|
|
428
|
+
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 = _ >= 10, be = fe(v), ie = ae(() => {
|
|
431
|
+
if (!x || $ >= w) {
|
|
432
|
+
f("result");
|
|
419
433
|
return;
|
|
420
434
|
}
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
return
|
|
424
|
-
}),
|
|
425
|
-
}, [
|
|
426
|
-
|
|
427
|
-
if (
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
|
|
435
|
+
B((e) => e + 1), L((e) => {
|
|
436
|
+
const t = P(x, e);
|
|
437
|
+
return t ? (z(t), [...e, t]) : e;
|
|
438
|
+
}), C([]), S(0), F(null);
|
|
439
|
+
}, [x, $, w]);
|
|
440
|
+
le(() => {
|
|
441
|
+
if (de && h === null) {
|
|
442
|
+
F("win"), Y((t) => t + 1);
|
|
443
|
+
const e = setTimeout(() => {
|
|
444
|
+
ie();
|
|
431
445
|
}, 2e3);
|
|
432
|
-
return () => clearTimeout(
|
|
446
|
+
return () => clearTimeout(e);
|
|
433
447
|
}
|
|
434
|
-
if (
|
|
435
|
-
|
|
436
|
-
const
|
|
437
|
-
|
|
448
|
+
if (ge && h === null) {
|
|
449
|
+
F("lose");
|
|
450
|
+
const e = setTimeout(() => {
|
|
451
|
+
ie();
|
|
438
452
|
}, 2e3);
|
|
439
|
-
return () => clearTimeout(
|
|
453
|
+
return () => clearTimeout(e);
|
|
440
454
|
}
|
|
441
|
-
}, [
|
|
442
|
-
const
|
|
443
|
-
if (!
|
|
444
|
-
|
|
455
|
+
}, [de, ge, h, ie]);
|
|
456
|
+
const ke = () => {
|
|
457
|
+
if (!x || $ >= w) {
|
|
458
|
+
f("result");
|
|
445
459
|
return;
|
|
446
460
|
}
|
|
447
|
-
|
|
448
|
-
const
|
|
449
|
-
return
|
|
450
|
-
}),
|
|
461
|
+
B((e) => e + 1), L((e) => {
|
|
462
|
+
const t = P(x, e);
|
|
463
|
+
return t ? (z(t), [...e, t]) : e;
|
|
464
|
+
}), C([]), S(0), F(null);
|
|
451
465
|
};
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
overflow: "hidden",
|
|
474
|
-
position: "absolute",
|
|
475
|
-
top: 0,
|
|
476
|
-
left: 0,
|
|
477
|
-
right: 0,
|
|
478
|
-
bottom: 0
|
|
479
|
-
}, rt = `
|
|
466
|
+
le(() => {
|
|
467
|
+
const e = () => {
|
|
468
|
+
const t = window.innerWidth, i = window.innerHeight, j = t < 768 || t === 926 && i === 428 || t === 932 && i === 430, E = i < 700, O = t / i > 1.8, U = t === 1024 && i === 600;
|
|
469
|
+
if (te(j), ne(U), r && r >= 320) {
|
|
470
|
+
const $e = Math.max(320, Math.min(1200, r));
|
|
471
|
+
W($e), H(1);
|
|
472
|
+
} else if (j)
|
|
473
|
+
W(null), H(1);
|
|
474
|
+
else if (E)
|
|
475
|
+
W(null), H(1);
|
|
476
|
+
else if (O) {
|
|
477
|
+
const k = Math.min(1e3, Math.min(t, i) * 0.9);
|
|
478
|
+
W(k), H(0.85);
|
|
479
|
+
} else {
|
|
480
|
+
const k = Math.min(1e3, Math.min(t, i) * 0.9);
|
|
481
|
+
W(k), H(1);
|
|
482
|
+
}
|
|
483
|
+
};
|
|
484
|
+
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
485
|
+
}, [r]);
|
|
486
|
+
const se = `
|
|
480
487
|
<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;">
|
|
481
488
|
<!-- Каракули мелками и фломастерами -->
|
|
482
489
|
|
|
@@ -520,39 +527,33 @@ function Mt({
|
|
|
520
527
|
<path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
|
|
521
528
|
fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
|
|
522
529
|
</svg>
|
|
523
|
-
`,
|
|
530
|
+
`, we = {
|
|
524
531
|
...a.gmCenterScreen,
|
|
525
|
-
width:
|
|
526
|
-
height:
|
|
527
|
-
|
|
528
|
-
maxHeight: s ? "100%" : v ? "92vh" : h || r || 1e3,
|
|
529
|
-
padding: `${j}px`,
|
|
532
|
+
width: "100%",
|
|
533
|
+
height: "100%",
|
|
534
|
+
padding: `${R}px`,
|
|
530
535
|
overflow: "auto",
|
|
531
|
-
borderRadius: s ? 0 : "20px",
|
|
532
536
|
position: "relative",
|
|
533
537
|
boxSizing: "border-box",
|
|
534
|
-
background: "
|
|
535
|
-
|
|
536
|
-
boxShadow: s ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
537
|
-
// Легкая тень для десктопа
|
|
538
|
-
margin: s ? "0 auto" : "unset"
|
|
539
|
-
}, gt = !s && c, G = xt(
|
|
538
|
+
background: "transparent"
|
|
539
|
+
}, pe = !p && d, A = D(
|
|
540
540
|
() => {
|
|
541
|
-
|
|
541
|
+
const e = window.innerWidth, t = window.innerHeight;
|
|
542
|
+
if (p && e > t || t < 700 || !pe)
|
|
542
543
|
return null;
|
|
543
|
-
const
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
544
|
+
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: [
|
|
546
|
+
/* @__PURE__ */ n(
|
|
546
547
|
"source",
|
|
547
548
|
{
|
|
548
|
-
srcSet: `${
|
|
549
|
+
srcSet: `${i}.svg`,
|
|
549
550
|
type: "image/svg+xml"
|
|
550
551
|
}
|
|
551
552
|
),
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
+
/* @__PURE__ */ n(
|
|
553
554
|
"img",
|
|
554
555
|
{
|
|
555
|
-
src: `${
|
|
556
|
+
src: `${i}.png`,
|
|
556
557
|
alt: "SPEAKID Logo",
|
|
557
558
|
style: a.gmLogoImg,
|
|
558
559
|
loading: "lazy"
|
|
@@ -560,29 +561,28 @@ function Mt({
|
|
|
560
561
|
)
|
|
561
562
|
] }) });
|
|
562
563
|
},
|
|
563
|
-
[
|
|
564
|
-
)
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
-
/* @__PURE__ */ e("h1", { style: {
|
|
564
|
+
[p, pe, l]
|
|
565
|
+
), Me = () => b === "lobby" ? /* @__PURE__ */ u(X, { children: [
|
|
566
|
+
A,
|
|
567
|
+
/* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
|
|
568
|
+
/* @__PURE__ */ n("h1", { style: {
|
|
569
569
|
...a.gmHeadline1,
|
|
570
|
-
fontSize: `${
|
|
571
|
-
marginBottom: `${
|
|
570
|
+
fontSize: `${s.headline1}px`,
|
|
571
|
+
marginBottom: `${o * 3}px`,
|
|
572
572
|
position: "relative",
|
|
573
573
|
zIndex: 1
|
|
574
574
|
}, children: "HANGMAN" }),
|
|
575
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ u(
|
|
576
576
|
"button",
|
|
577
577
|
{
|
|
578
|
-
onClick: () =>
|
|
578
|
+
onClick: () => f("category"),
|
|
579
579
|
style: {
|
|
580
580
|
fontFamily: '"Onest", system-ui, sans-serif',
|
|
581
581
|
fontWeight: 500,
|
|
582
582
|
// Medium для более заметности
|
|
583
|
-
fontSize: `${
|
|
584
|
-
padding: `${
|
|
585
|
-
borderRadius: `${
|
|
583
|
+
fontSize: `${s.button}px`,
|
|
584
|
+
padding: `${o * 1.2}px ${o * 3}px`,
|
|
585
|
+
borderRadius: `${c * 1.5}px`,
|
|
586
586
|
position: "relative",
|
|
587
587
|
zIndex: 1,
|
|
588
588
|
display: "flex",
|
|
@@ -596,26 +596,26 @@ function Mt({
|
|
|
596
596
|
boxShadow: "0 2px 8px rgba(236, 76, 68, 0.2)",
|
|
597
597
|
minWidth: "120px"
|
|
598
598
|
},
|
|
599
|
-
onMouseEnter: (
|
|
600
|
-
|
|
599
|
+
onMouseEnter: (e) => {
|
|
600
|
+
e.currentTarget.style.background = "#d43a32", e.currentTarget.style.transform = "translateY(-2px)", e.currentTarget.style.boxShadow = "0 4px 12px rgba(236, 76, 68, 0.3)";
|
|
601
601
|
},
|
|
602
|
-
onMouseLeave: (
|
|
603
|
-
|
|
602
|
+
onMouseLeave: (e) => {
|
|
603
|
+
e.currentTarget.style.background = "#ec4c44", e.currentTarget.style.transform = "translateY(0)", e.currentTarget.style.boxShadow = "0 2px 8px rgba(236, 76, 68, 0.2)";
|
|
604
604
|
},
|
|
605
|
-
onMouseDown: (
|
|
606
|
-
|
|
605
|
+
onMouseDown: (e) => {
|
|
606
|
+
e.currentTarget.style.transform = "translateY(0)";
|
|
607
607
|
},
|
|
608
608
|
children: [
|
|
609
|
-
/* @__PURE__ */
|
|
609
|
+
/* @__PURE__ */ n(
|
|
610
610
|
"svg",
|
|
611
611
|
{
|
|
612
|
-
width: `${
|
|
613
|
-
height: `${
|
|
612
|
+
width: `${s.button * 1.3}px`,
|
|
613
|
+
height: `${s.button * 1.3}px`,
|
|
614
614
|
viewBox: "0 0 24 24",
|
|
615
615
|
fill: "none",
|
|
616
616
|
xmlns: "http://www.w3.org/2000/svg",
|
|
617
|
-
style: { display: "block", marginRight: `${
|
|
618
|
-
children: /* @__PURE__ */
|
|
617
|
+
style: { display: "block", marginRight: `${o}px` },
|
|
618
|
+
children: /* @__PURE__ */ n(
|
|
619
619
|
"path",
|
|
620
620
|
{
|
|
621
621
|
d: "M8 5V19L19 12L8 5Z",
|
|
@@ -625,11 +625,11 @@ function Mt({
|
|
|
625
625
|
)
|
|
626
626
|
}
|
|
627
627
|
),
|
|
628
|
-
/* @__PURE__ */
|
|
628
|
+
/* @__PURE__ */ n("span", { style: { fontWeight: 500 }, children: "PLAY" })
|
|
629
629
|
]
|
|
630
630
|
}
|
|
631
631
|
),
|
|
632
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ u("div", { style: {
|
|
633
633
|
position: "absolute",
|
|
634
634
|
top: "50%",
|
|
635
635
|
left: "50%",
|
|
@@ -639,34 +639,34 @@ function Mt({
|
|
|
639
639
|
pointerEvents: "none",
|
|
640
640
|
zIndex: 0
|
|
641
641
|
}, children: [
|
|
642
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ n(
|
|
643
643
|
"img",
|
|
644
644
|
{
|
|
645
|
-
src: `${
|
|
645
|
+
src: `${V}/sun.png`,
|
|
646
646
|
alt: "Sun",
|
|
647
647
|
style: {
|
|
648
648
|
position: "absolute",
|
|
649
|
-
left:
|
|
649
|
+
left: p ? "-10%" : "5%",
|
|
650
650
|
top: "20%",
|
|
651
651
|
width: "auto",
|
|
652
|
-
height:
|
|
652
|
+
height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
|
|
653
653
|
maxHeight: "33vh",
|
|
654
654
|
objectFit: "contain",
|
|
655
655
|
opacity: 0.6
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
),
|
|
659
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ n(
|
|
660
660
|
"img",
|
|
661
661
|
{
|
|
662
|
-
src: `${
|
|
662
|
+
src: `${V}/character.png`,
|
|
663
663
|
alt: "Hangman character",
|
|
664
664
|
style: {
|
|
665
665
|
position: "absolute",
|
|
666
|
-
right:
|
|
666
|
+
right: p ? "5%" : "10%",
|
|
667
667
|
bottom: "10%",
|
|
668
668
|
width: "auto",
|
|
669
|
-
height:
|
|
669
|
+
height: p ? `${Math.min(window.innerHeight * 0.33, 200)}px` : `${Math.min((g || r || 1e3) * 0.33, 300)}px`,
|
|
670
670
|
maxHeight: "33vh",
|
|
671
671
|
objectFit: "contain",
|
|
672
672
|
opacity: 0.6
|
|
@@ -674,53 +674,54 @@ function Mt({
|
|
|
674
674
|
}
|
|
675
675
|
)
|
|
676
676
|
] })
|
|
677
|
-
] })
|
|
678
|
-
|
|
679
|
-
/* @__PURE__ */
|
|
680
|
-
/* @__PURE__ */
|
|
677
|
+
] }) : b === "category" ? /* @__PURE__ */ u(X, { children: [
|
|
678
|
+
A,
|
|
679
|
+
/* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
|
|
680
|
+
/* @__PURE__ */ n(
|
|
681
681
|
"button",
|
|
682
682
|
{
|
|
683
|
-
onClick: () =>
|
|
684
|
-
onMouseEnter: (
|
|
685
|
-
|
|
683
|
+
onClick: () => f("lobby"),
|
|
684
|
+
onMouseEnter: (e) => {
|
|
685
|
+
e.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
686
686
|
},
|
|
687
|
-
onMouseLeave: (
|
|
688
|
-
|
|
687
|
+
onMouseLeave: (e) => {
|
|
688
|
+
e.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
689
689
|
},
|
|
690
690
|
style: {
|
|
691
691
|
...a.gmButton,
|
|
692
692
|
...a.gmButtonSecondary,
|
|
693
|
-
fontSize: `${
|
|
694
|
-
padding: `${
|
|
695
|
-
borderRadius: `${
|
|
693
|
+
fontSize: `${s.button}px`,
|
|
694
|
+
padding: `${o}px ${o * 1.5}px`,
|
|
695
|
+
borderRadius: `${c}px`,
|
|
696
696
|
position: "absolute",
|
|
697
|
-
top: `${
|
|
698
|
-
left: `${
|
|
697
|
+
top: `${R}px`,
|
|
698
|
+
left: `${R + 100}px`,
|
|
699
|
+
// ✅ Смещаем правее логотипа
|
|
699
700
|
zIndex: 10
|
|
700
701
|
},
|
|
701
702
|
children: "←"
|
|
702
703
|
}
|
|
703
704
|
),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ n("div", { style: { ...a.gmButtonGroup, gap: `${o}px`, marginBottom: `${o * 3}px`, marginTop: `${o * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(T).map((e) => /* @__PURE__ */ n(
|
|
705
706
|
"button",
|
|
706
707
|
{
|
|
707
708
|
onClick: () => {
|
|
708
|
-
K(
|
|
709
|
+
K(e), f("rounds");
|
|
709
710
|
},
|
|
710
|
-
onMouseEnter: (
|
|
711
|
-
|
|
711
|
+
onMouseEnter: (t) => {
|
|
712
|
+
t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
|
|
712
713
|
},
|
|
713
|
-
onMouseLeave: (
|
|
714
|
-
|
|
714
|
+
onMouseLeave: (t) => {
|
|
715
|
+
t.currentTarget.style.backgroundColor = "transparent", t.currentTarget.style.borderColor = "#e5e7eb", t.currentTarget.style.transform = "scale(1)";
|
|
715
716
|
},
|
|
716
717
|
style: {
|
|
717
718
|
fontFamily: '"Onest", system-ui, sans-serif',
|
|
718
719
|
fontWeight: 500,
|
|
719
|
-
fontSize: `${
|
|
720
|
-
padding: `${
|
|
721
|
-
borderRadius: `${
|
|
720
|
+
fontSize: `${s.button}px`,
|
|
721
|
+
padding: `${o * 1.2}px ${o * 2}px`,
|
|
722
|
+
borderRadius: `${c * 2}px`,
|
|
722
723
|
// Более округлые для облачков
|
|
723
|
-
margin: `${
|
|
724
|
+
margin: `${o / 2}px`,
|
|
724
725
|
background: "transparent",
|
|
725
726
|
border: "2px solid #e5e7eb",
|
|
726
727
|
color: "#1f2937",
|
|
@@ -728,58 +729,59 @@ function Mt({
|
|
|
728
729
|
transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
|
|
729
730
|
boxShadow: "none"
|
|
730
731
|
},
|
|
731
|
-
children:
|
|
732
|
+
children: e
|
|
732
733
|
},
|
|
733
|
-
|
|
734
|
+
e
|
|
734
735
|
)) })
|
|
735
|
-
] })
|
|
736
|
-
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
736
|
+
] }) : b === "rounds" ? /* @__PURE__ */ u(X, { children: [
|
|
737
|
+
A,
|
|
738
|
+
/* @__PURE__ */ n("div", { dangerouslySetInnerHTML: { __html: se } }),
|
|
739
|
+
/* @__PURE__ */ n(
|
|
739
740
|
"button",
|
|
740
741
|
{
|
|
741
|
-
onClick: () =>
|
|
742
|
-
onMouseEnter: (
|
|
743
|
-
|
|
742
|
+
onClick: () => f("category"),
|
|
743
|
+
onMouseEnter: (e) => {
|
|
744
|
+
e.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
744
745
|
},
|
|
745
|
-
onMouseLeave: (
|
|
746
|
-
|
|
746
|
+
onMouseLeave: (e) => {
|
|
747
|
+
e.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
747
748
|
},
|
|
748
749
|
style: {
|
|
749
750
|
...a.gmButton,
|
|
750
751
|
...a.gmButtonSecondary,
|
|
751
|
-
fontSize: `${
|
|
752
|
-
padding: `${
|
|
753
|
-
borderRadius: `${
|
|
752
|
+
fontSize: `${s.button}px`,
|
|
753
|
+
padding: `${o}px ${o * 1.5}px`,
|
|
754
|
+
borderRadius: `${c}px`,
|
|
754
755
|
position: "absolute",
|
|
755
|
-
top: `${
|
|
756
|
-
left: `${
|
|
756
|
+
top: `${R}px`,
|
|
757
|
+
left: `${R + 100}px`,
|
|
758
|
+
// ✅ Смещаем правее логотипа
|
|
757
759
|
zIndex: 10
|
|
758
760
|
},
|
|
759
761
|
children: "←"
|
|
760
762
|
}
|
|
761
763
|
),
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ n("h1", { style: { ...a.gmHeadline1, fontSize: `${s.headline1}px`, marginBottom: `${o * 2}px`, position: "relative", zIndex: 1 }, children: "Choose rounds" }),
|
|
765
|
+
/* @__PURE__ */ n("div", { style: { ...a.gmButtonGroup, gap: `${o}px`, marginBottom: `${o * 3}px`, position: "relative", zIndex: 1 }, children: [1, 3, 5].map((e) => /* @__PURE__ */ n(
|
|
764
766
|
"button",
|
|
765
767
|
{
|
|
766
768
|
onClick: () => {
|
|
767
|
-
|
|
769
|
+
N(e), xe();
|
|
768
770
|
},
|
|
769
|
-
onMouseEnter: (
|
|
770
|
-
|
|
771
|
+
onMouseEnter: (t) => {
|
|
772
|
+
t.currentTarget.style.backgroundColor = "#f0f0f0", t.currentTarget.style.borderColor = "#1f2937", t.currentTarget.style.transform = "scale(1.05)";
|
|
771
773
|
},
|
|
772
|
-
onMouseLeave: (
|
|
773
|
-
|
|
774
|
+
onMouseLeave: (t) => {
|
|
775
|
+
t.currentTarget.style.backgroundColor = "transparent", t.currentTarget.style.borderColor = "#e5e7eb", t.currentTarget.style.transform = "scale(1)";
|
|
774
776
|
},
|
|
775
777
|
style: {
|
|
776
778
|
fontFamily: '"Onest", system-ui, sans-serif',
|
|
777
779
|
fontWeight: 500,
|
|
778
|
-
fontSize: `${
|
|
779
|
-
padding: `${
|
|
780
|
-
borderRadius: `${
|
|
780
|
+
fontSize: `${s.button}px`,
|
|
781
|
+
padding: `${o * 1.2}px ${o * 2}px`,
|
|
782
|
+
borderRadius: `${c * 2}px`,
|
|
781
783
|
// Более округлые для облачков
|
|
782
|
-
margin: `${
|
|
784
|
+
margin: `${o / 2}px`,
|
|
783
785
|
background: "transparent",
|
|
784
786
|
border: "2px solid #e5e7eb",
|
|
785
787
|
color: "#1f2937",
|
|
@@ -787,255 +789,308 @@ function Mt({
|
|
|
787
789
|
transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
|
|
788
790
|
boxShadow: "none"
|
|
789
791
|
},
|
|
790
|
-
children:
|
|
792
|
+
children: e
|
|
791
793
|
},
|
|
792
|
-
|
|
794
|
+
e
|
|
793
795
|
)) })
|
|
794
|
-
] })
|
|
795
|
-
|
|
796
|
-
/* @__PURE__ */
|
|
796
|
+
] }) : b === "game" ? /* @__PURE__ */ u(X, { children: [
|
|
797
|
+
A,
|
|
798
|
+
/* @__PURE__ */ u("div", { style: {
|
|
797
799
|
...a.gmInfoBox,
|
|
798
|
-
padding: `${
|
|
799
|
-
marginBottom: `${
|
|
800
|
-
maxWidth: `${(
|
|
800
|
+
padding: `${o * 0.8}px`,
|
|
801
|
+
marginBottom: `${o * 0.5}px`,
|
|
802
|
+
maxWidth: `${(g || r) * 0.9}px`
|
|
801
803
|
}, children: [
|
|
802
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ u("h3", { style: { ...a.gmHeadline3, fontSize: `${s.headline3}px`, marginBottom: `${o * 0.5}px` }, children: [
|
|
803
805
|
"Category: ",
|
|
804
|
-
|
|
806
|
+
x
|
|
805
807
|
] }),
|
|
806
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ u("p", { style: { ...a.gmBodyM, fontSize: `${s.bodyM}px`, marginBottom: "0px" }, children: [
|
|
807
809
|
"Round ",
|
|
808
|
-
|
|
810
|
+
$,
|
|
809
811
|
" of ",
|
|
810
|
-
|
|
812
|
+
w
|
|
811
813
|
] })
|
|
812
814
|
] }),
|
|
813
|
-
|
|
815
|
+
M && /* @__PURE__ */ u("p", { style: {
|
|
814
816
|
...a.gmBodyS,
|
|
815
|
-
fontSize: `${
|
|
816
|
-
marginTop: `${
|
|
817
|
-
marginBottom: `${
|
|
817
|
+
fontSize: `${s.bodyS}px`,
|
|
818
|
+
marginTop: `${o * 0.5}px`,
|
|
819
|
+
marginBottom: `${o}px`
|
|
818
820
|
}, children: [
|
|
819
821
|
"I am thinking of a word that is ",
|
|
820
|
-
/* @__PURE__ */
|
|
822
|
+
/* @__PURE__ */ n("strong", { children: M.length }),
|
|
821
823
|
" letters long"
|
|
822
824
|
] }),
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
margin: `${
|
|
825
|
+
/* @__PURE__ */ n("div", { style: {
|
|
826
|
+
margin: `${o}px 0`,
|
|
825
827
|
display: "flex",
|
|
826
828
|
justifyContent: "center",
|
|
827
829
|
alignItems: "center"
|
|
828
|
-
}, children: /* @__PURE__ */
|
|
829
|
-
|
|
830
|
+
}, children: /* @__PURE__ */ n(
|
|
831
|
+
ve,
|
|
830
832
|
{
|
|
831
|
-
mistakes:
|
|
832
|
-
maxMistakes:
|
|
833
|
-
size:
|
|
833
|
+
mistakes: _,
|
|
834
|
+
maxMistakes: ee,
|
|
835
|
+
size: I ? Math.max(80, Math.min(110, (g || r) * 0.16)) : Math.max(100, Math.min(150, (g || r) * 0.2))
|
|
834
836
|
}
|
|
835
837
|
) }),
|
|
836
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ n("div", { style: {
|
|
837
839
|
...a.gmWordDisplay,
|
|
838
|
-
fontSize: `${Math.max(16, Math.min(24,
|
|
839
|
-
margin: `${
|
|
840
|
-
letterSpacing: `${
|
|
841
|
-
minHeight: `${Math.max(16, Math.min(24,
|
|
842
|
-
}, children:
|
|
843
|
-
/* @__PURE__ */
|
|
840
|
+
fontSize: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9))}px`,
|
|
841
|
+
margin: `${o}px 0`,
|
|
842
|
+
letterSpacing: `${o * 0.8}px`,
|
|
843
|
+
minHeight: `${Math.max(16, Math.min(24, s.wordDisplay * 0.9)) * 1.2}px`
|
|
844
|
+
}, children: ye || "Loading..." }),
|
|
845
|
+
/* @__PURE__ */ u("div", { style: {
|
|
844
846
|
...a.gmInfoBox,
|
|
845
|
-
padding: `${
|
|
846
|
-
marginTop: `${
|
|
847
|
-
marginBottom: `${
|
|
848
|
-
maxWidth: `${(
|
|
847
|
+
padding: `${o}px`,
|
|
848
|
+
marginTop: `${o}px`,
|
|
849
|
+
marginBottom: `${o}px`,
|
|
850
|
+
maxWidth: `${(g || r) * 0.95}px`
|
|
849
851
|
}, children: [
|
|
850
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ n("p", { style: {
|
|
851
853
|
...a.gmBodyS,
|
|
852
|
-
fontSize: `${
|
|
853
|
-
marginBottom: `${
|
|
854
|
+
fontSize: `${s.bodyS}px`,
|
|
855
|
+
marginBottom: `${o}px`,
|
|
854
856
|
fontWeight: 500
|
|
855
857
|
// Medium
|
|
856
858
|
}, children: "Available letters:" }),
|
|
857
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ n("div", { style: {
|
|
858
860
|
display: "flex",
|
|
859
861
|
flexWrap: "wrap",
|
|
860
|
-
gap: `${
|
|
862
|
+
gap: `${o / 3}px`,
|
|
861
863
|
justifyContent: "center",
|
|
862
|
-
fontSize: `${Math.max(9, Math.min(12,
|
|
864
|
+
fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
|
|
863
865
|
fontFamily: '"Onest", system-ui, sans-serif'
|
|
864
|
-
}, children:
|
|
866
|
+
}, children: be.map((e) => /* @__PURE__ */ n(
|
|
865
867
|
"button",
|
|
866
868
|
{
|
|
867
|
-
onClick: () =>
|
|
868
|
-
disabled:
|
|
869
|
-
onMouseEnter: (
|
|
870
|
-
|
|
869
|
+
onClick: () => oe(e),
|
|
870
|
+
disabled: h !== null,
|
|
871
|
+
onMouseEnter: (t) => {
|
|
872
|
+
h === null && (t.currentTarget.style.backgroundColor = "#e5e7eb", t.currentTarget.style.cursor = "pointer");
|
|
871
873
|
},
|
|
872
|
-
onMouseLeave: (
|
|
873
|
-
|
|
874
|
+
onMouseLeave: (t) => {
|
|
875
|
+
h === null && (t.currentTarget.style.backgroundColor = "#f9f9f9", t.currentTarget.style.cursor = "pointer");
|
|
874
876
|
},
|
|
875
877
|
style: {
|
|
876
|
-
padding: `${
|
|
877
|
-
borderRadius: `${
|
|
878
|
+
padding: `${o / 4}px ${o / 3}px`,
|
|
879
|
+
borderRadius: `${c * 0.5}px`,
|
|
878
880
|
background: "#f9f9f9",
|
|
879
881
|
color: "#1f2937",
|
|
880
882
|
border: "1px solid #e5e7eb",
|
|
881
|
-
minWidth: `${Math.max(
|
|
883
|
+
minWidth: `${Math.max(o * 1.5, (g || r) * 0.04)}px`,
|
|
882
884
|
textAlign: "center",
|
|
883
885
|
display: "inline-block",
|
|
884
|
-
cursor:
|
|
886
|
+
cursor: h === null ? "pointer" : "default",
|
|
885
887
|
fontFamily: '"Onest", system-ui, sans-serif',
|
|
886
|
-
fontSize: `${Math.max(9, Math.min(12,
|
|
888
|
+
fontSize: `${Math.max(9, Math.min(12, s.bodyS * 0.75))}px`,
|
|
887
889
|
transition: "background-color 0.2s ease"
|
|
888
890
|
},
|
|
889
|
-
children:
|
|
891
|
+
children: e
|
|
890
892
|
},
|
|
891
|
-
|
|
893
|
+
e
|
|
892
894
|
)) })
|
|
893
895
|
] }),
|
|
894
|
-
|
|
896
|
+
v.length > 0 && /* @__PURE__ */ n("div", { style: {
|
|
895
897
|
...a.gmGuessedLetters,
|
|
896
|
-
fontSize: `${Math.max(10, Math.min(12,
|
|
897
|
-
marginTop: `${
|
|
898
|
+
fontSize: `${Math.max(10, Math.min(12, s.bodyS * 0.85))}px`,
|
|
899
|
+
marginTop: `${o * 0.5}px`,
|
|
898
900
|
marginBottom: "2px"
|
|
899
|
-
}, children: /* @__PURE__ */
|
|
901
|
+
}, children: /* @__PURE__ */ u("span", { style: { color: "#6b7280" }, children: [
|
|
900
902
|
"Guessed letters: ",
|
|
901
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ n("strong", { children: v.join(", ") })
|
|
902
904
|
] }) }),
|
|
903
|
-
|
|
905
|
+
h === "win" && /* @__PURE__ */ n("div", { style: {
|
|
904
906
|
...a.gmStatusWin,
|
|
905
|
-
fontSize: `${
|
|
907
|
+
fontSize: `${s.bodyL}px`,
|
|
906
908
|
margin: "2px 0"
|
|
907
909
|
}, children: "🎉 You won this round!" }),
|
|
908
|
-
|
|
910
|
+
h === "lose" && /* @__PURE__ */ u("div", { style: {
|
|
909
911
|
...a.gmStatusLose,
|
|
910
|
-
fontSize: `${
|
|
912
|
+
fontSize: `${s.bodyL}px`,
|
|
911
913
|
margin: "2px 0"
|
|
912
914
|
}, children: [
|
|
913
915
|
"The hangman is complete! The word was: ",
|
|
914
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ n("strong", { children: M })
|
|
915
917
|
] }),
|
|
916
|
-
|
|
918
|
+
h !== null && $ < w && /* @__PURE__ */ n("div", { style: { marginTop: "2px", marginBottom: `${o}px` }, children: /* @__PURE__ */ n(
|
|
917
919
|
"button",
|
|
918
920
|
{
|
|
919
|
-
onClick:
|
|
920
|
-
onMouseEnter: (
|
|
921
|
-
|
|
921
|
+
onClick: ke,
|
|
922
|
+
onMouseEnter: (e) => {
|
|
923
|
+
e.currentTarget.style.backgroundColor = "#d43a32";
|
|
922
924
|
},
|
|
923
|
-
onMouseLeave: (
|
|
924
|
-
|
|
925
|
+
onMouseLeave: (e) => {
|
|
926
|
+
e.currentTarget.style.backgroundColor = "#ec4c44";
|
|
925
927
|
},
|
|
926
928
|
style: {
|
|
927
929
|
...a.gmButton,
|
|
928
|
-
fontSize: `${Math.max(11, Math.min(14,
|
|
929
|
-
padding: `${
|
|
930
|
-
borderRadius: `${
|
|
930
|
+
fontSize: `${Math.max(11, Math.min(14, s.button * 0.85))}px`,
|
|
931
|
+
padding: `${o * 0.6}px ${o * 1.2}px`,
|
|
932
|
+
borderRadius: `${c}px`
|
|
931
933
|
},
|
|
932
934
|
children: "NEXT"
|
|
933
935
|
}
|
|
934
936
|
) }),
|
|
935
|
-
|
|
937
|
+
h !== null && $ >= w && /* @__PURE__ */ n("div", { style: { marginTop: "2px", marginBottom: `${o}px` }, children: /* @__PURE__ */ n(
|
|
936
938
|
"button",
|
|
937
939
|
{
|
|
938
|
-
onClick: () =>
|
|
939
|
-
onMouseEnter: (
|
|
940
|
-
|
|
940
|
+
onClick: () => f("result"),
|
|
941
|
+
onMouseEnter: (e) => {
|
|
942
|
+
e.currentTarget.style.backgroundColor = "#d43a32";
|
|
941
943
|
},
|
|
942
|
-
onMouseLeave: (
|
|
943
|
-
|
|
944
|
+
onMouseLeave: (e) => {
|
|
945
|
+
e.currentTarget.style.backgroundColor = "#ec4c44";
|
|
944
946
|
},
|
|
945
947
|
style: {
|
|
946
948
|
...a.gmButton,
|
|
947
|
-
fontSize: `${
|
|
948
|
-
padding: `${
|
|
949
|
-
borderRadius: `${
|
|
949
|
+
fontSize: `${s.button}px`,
|
|
950
|
+
padding: `${o}px ${o * 1.5}px`,
|
|
951
|
+
borderRadius: `${c}px`
|
|
950
952
|
},
|
|
951
953
|
children: "View Results →"
|
|
952
954
|
}
|
|
953
955
|
) }),
|
|
954
|
-
|
|
956
|
+
h === null && v.length === 0 && /* @__PURE__ */ n("p", { style: {
|
|
955
957
|
...a.gmBodyS,
|
|
956
|
-
fontSize: `${
|
|
957
|
-
marginTop: `${
|
|
958
|
-
marginBottom: `${
|
|
958
|
+
fontSize: `${s.bodyS}px`,
|
|
959
|
+
marginTop: `${o}px`,
|
|
960
|
+
marginBottom: `${o}px`
|
|
959
961
|
}, children: "Type a letter on your keyboard" })
|
|
960
|
-
] })
|
|
961
|
-
|
|
962
|
-
/* @__PURE__ */
|
|
962
|
+
] }) : b === "result" ? /* @__PURE__ */ u(X, { children: [
|
|
963
|
+
A,
|
|
964
|
+
/* @__PURE__ */ n("h1", { style: {
|
|
963
965
|
...a.gmHeadline1,
|
|
964
|
-
fontSize: `${
|
|
965
|
-
marginBottom: `${
|
|
966
|
+
fontSize: `${s.headline1}px`,
|
|
967
|
+
marginBottom: `${o * 2}px`
|
|
966
968
|
}, children: "🎊 Game Finished!" }),
|
|
967
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ u("p", { style: {
|
|
968
970
|
...a.gmBodyL,
|
|
969
|
-
fontSize: `${
|
|
970
|
-
marginBottom: `${
|
|
971
|
+
fontSize: `${s.bodyL}px`,
|
|
972
|
+
marginBottom: `${o * 2}px`
|
|
971
973
|
}, children: [
|
|
972
974
|
"You guessed ",
|
|
973
|
-
/* @__PURE__ */
|
|
975
|
+
/* @__PURE__ */ n("strong", { children: q }),
|
|
974
976
|
" out of ",
|
|
975
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ n("strong", { children: w }),
|
|
976
978
|
" words correctly."
|
|
977
979
|
] }),
|
|
978
|
-
/* @__PURE__ */
|
|
980
|
+
/* @__PURE__ */ u("div", { style: {
|
|
979
981
|
display: "flex",
|
|
980
982
|
flexDirection: "column",
|
|
981
|
-
gap: `${
|
|
983
|
+
gap: `${o}px`,
|
|
982
984
|
alignItems: "center"
|
|
983
985
|
}, children: [
|
|
984
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ n(
|
|
985
987
|
"button",
|
|
986
988
|
{
|
|
987
989
|
onClick: () => {
|
|
988
|
-
if (!
|
|
989
|
-
|
|
990
|
+
if (!x || w === 0) {
|
|
991
|
+
f("lobby");
|
|
990
992
|
return;
|
|
991
993
|
}
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
|
|
994
|
+
L([]);
|
|
995
|
+
const e = P(x, []);
|
|
996
|
+
e && (z(e), L([e]), C([]), S(0), B(1), Y(0), F(null), f("game"));
|
|
995
997
|
},
|
|
996
|
-
onMouseEnter: (
|
|
997
|
-
|
|
998
|
+
onMouseEnter: (e) => {
|
|
999
|
+
e.currentTarget.style.backgroundColor = "#d43a32";
|
|
998
1000
|
},
|
|
999
|
-
onMouseLeave: (
|
|
1000
|
-
|
|
1001
|
+
onMouseLeave: (e) => {
|
|
1002
|
+
e.currentTarget.style.backgroundColor = "#ec4c44";
|
|
1001
1003
|
},
|
|
1002
1004
|
style: {
|
|
1003
1005
|
...a.gmButton,
|
|
1004
|
-
fontSize: `${
|
|
1005
|
-
padding: `${
|
|
1006
|
-
borderRadius: `${
|
|
1006
|
+
fontSize: `${s.button}px`,
|
|
1007
|
+
padding: `${o}px ${o * 1.5}px`,
|
|
1008
|
+
borderRadius: `${c}px`,
|
|
1007
1009
|
minWidth: "200px"
|
|
1008
1010
|
},
|
|
1009
1011
|
children: "Play again"
|
|
1010
1012
|
}
|
|
1011
1013
|
),
|
|
1012
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ n(
|
|
1013
1015
|
"button",
|
|
1014
1016
|
{
|
|
1015
|
-
onClick: () =>
|
|
1016
|
-
onMouseEnter: (
|
|
1017
|
-
|
|
1017
|
+
onClick: () => f("lobby"),
|
|
1018
|
+
onMouseEnter: (e) => {
|
|
1019
|
+
e.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
1018
1020
|
},
|
|
1019
|
-
onMouseLeave: (
|
|
1020
|
-
|
|
1021
|
+
onMouseLeave: (e) => {
|
|
1022
|
+
e.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
1021
1023
|
},
|
|
1022
1024
|
style: {
|
|
1023
1025
|
...a.gmButton,
|
|
1024
1026
|
...a.gmButtonSecondary,
|
|
1025
|
-
fontSize: `${
|
|
1026
|
-
padding: `${
|
|
1027
|
-
borderRadius: `${
|
|
1027
|
+
fontSize: `${s.button}px`,
|
|
1028
|
+
padding: `${o}px ${o * 1.5}px`,
|
|
1029
|
+
borderRadius: `${c}px`,
|
|
1028
1030
|
minWidth: "200px"
|
|
1029
1031
|
},
|
|
1030
1032
|
children: "Exit"
|
|
1031
1033
|
}
|
|
1032
1034
|
)
|
|
1033
1035
|
] })
|
|
1034
|
-
] })
|
|
1036
|
+
] }) : null;
|
|
1037
|
+
return /* @__PURE__ */ n(
|
|
1038
|
+
"div",
|
|
1039
|
+
{
|
|
1040
|
+
style: {
|
|
1041
|
+
width: "100%",
|
|
1042
|
+
height: "100%",
|
|
1043
|
+
display: "flex",
|
|
1044
|
+
justifyContent: "center",
|
|
1045
|
+
alignItems: "center",
|
|
1046
|
+
background: "transparent",
|
|
1047
|
+
overflow: "hidden",
|
|
1048
|
+
position: "absolute",
|
|
1049
|
+
top: 0,
|
|
1050
|
+
left: 0,
|
|
1051
|
+
right: 0,
|
|
1052
|
+
bottom: 0
|
|
1053
|
+
},
|
|
1054
|
+
children: /* @__PURE__ */ n(
|
|
1055
|
+
"div",
|
|
1056
|
+
{
|
|
1057
|
+
style: {
|
|
1058
|
+
width: p ? "100%" : g || r || 1e3,
|
|
1059
|
+
height: p ? "100%" : g || r || 1e3,
|
|
1060
|
+
display: "flex",
|
|
1061
|
+
justifyContent: "center",
|
|
1062
|
+
alignItems: "center",
|
|
1063
|
+
overflow: "hidden",
|
|
1064
|
+
borderRadius: p ? 0 : "20px",
|
|
1065
|
+
background: "#ffffff",
|
|
1066
|
+
boxShadow: p ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
1067
|
+
margin: p ? "0 auto" : "unset",
|
|
1068
|
+
position: "relative",
|
|
1069
|
+
// needed so absolute logo is inside the square
|
|
1070
|
+
transform: `scale(${J})`
|
|
1071
|
+
},
|
|
1072
|
+
children: /* @__PURE__ */ n(
|
|
1073
|
+
"div",
|
|
1074
|
+
{
|
|
1075
|
+
style: {
|
|
1076
|
+
transform: "translateZ(0)",
|
|
1077
|
+
width: "100%",
|
|
1078
|
+
height: "100%",
|
|
1079
|
+
display: "flex",
|
|
1080
|
+
justifyContent: "center",
|
|
1081
|
+
alignItems: "center"
|
|
1082
|
+
},
|
|
1083
|
+
children: /* @__PURE__ */ n("div", { style: we, children: Me() })
|
|
1084
|
+
}
|
|
1085
|
+
)
|
|
1086
|
+
}
|
|
1087
|
+
)
|
|
1088
|
+
}
|
|
1089
|
+
);
|
|
1035
1090
|
}
|
|
1036
1091
|
export {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1092
|
+
Le as Game,
|
|
1093
|
+
Le as HangmanLobbyGame,
|
|
1094
|
+
Le as default
|
|
1040
1095
|
};
|
|
1041
1096
|
//# sourceMappingURL=speakid-hangman.es.js.map
|