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