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