speakid-build-a-sentence 1.0.17 → 1.0.19
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/Game.d.ts +0 -1
- package/dist/Game.d.ts.map +1 -1
- package/dist/Game.styles.d.ts.map +1 -1
- package/dist/speakid-build-a-sentence.cjs.js +3 -3
- package/dist/speakid-build-a-sentence.cjs.js.map +1 -1
- package/dist/speakid-build-a-sentence.es.js +259 -249
- package/dist/speakid-build-a-sentence.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
2
|
+
import { useState as c, useCallback as pe, useRef as be, useEffect as J, Component as Ue } from "react";
|
|
3
|
+
const qe = `
|
|
4
4
|
@keyframes magic-sentence-spin {
|
|
5
5
|
from { transform: rotate(0deg); }
|
|
6
6
|
to { transform: rotate(360deg); }
|
|
@@ -35,8 +35,8 @@ const Ke = `
|
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
37
|
if (typeof document < "u" && !document.getElementById("magic-sentence-keyframes")) {
|
|
38
|
-
const
|
|
39
|
-
|
|
38
|
+
const g = document.createElement("style");
|
|
39
|
+
g.id = "magic-sentence-keyframes", g.innerHTML = qe, document.head.appendChild(g);
|
|
40
40
|
}
|
|
41
41
|
const Se = {
|
|
42
42
|
spin: {
|
|
@@ -57,7 +57,7 @@ const Se = {
|
|
|
57
57
|
glow: {
|
|
58
58
|
animation: "magic-sentence-glow 1s ease-in-out infinite"
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, p = {
|
|
61
61
|
gmCenterScreen: {
|
|
62
62
|
position: "relative",
|
|
63
63
|
zIndex: 1,
|
|
@@ -147,6 +147,17 @@ const Se = {
|
|
|
147
147
|
willChange: "auto"
|
|
148
148
|
},
|
|
149
149
|
gmLogoImg: {
|
|
150
|
+
height: "clamp(28px, 5vw, 40px)",
|
|
151
|
+
width: "auto",
|
|
152
|
+
background: "transparent",
|
|
153
|
+
objectFit: "contain",
|
|
154
|
+
imageRendering: "auto",
|
|
155
|
+
transform: "translateZ(0)",
|
|
156
|
+
backfaceVisibility: "hidden",
|
|
157
|
+
WebkitFontSmoothing: "antialiased",
|
|
158
|
+
display: "block"
|
|
159
|
+
},
|
|
160
|
+
gmLogoFallback: {
|
|
150
161
|
height: "clamp(28px, 5vw, 40px)",
|
|
151
162
|
width: "auto",
|
|
152
163
|
background: "transparent",
|
|
@@ -157,8 +168,7 @@ const Se = {
|
|
|
157
168
|
transform: "translateZ(0)",
|
|
158
169
|
backfaceVisibility: "hidden",
|
|
159
170
|
WebkitFontSmoothing: "antialiased",
|
|
160
|
-
|
|
161
|
-
imageRendering: "auto"
|
|
171
|
+
display: "block"
|
|
162
172
|
},
|
|
163
173
|
gmReadyWrapper: {
|
|
164
174
|
display: "flex",
|
|
@@ -175,60 +185,60 @@ const Se = {
|
|
|
175
185
|
},
|
|
176
186
|
// ===== Анимационные стили =====
|
|
177
187
|
...Se
|
|
178
|
-
},
|
|
179
|
-
const [
|
|
180
|
-
const
|
|
181
|
-
|
|
188
|
+
}, Ye = () => {
|
|
189
|
+
const [g, r] = c([]), S = pe((H, I, u) => {
|
|
190
|
+
const f = [];
|
|
191
|
+
H.trim() || f.push({
|
|
182
192
|
type: "empty",
|
|
183
193
|
message: "Sentence cannot be empty"
|
|
184
|
-
}),
|
|
194
|
+
}), H.length > 41 && f.push({
|
|
185
195
|
type: "length",
|
|
186
|
-
message: `Sentence is too long (${
|
|
187
|
-
}),
|
|
196
|
+
message: `Sentence is too long (${H.length}/41 characters)`
|
|
197
|
+
}), H && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(H) && f.push({
|
|
188
198
|
type: "characters",
|
|
189
199
|
message: "Only Latin characters, numbers, spaces and punctuation are allowed"
|
|
190
200
|
});
|
|
191
|
-
const
|
|
192
|
-
return
|
|
201
|
+
const b = u.findIndex((D, V) => V !== I && D.toLowerCase().trim() === H.toLowerCase().trim());
|
|
202
|
+
return b !== -1 && f.push({
|
|
193
203
|
type: "duplicate",
|
|
194
|
-
message: `Duplicate sentence (same as sentence ${
|
|
195
|
-
}), r(
|
|
196
|
-
isValid:
|
|
197
|
-
errors:
|
|
204
|
+
message: `Duplicate sentence (same as sentence ${b + 1})`
|
|
205
|
+
}), r(f), {
|
|
206
|
+
isValid: f.length === 0,
|
|
207
|
+
errors: f
|
|
198
208
|
};
|
|
199
|
-
}, []),
|
|
200
|
-
const
|
|
201
|
-
return
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
...
|
|
205
|
-
message: `Sentence ${
|
|
209
|
+
}, []), ee = pe((H) => {
|
|
210
|
+
const I = [];
|
|
211
|
+
return H.forEach((u, f) => {
|
|
212
|
+
const y = S(u, f, H);
|
|
213
|
+
I.push(...y.errors.map((b) => ({
|
|
214
|
+
...b,
|
|
215
|
+
message: `Sentence ${f + 1}: ${b.message}`
|
|
206
216
|
})));
|
|
207
217
|
}), {
|
|
208
|
-
isValid:
|
|
209
|
-
errors:
|
|
218
|
+
isValid: I.length === 0,
|
|
219
|
+
errors: I
|
|
210
220
|
};
|
|
211
|
-
}, [
|
|
221
|
+
}, [S]), ne = pe(() => {
|
|
212
222
|
r([]);
|
|
213
223
|
}, []);
|
|
214
224
|
return {
|
|
215
|
-
errors:
|
|
216
|
-
validateSentence:
|
|
217
|
-
validateAllSentences:
|
|
225
|
+
errors: g,
|
|
226
|
+
validateSentence: S,
|
|
227
|
+
validateAllSentences: ee,
|
|
218
228
|
clearErrors: ne
|
|
219
229
|
};
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
}, E = (
|
|
230
|
+
}, Ke = (g, r, S) => r && S ? `${g} word "${r}" ${S}` : r ? `${g} word "${r}"` : g, _e = (g, r, S = ["Enter", " "]) => {
|
|
231
|
+
S.includes(g.key) && (g.preventDefault(), r());
|
|
232
|
+
}, E = (g) => {
|
|
223
233
|
const r = document.createElement("div");
|
|
224
|
-
r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.position = "absolute", r.style.left = "-10000px", r.style.width = "1px", r.style.height = "1px", r.style.overflow = "hidden", document.body.appendChild(r), r.textContent =
|
|
234
|
+
r.setAttribute("aria-live", "polite"), r.setAttribute("aria-atomic", "true"), r.style.position = "absolute", r.style.left = "-10000px", r.style.width = "1px", r.style.height = "1px", r.style.overflow = "hidden", document.body.appendChild(r), r.textContent = g, setTimeout(() => {
|
|
225
235
|
document.body.removeChild(r);
|
|
226
236
|
}, 1e3);
|
|
227
|
-
},
|
|
228
|
-
const
|
|
229
|
-
|
|
237
|
+
}, en = () => {
|
|
238
|
+
const g = document.createElement("style");
|
|
239
|
+
g.id = "magic-sentence-reset";
|
|
230
240
|
const r = document.getElementById("magic-sentence-reset");
|
|
231
|
-
r && r.remove(),
|
|
241
|
+
r && r.remove(), g.textContent = `
|
|
232
242
|
#magic-sentence-root, #magic-sentence-root * {
|
|
233
243
|
box-sizing: border-box;
|
|
234
244
|
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
@@ -254,11 +264,11 @@ const Se = {
|
|
|
254
264
|
height: 100% !important;
|
|
255
265
|
overflow: hidden !important;
|
|
256
266
|
}
|
|
257
|
-
`, document.head.appendChild(
|
|
258
|
-
},
|
|
259
|
-
function
|
|
260
|
-
const { logoUrl: r, showLogo:
|
|
261
|
-
if (!
|
|
267
|
+
`, document.head.appendChild(g);
|
|
268
|
+
}, nn = (g) => [...g].sort(() => Math.random() - 0.5);
|
|
269
|
+
function dn(g = {}) {
|
|
270
|
+
const { logoUrl: r, showLogo: S = !0 } = g, ee = be(null), { validateAllSentences: ne, errors: H } = Ye(), I = () => l || window.innerWidth < 768, u = () => l || window.innerWidth < 768 || window.innerWidth >= 320 && window.innerWidth <= 932 && window.innerHeight >= 390 && window.innerHeight <= 932, f = (e = "medium") => {
|
|
271
|
+
if (!u())
|
|
262
272
|
return {
|
|
263
273
|
padding: "12px 24px",
|
|
264
274
|
fontSize: "16px",
|
|
@@ -285,113 +295,113 @@ function ln(h = {}) {
|
|
|
285
295
|
};
|
|
286
296
|
}
|
|
287
297
|
};
|
|
288
|
-
|
|
298
|
+
J(() => (en(), () => {
|
|
289
299
|
document.documentElement.style.overflow = "", document.body.style.overflow = "";
|
|
290
300
|
const e = document.getElementById("magic-sentence-reset");
|
|
291
301
|
e && e.remove();
|
|
292
302
|
}), []);
|
|
293
|
-
const [
|
|
303
|
+
const [y, b] = c("select"), [D, V] = c(null), [ge, he] = c(null), [C, U] = c([]), [T, we] = c(0), [te, ue] = c([]), [k, ie] = c([]), [B, me] = c(20), [Q, q] = c(0), [tn, fe] = c(null), [L, z] = c(null), [d, Y] = c(!1), [oe, We] = c(
|
|
294
304
|
Number(localStorage.getItem("magicSentenceBest")) || 0
|
|
295
|
-
),
|
|
296
|
-
|
|
305
|
+
), X = be(null), [W, P] = c({ list: null, index: null, side: null }), [l, ve] = c(!1), [on, re] = c(1), [xe, se] = c(null), [ke, He] = c(!1), [M, Ie] = c(!1), [A, Ce] = c(!1), [G, De] = c(!1), [$, Te] = c(!1), [N, Pe] = c(!1), [j, Re] = c(!1), [O, ze] = c(!1), [F, Ee] = c(!1);
|
|
306
|
+
J(() => {
|
|
297
307
|
const e = () => {
|
|
298
|
-
const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700,
|
|
299
|
-
if (Ie(
|
|
308
|
+
const t = window.innerWidth, n = window.innerHeight, i = t < 768 || t === 926 && n === 428 || t === 932 && n === 430, o = n < 700, w = t === 768 && n === 1024, x = t === 1024 && n === 768, s = t === 820 && n === 1180, h = t === 1180 && n === 820, Z = t === 540 && n === 720, v = t === 720 && n === 540, ce = t === 1024 && n === 1366, Xe = t === 1366 && n === 1024, Je = t >= 1200 && n >= 600 && !i;
|
|
309
|
+
if (He(Je), Ie(w), Ce(x), De(s), Te(h), Pe(Z), Re(v), ze(ce), Ee(Xe), ve(i), i)
|
|
300
310
|
se(null), re(1);
|
|
301
311
|
else if (o)
|
|
302
312
|
se(null), re(1);
|
|
303
313
|
else {
|
|
304
|
-
const
|
|
305
|
-
se(
|
|
314
|
+
const Ve = Math.min(1e3, Math.min(t, n) * 0.9);
|
|
315
|
+
se(Ve), re(1);
|
|
306
316
|
}
|
|
307
317
|
};
|
|
308
318
|
return e(), window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
309
319
|
}, []);
|
|
310
|
-
const
|
|
311
|
-
if (
|
|
312
|
-
let o = [...te],
|
|
313
|
-
const x = e === "bank" ? o :
|
|
314
|
-
if (
|
|
315
|
-
const [
|
|
316
|
-
let
|
|
317
|
-
e === t &&
|
|
318
|
-
},
|
|
319
|
-
if (e.preventDefault(),
|
|
320
|
+
const K = (e, t, n, i) => {
|
|
321
|
+
if (d) return;
|
|
322
|
+
let o = [...te], w = [...k];
|
|
323
|
+
const x = e === "bank" ? o : w, s = t === "bank" ? o : w, h = x.findIndex((ce) => ce.id === n);
|
|
324
|
+
if (h === -1) return;
|
|
325
|
+
const [Z] = x.splice(h, 1);
|
|
326
|
+
let v = i;
|
|
327
|
+
e === t && v !== null && v !== void 0 && v > h && (v = v - 1), v == null || v < 0 || v > s.length ? s.push(Z) : s.splice(v, 0, Z), e === "bank" ? o = x : w = x, t === "bank" ? o = s : w = s, ue(o), ie(w);
|
|
328
|
+
}, _ = (e, t, n) => {
|
|
329
|
+
if (e.preventDefault(), d) {
|
|
320
330
|
P({ list: null, index: null, side: null });
|
|
321
331
|
return;
|
|
322
332
|
}
|
|
323
333
|
const i = e.dataTransfer.getData("application/x-token") || (() => {
|
|
324
334
|
const o = e.dataTransfer.getData("text/plain");
|
|
325
335
|
if (!o) return "";
|
|
326
|
-
const
|
|
336
|
+
const w = te.some((h) => h.id === o), x = k.some((h) => h.id === o), s = w ? "bank" : x ? "selected" : null;
|
|
327
337
|
return s ? JSON.stringify({ from: s, id: o }) : "";
|
|
328
338
|
})();
|
|
329
339
|
if (i) {
|
|
330
340
|
try {
|
|
331
341
|
const o = JSON.parse(i);
|
|
332
342
|
if (!o || !o.id || !o.from) return;
|
|
333
|
-
|
|
343
|
+
K(o.from, t, o.id, n);
|
|
334
344
|
} catch {
|
|
335
345
|
}
|
|
336
346
|
P({ list: null, index: null, side: null });
|
|
337
347
|
}
|
|
338
|
-
},
|
|
339
|
-
|
|
348
|
+
}, Be = (e) => {
|
|
349
|
+
V(e), U(Array(e).fill("")), b("time");
|
|
340
350
|
}, Le = (e) => {
|
|
341
|
-
|
|
342
|
-
},
|
|
351
|
+
he(e), b("type");
|
|
352
|
+
}, Me = (e, t) => {
|
|
343
353
|
if (t.length > 41 || t && !/^[a-zA-Z0-9\s.,!?;:'"-]*$/.test(t))
|
|
344
354
|
return;
|
|
345
|
-
const i = [...
|
|
346
|
-
i[e] = t,
|
|
347
|
-
const o =
|
|
355
|
+
const i = [...C];
|
|
356
|
+
i[e] = t, U(i);
|
|
357
|
+
const o = ne(i);
|
|
348
358
|
o.isValid || console.warn("Validation errors:", o.errors);
|
|
349
|
-
},
|
|
350
|
-
|
|
359
|
+
}, Ae = (e) => e.trim().replace(/\s+/g, " "), ye = (e) => e <= 3 ? 20 : e <= 5 ? 18 : e <= 7 ? 16 : e <= 9 ? 14 : 12, Ge = () => {
|
|
360
|
+
C.some((t) => t.trim().length === 0) || (U((t) => t.map((n) => Ae(n))), q(0), we(0), fe(null), b("getready"));
|
|
351
361
|
};
|
|
352
|
-
|
|
353
|
-
if (
|
|
362
|
+
J(() => {
|
|
363
|
+
if (y === "getready") {
|
|
354
364
|
const e = setTimeout(() => ae(0), 3e3);
|
|
355
365
|
return () => clearTimeout(e);
|
|
356
366
|
}
|
|
357
|
-
}, [
|
|
367
|
+
}, [y]);
|
|
358
368
|
const ae = (e) => {
|
|
359
|
-
const t =
|
|
369
|
+
const t = C[e];
|
|
360
370
|
if (!t) return;
|
|
361
|
-
const i =
|
|
371
|
+
const i = nn(
|
|
362
372
|
t.trim().split(/\s+/).filter(Boolean)
|
|
363
|
-
).map((o,
|
|
364
|
-
id: `${Date.now()}-${e}-${
|
|
373
|
+
).map((o, w) => ({
|
|
374
|
+
id: `${Date.now()}-${e}-${w}-${Math.random().toString(36).slice(2)}`,
|
|
365
375
|
text: o
|
|
366
376
|
}));
|
|
367
|
-
|
|
377
|
+
ue(i), ie([]), we(e), me(ge || 20), z(null), Y(!1), b("play");
|
|
368
378
|
};
|
|
369
|
-
|
|
370
|
-
if (
|
|
371
|
-
if (
|
|
372
|
-
|
|
379
|
+
J(() => {
|
|
380
|
+
if (y === "play" && !d)
|
|
381
|
+
if (X.current !== null && window.clearTimeout(X.current), B > 0)
|
|
382
|
+
X.current = window.setTimeout(() => me((e) => e - 1), 1e3);
|
|
373
383
|
else {
|
|
374
|
-
|
|
375
|
-
const t =
|
|
384
|
+
Y(!0);
|
|
385
|
+
const t = C[T].trim().split(/\s+/), n = k.map((s) => s.text), i = t.filter((s) => !n.includes(s)).length, o = n.filter((s) => !t.includes(s)).length, w = t.filter((s, h) => s !== n[h]).length, x = i + o + w;
|
|
376
386
|
x === 0 ? (z("correct"), R("correct"), E("Correct! Well done!")) : x === 1 ? (z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!"));
|
|
377
387
|
}
|
|
378
388
|
return () => {
|
|
379
|
-
|
|
389
|
+
X.current !== null && window.clearTimeout(X.current);
|
|
380
390
|
};
|
|
381
|
-
}, [
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
T + 1 < (
|
|
391
|
+
}, [y, B, d, C, T, k]);
|
|
392
|
+
const $e = (e = !0) => {
|
|
393
|
+
if (d && e) {
|
|
394
|
+
T + 1 < (D || 0) ? ae(T + 1) : (b("results"), setTimeout(() => de(), 600));
|
|
385
395
|
return;
|
|
386
396
|
}
|
|
387
|
-
if (e && !
|
|
388
|
-
const n =
|
|
389
|
-
s === 0 &&
|
|
397
|
+
if (e && !d) {
|
|
398
|
+
const n = C[T].trim().split(/\s+/), i = k.map((h) => h.text), o = n.filter((h) => !i.includes(h)).length, w = i.filter((h) => !n.includes(h)).length, x = n.filter((h, Z) => h !== i[Z]).length, s = o + w + x;
|
|
399
|
+
s === 0 && B > 0 ? (q((h) => h + 1), z("correct"), R("correct"), E("Correct! Well done!")) : s === 1 ? (q((h) => h + 0.5), z("almost"), R("half"), E("Almost correct! Just one mistake.")) : (z("wrong"), R("wrong"), E("Not quite right. Keep trying!")), T + 1 < (D || 0) ? setTimeout(() => ae(T + 1), 800) : (b("results"), setTimeout(() => de(), 600));
|
|
390
400
|
}
|
|
391
401
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
}, [
|
|
402
|
+
J(() => {
|
|
403
|
+
y === "results" && Q > oe && (We(Q), localStorage.setItem("magicSentenceBest", String(Q)));
|
|
404
|
+
}, [y, Q, oe]);
|
|
395
405
|
const R = (e) => {
|
|
396
406
|
const t = new (window.AudioContext || window.webkitAudioContext)(), n = t.createOscillator(), i = t.createGain();
|
|
397
407
|
switch (n.connect(i), i.connect(t.destination), e) {
|
|
@@ -415,7 +425,7 @@ function ln(h = {}) {
|
|
|
415
425
|
}, de = () => {
|
|
416
426
|
const t = Date.now() + 2500, n = ["#ec4c44", "#f7c948", "#6fcf97", "#56ccf2", "#bb6bd9"], i = document.createElement("canvas"), o = i.getContext("2d");
|
|
417
427
|
i.width = window.innerWidth, i.height = window.innerHeight, i.style.position = "fixed", i.style.top = "0", i.style.left = "0", i.style.pointerEvents = "none", document.body.appendChild(i);
|
|
418
|
-
const
|
|
428
|
+
const w = Array.from({ length: 100 }).map(() => ({
|
|
419
429
|
x: Math.random() * i.width,
|
|
420
430
|
y: Math.random() * i.height - i.height,
|
|
421
431
|
size: 6 + Math.random() * 6,
|
|
@@ -423,25 +433,25 @@ function ln(h = {}) {
|
|
|
423
433
|
speed: 2 + Math.random() * 4,
|
|
424
434
|
tilt: Math.random() * 2 * Math.PI
|
|
425
435
|
})), x = () => {
|
|
426
|
-
o.clearRect(0, 0, i.width, i.height),
|
|
436
|
+
o.clearRect(0, 0, i.width, i.height), w.forEach((s) => {
|
|
427
437
|
o.fillStyle = s.color, o.beginPath(), o.ellipse(s.x, s.y, s.size, s.size / 2, s.tilt, 0, 2 * Math.PI), o.fill(), s.y += s.speed, s.x += Math.sin(s.tilt);
|
|
428
438
|
}), Date.now() < t ? requestAnimationFrame(x) : document.body.removeChild(i);
|
|
429
439
|
};
|
|
430
440
|
x();
|
|
431
|
-
},
|
|
432
|
-
/* @__PURE__ */ a("h1", { style:
|
|
433
|
-
/* @__PURE__ */ a("p", { style:
|
|
441
|
+
}, Ne = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
|
|
442
|
+
/* @__PURE__ */ a("h1", { style: p.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
443
|
+
/* @__PURE__ */ a("p", { style: p.gmBodyM, children: "Select number of rounds" }),
|
|
434
444
|
/* @__PURE__ */ a("div", { style: {
|
|
435
445
|
display: "flex",
|
|
436
|
-
gap:
|
|
446
|
+
gap: u() ? "8px" : "16px",
|
|
437
447
|
justifyContent: "center"
|
|
438
448
|
}, children: [3, 4, 5].map((e) => /* @__PURE__ */ m(
|
|
439
449
|
"button",
|
|
440
450
|
{
|
|
441
|
-
onClick: () =>
|
|
451
|
+
onClick: () => Be(e),
|
|
442
452
|
style: {
|
|
443
|
-
...
|
|
444
|
-
...
|
|
453
|
+
...p.gmButton,
|
|
454
|
+
...f("medium")
|
|
445
455
|
},
|
|
446
456
|
children: [
|
|
447
457
|
e,
|
|
@@ -450,20 +460,20 @@ function ln(h = {}) {
|
|
|
450
460
|
},
|
|
451
461
|
e
|
|
452
462
|
)) })
|
|
453
|
-
] }),
|
|
454
|
-
/* @__PURE__ */ a("h1", { style:
|
|
455
|
-
/* @__PURE__ */ a("p", { style:
|
|
463
|
+
] }), je = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
|
|
464
|
+
/* @__PURE__ */ a("h1", { style: p.gmHeadline1, children: "MAGIC SENTENCE" }),
|
|
465
|
+
/* @__PURE__ */ a("p", { style: p.gmBodyM, children: "Select time per round" }),
|
|
456
466
|
/* @__PURE__ */ a("div", { style: {
|
|
457
467
|
display: "flex",
|
|
458
|
-
gap:
|
|
468
|
+
gap: u() ? "8px" : "16px",
|
|
459
469
|
justifyContent: "center"
|
|
460
470
|
}, children: [15, 20, 30].map((e) => /* @__PURE__ */ m(
|
|
461
471
|
"button",
|
|
462
472
|
{
|
|
463
473
|
onClick: () => Le(e),
|
|
464
474
|
style: {
|
|
465
|
-
...
|
|
466
|
-
...
|
|
475
|
+
...p.gmButton,
|
|
476
|
+
...f("medium")
|
|
467
477
|
},
|
|
468
478
|
children: [
|
|
469
479
|
e,
|
|
@@ -472,15 +482,15 @@ function ln(h = {}) {
|
|
|
472
482
|
},
|
|
473
483
|
e
|
|
474
484
|
)) })
|
|
475
|
-
] }),
|
|
476
|
-
/* @__PURE__ */ m("h2", { style: { ...
|
|
485
|
+
] }), Oe = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
|
|
486
|
+
/* @__PURE__ */ m("h2", { style: { ...p.gmBodyM, marginBottom: "0px" }, children: [
|
|
477
487
|
"Type down ",
|
|
478
|
-
|
|
488
|
+
D,
|
|
479
489
|
" sentence",
|
|
480
|
-
|
|
490
|
+
D && D > 1 ? "s" : "",
|
|
481
491
|
" for your student"
|
|
482
492
|
] }),
|
|
483
|
-
/* @__PURE__ */ a("p", { style: { ...
|
|
493
|
+
/* @__PURE__ */ a("p", { style: { ...p.gmBodyS, marginBottom: "16px", marginTop: "0px", color: "#6b7280" }, children: "Maximum 41 characters per sentence" }),
|
|
484
494
|
/* @__PURE__ */ a("div", { style: {
|
|
485
495
|
display: "flex",
|
|
486
496
|
flexDirection: "column",
|
|
@@ -491,16 +501,16 @@ function ln(h = {}) {
|
|
|
491
501
|
// Минимальная ширина по содержимому
|
|
492
502
|
maxWidth: "600px"
|
|
493
503
|
// Ограничиваем максимальную ширину
|
|
494
|
-
}, children:
|
|
504
|
+
}, children: C.map((e, t) => /* @__PURE__ */ a(
|
|
495
505
|
"input",
|
|
496
506
|
{
|
|
497
507
|
value: e,
|
|
498
508
|
placeholder: `Sentence ${t + 1}`,
|
|
499
|
-
onChange: (n) =>
|
|
509
|
+
onChange: (n) => Me(t, n.target.value),
|
|
500
510
|
style: {
|
|
501
|
-
...
|
|
502
|
-
padding:
|
|
503
|
-
fontSize:
|
|
511
|
+
...p.gmInput,
|
|
512
|
+
padding: u() ? "8px 12px" : "12px 16px",
|
|
513
|
+
fontSize: u() ? "14px" : "16px",
|
|
504
514
|
width: "100%",
|
|
505
515
|
// Поля теперь будут шире благодаря увеличенной ширине контейнера
|
|
506
516
|
textAlign: "center"
|
|
@@ -513,53 +523,53 @@ function ln(h = {}) {
|
|
|
513
523
|
"button",
|
|
514
524
|
{
|
|
515
525
|
onClick: Ge,
|
|
516
|
-
disabled:
|
|
526
|
+
disabled: C.some((e) => e.trim().length === 0),
|
|
517
527
|
style: {
|
|
518
|
-
...
|
|
528
|
+
...p.gmButton,
|
|
519
529
|
marginTop: 30,
|
|
520
|
-
background:
|
|
521
|
-
cursor:
|
|
522
|
-
...
|
|
530
|
+
background: C.some((e) => e.trim().length === 0) ? "#ccc" : "#ec4c44",
|
|
531
|
+
cursor: C.some((e) => e.trim().length === 0) ? "not-allowed" : "pointer",
|
|
532
|
+
...f("large")
|
|
523
533
|
},
|
|
524
534
|
children: "PLAY"
|
|
525
535
|
}
|
|
526
536
|
)
|
|
527
|
-
] }),
|
|
537
|
+
] }), Fe = () => /* @__PURE__ */ m("div", { style: p.gmReadyWrapper, children: [
|
|
528
538
|
/* @__PURE__ */ a("h1", { style: {
|
|
529
|
-
...
|
|
539
|
+
...p.gmHeadline1,
|
|
530
540
|
color: "#ec4c44"
|
|
531
541
|
}, children: "GET READY" }),
|
|
532
|
-
/* @__PURE__ */ a("div", { style:
|
|
533
|
-
] }),
|
|
542
|
+
/* @__PURE__ */ a("div", { style: p.gmHourglass, children: "⏳" })
|
|
543
|
+
] }), Ze = () => /* @__PURE__ */ m("div", { style: p.gmGameLayout, children: [
|
|
534
544
|
/* @__PURE__ */ m("h2", { style: {
|
|
535
|
-
marginBottom:
|
|
536
|
-
fontSize:
|
|
545
|
+
marginBottom: u() ? "5px" : "10px",
|
|
546
|
+
fontSize: u() ? "16px" : "20px"
|
|
537
547
|
}, children: [
|
|
538
548
|
"Round ",
|
|
539
549
|
T + 1,
|
|
540
550
|
"/",
|
|
541
|
-
|
|
551
|
+
D,
|
|
542
552
|
" — ",
|
|
543
|
-
|
|
553
|
+
d ? "TIME'S UP!" : `Time: ${B}s`
|
|
544
554
|
] }),
|
|
545
555
|
/* @__PURE__ */ a(
|
|
546
556
|
"div",
|
|
547
557
|
{
|
|
548
558
|
style: {
|
|
549
559
|
width: "60%",
|
|
550
|
-
height:
|
|
560
|
+
height: u() ? "8px" : "14px",
|
|
551
561
|
borderRadius: 8,
|
|
552
562
|
background: "#eee",
|
|
553
563
|
overflow: "hidden",
|
|
554
|
-
marginBottom:
|
|
564
|
+
marginBottom: u() ? "10px" : "20px"
|
|
555
565
|
},
|
|
556
566
|
children: /* @__PURE__ */ a(
|
|
557
567
|
"div",
|
|
558
568
|
{
|
|
559
569
|
style: {
|
|
560
570
|
height: "100%",
|
|
561
|
-
width: `${
|
|
562
|
-
background:
|
|
571
|
+
width: `${B / (ge || 20) * 100}%`,
|
|
572
|
+
background: B <= 5 ? "#ec4c44" : "#4caf50",
|
|
563
573
|
transition: "width 1s linear"
|
|
564
574
|
}
|
|
565
575
|
}
|
|
@@ -570,26 +580,26 @@ function ln(h = {}) {
|
|
|
570
580
|
"div",
|
|
571
581
|
{
|
|
572
582
|
onDragOver: (e) => e.preventDefault(),
|
|
573
|
-
onDrop: (e) =>
|
|
583
|
+
onDrop: (e) => _(e, "bank", null),
|
|
574
584
|
style: {
|
|
575
585
|
display: "flex",
|
|
576
|
-
flexWrap:
|
|
577
|
-
gap:
|
|
586
|
+
flexWrap: I() ? "wrap" : "nowrap",
|
|
587
|
+
gap: l || window.innerWidth < 768 ? "6px" : "10px",
|
|
578
588
|
justifyContent: "center",
|
|
579
|
-
marginBottom:
|
|
580
|
-
padding:
|
|
589
|
+
marginBottom: l || window.innerWidth < 768 ? "15px" : "30px",
|
|
590
|
+
padding: l || window.innerWidth < 768 ? "5px" : "10px",
|
|
581
591
|
width: "100%",
|
|
582
592
|
boxSizing: "border-box"
|
|
583
593
|
},
|
|
584
594
|
children: te.map((e, t) => /* @__PURE__ */ a(
|
|
585
595
|
"div",
|
|
586
596
|
{
|
|
587
|
-
draggable: !
|
|
597
|
+
draggable: !d,
|
|
588
598
|
role: "button",
|
|
589
|
-
tabIndex:
|
|
590
|
-
"aria-label":
|
|
599
|
+
tabIndex: d ? -1 : 0,
|
|
600
|
+
"aria-label": d ? `Word: ${e.text} (time expired)` : Ke("Drag word", e.text, "to build sentence"),
|
|
591
601
|
onDragStart: (n) => {
|
|
592
|
-
if (
|
|
602
|
+
if (d) {
|
|
593
603
|
n.preventDefault();
|
|
594
604
|
return;
|
|
595
605
|
}
|
|
@@ -599,34 +609,34 @@ function ln(h = {}) {
|
|
|
599
609
|
), n.dataTransfer.setData("text/plain", e.id), E(`Dragging word: ${e.text}`);
|
|
600
610
|
},
|
|
601
611
|
onKeyDown: (n) => {
|
|
602
|
-
|
|
612
|
+
d || _e(n, () => K("bank", "selected", e.id, null));
|
|
603
613
|
},
|
|
604
614
|
onDragOver: (n) => n.preventDefault(),
|
|
605
615
|
onDrop: (n) => {
|
|
606
|
-
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2,
|
|
607
|
-
P({ list: null, index: null, side: null }), n.stopPropagation(),
|
|
616
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, w = n.clientX > o ? t + 1 : t;
|
|
617
|
+
P({ list: null, index: null, side: null }), n.stopPropagation(), _(n, "bank", w);
|
|
608
618
|
},
|
|
609
619
|
onDragEnter: (n) => {
|
|
610
|
-
if (
|
|
620
|
+
if (d) return;
|
|
611
621
|
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
|
|
612
622
|
P({ list: "bank", index: t, side: n.clientX > o ? "right" : "left" });
|
|
613
623
|
},
|
|
614
624
|
onDragLeave: () => P({ list: null, index: null, side: null }),
|
|
615
625
|
onClick: () => {
|
|
616
|
-
|
|
626
|
+
d || K("bank", "selected", e.id, null);
|
|
617
627
|
},
|
|
618
628
|
style: {
|
|
619
|
-
padding:
|
|
620
|
-
borderRadius:
|
|
629
|
+
padding: l || window.innerWidth < 768 ? "6px 10px" : "10px 16px",
|
|
630
|
+
borderRadius: l || window.innerWidth < 768 ? "6px" : "10px",
|
|
621
631
|
border: "1px solid #ccc",
|
|
622
|
-
background:
|
|
623
|
-
cursor:
|
|
624
|
-
fontSize:
|
|
625
|
-
borderLeft:
|
|
626
|
-
borderRight:
|
|
632
|
+
background: d ? "#f0f0f0" : "#f9f9f9",
|
|
633
|
+
cursor: d ? "not-allowed" : "pointer",
|
|
634
|
+
fontSize: l || window.innerWidth < 768 ? "12px" : "18px",
|
|
635
|
+
borderLeft: W.list === "bank" && W.index === t && W.side === "left" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
636
|
+
borderRight: W.list === "bank" && W.index === t && W.side === "right" ? "3px solid #3b82f6" : "1px solid #ccc",
|
|
627
637
|
flexShrink: 0,
|
|
628
638
|
flexBasis: "auto",
|
|
629
|
-
opacity:
|
|
639
|
+
opacity: d ? 0.6 : 1,
|
|
630
640
|
transition: "opacity 0.3s ease"
|
|
631
641
|
},
|
|
632
642
|
children: e.text
|
|
@@ -639,33 +649,33 @@ function ln(h = {}) {
|
|
|
639
649
|
"div",
|
|
640
650
|
{
|
|
641
651
|
onDragOver: (e) => e.preventDefault(),
|
|
642
|
-
onDrop: (e) =>
|
|
652
|
+
onDrop: (e) => _(e, "selected", null),
|
|
643
653
|
style: {
|
|
644
|
-
minHeight:
|
|
654
|
+
minHeight: l || window.innerWidth < 768 ? "50px" : "70px",
|
|
645
655
|
width: "auto",
|
|
646
656
|
// Автоматическая ширина в зависимости от содержимого
|
|
647
657
|
maxWidth: "none",
|
|
648
658
|
// Убираем ограничение максимальной ширины
|
|
649
659
|
minWidth: "245px",
|
|
650
660
|
// Минимальная ширина для растягивания
|
|
651
|
-
border:
|
|
652
|
-
borderRadius:
|
|
653
|
-
padding:
|
|
661
|
+
border: L === "correct" ? "2px dashed #4caf50" : L === "almost" ? "2px dashed #ff9800" : L === "wrong" ? "2px dashed #f44336" : "2px dashed #ccc",
|
|
662
|
+
borderRadius: l || window.innerWidth < 768 ? "8px" : "12px",
|
|
663
|
+
padding: l || window.innerWidth < 768 ? "8px" : "12px",
|
|
654
664
|
display: "flex",
|
|
655
|
-
flexWrap:
|
|
665
|
+
flexWrap: I() ? "wrap" : "nowrap",
|
|
656
666
|
alignItems: "center",
|
|
657
667
|
justifyContent: "center",
|
|
658
|
-
fontSize: `${
|
|
659
|
-
background:
|
|
660
|
-
overflowX:
|
|
661
|
-
whiteSpace:
|
|
668
|
+
fontSize: `${ye(k.length)}px`,
|
|
669
|
+
background: L === "correct" ? "#e8f5e8" : L === "almost" ? "#fff3e0" : L === "wrong" ? "#ffebee" : "#fafafa",
|
|
670
|
+
overflowX: I() ? "hidden" : "auto",
|
|
671
|
+
whiteSpace: I() ? "normal" : "nowrap"
|
|
662
672
|
},
|
|
663
|
-
children:
|
|
673
|
+
children: k.map((e, t) => /* @__PURE__ */ a(
|
|
664
674
|
"span",
|
|
665
675
|
{
|
|
666
|
-
draggable: !
|
|
676
|
+
draggable: !d,
|
|
667
677
|
onDragStart: (n) => {
|
|
668
|
-
if (
|
|
678
|
+
if (d) {
|
|
669
679
|
n.preventDefault();
|
|
670
680
|
return;
|
|
671
681
|
}
|
|
@@ -676,36 +686,36 @@ function ln(h = {}) {
|
|
|
676
686
|
},
|
|
677
687
|
onDragOver: (n) => n.preventDefault(),
|
|
678
688
|
onDrop: (n) => {
|
|
679
|
-
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2,
|
|
680
|
-
P({ list: null, index: null, side: null }), n.stopPropagation(),
|
|
689
|
+
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2, w = n.clientX > o ? t + 1 : t;
|
|
690
|
+
P({ list: null, index: null, side: null }), n.stopPropagation(), _(n, "selected", w);
|
|
681
691
|
},
|
|
682
692
|
onDragEnter: (n) => {
|
|
683
|
-
if (
|
|
693
|
+
if (d) return;
|
|
684
694
|
const i = n.currentTarget.getBoundingClientRect(), o = i.left + i.width / 2;
|
|
685
695
|
P({ list: "selected", index: t, side: n.clientX > o ? "right" : "left" });
|
|
686
696
|
},
|
|
687
697
|
onDragLeave: () => P({ list: null, index: null, side: null }),
|
|
688
698
|
onClick: () => {
|
|
689
|
-
|
|
699
|
+
d || K("selected", "bank", e.id, null);
|
|
690
700
|
},
|
|
691
|
-
title:
|
|
701
|
+
title: d ? "Time expired" : "Click to remove back to bank",
|
|
692
702
|
style: {
|
|
693
|
-
padding:
|
|
694
|
-
margin:
|
|
695
|
-
borderRadius:
|
|
696
|
-
background:
|
|
697
|
-
border:
|
|
698
|
-
borderLeft:
|
|
699
|
-
borderRight:
|
|
700
|
-
cursor:
|
|
703
|
+
padding: u() ? "4px 6px" : "6px 10px",
|
|
704
|
+
margin: u() ? "2px" : "4px",
|
|
705
|
+
borderRadius: u() ? "4px" : "8px",
|
|
706
|
+
background: d ? "#f0f0f0" : "#ffe9e7",
|
|
707
|
+
border: d ? "1px solid #ccc" : "1px solid #ec4c44",
|
|
708
|
+
borderLeft: W.list === "selected" && W.index === t && W.side === "left" ? "3px solid #3b82f6" : void 0,
|
|
709
|
+
borderRight: W.list === "selected" && W.index === t && W.side === "right" ? "3px solid #3b82f6" : void 0,
|
|
710
|
+
cursor: d ? "not-allowed" : "pointer",
|
|
701
711
|
userSelect: "none",
|
|
702
|
-
fontSize: `${
|
|
712
|
+
fontSize: `${ye(k.length)}px`,
|
|
703
713
|
// Адаптивный размер шрифта для слов
|
|
704
714
|
fontFamily: '"Roboto", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
|
|
705
715
|
// Более плотный шрифт
|
|
706
716
|
whiteSpace: "nowrap",
|
|
707
717
|
// Запрещаем перенос слов
|
|
708
|
-
opacity:
|
|
718
|
+
opacity: d ? 0.6 : 1,
|
|
709
719
|
transition: "opacity 0.3s ease"
|
|
710
720
|
},
|
|
711
721
|
children: e.text
|
|
@@ -717,65 +727,65 @@ function ln(h = {}) {
|
|
|
717
727
|
/* @__PURE__ */ a(
|
|
718
728
|
"button",
|
|
719
729
|
{
|
|
720
|
-
onClick: () =>
|
|
721
|
-
disabled: !
|
|
730
|
+
onClick: () => $e(!0),
|
|
731
|
+
disabled: !d && k.length === 0,
|
|
722
732
|
style: {
|
|
723
|
-
marginTop:
|
|
724
|
-
fontSize:
|
|
725
|
-
padding:
|
|
726
|
-
borderRadius:
|
|
727
|
-
background:
|
|
733
|
+
marginTop: u() ? "15px" : "30px",
|
|
734
|
+
fontSize: u() ? "14px" : "20px",
|
|
735
|
+
padding: u() ? "6px 12px" : "10px 24px",
|
|
736
|
+
borderRadius: u() ? "8px" : "12px",
|
|
737
|
+
background: d || k.length > 0 ? "#ec4c44" : "#ccc",
|
|
728
738
|
color: "white",
|
|
729
739
|
border: "none",
|
|
730
|
-
cursor:
|
|
740
|
+
cursor: d || k.length > 0 ? "pointer" : "not-allowed"
|
|
731
741
|
},
|
|
732
742
|
children: "NEXT"
|
|
733
743
|
}
|
|
734
744
|
)
|
|
735
|
-
] }),
|
|
745
|
+
] }), Qe = () => /* @__PURE__ */ m("div", { style: p.gmCenterScreen, children: [
|
|
736
746
|
/* @__PURE__ */ a("h1", { style: {
|
|
737
|
-
...
|
|
738
|
-
marginTop: (
|
|
739
|
-
marginBottom:
|
|
740
|
-
fontSize:
|
|
747
|
+
...p.gmHeadline1,
|
|
748
|
+
marginTop: (l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F, "0px"),
|
|
749
|
+
marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F ? "2px" : "10px",
|
|
750
|
+
fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "32px" : "clamp(28px, 4vw, 40px)"
|
|
741
751
|
}, children: "Game Over 🎯" }),
|
|
742
752
|
/* @__PURE__ */ m("h2", { style: {
|
|
743
|
-
...
|
|
744
|
-
marginTop: (
|
|
745
|
-
marginBottom:
|
|
746
|
-
fontSize:
|
|
753
|
+
...p.gmHeadline2,
|
|
754
|
+
marginTop: (l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F, "0px"),
|
|
755
|
+
marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F ? "2px" : "16px",
|
|
756
|
+
fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "18px" : "24px"
|
|
747
757
|
}, children: [
|
|
748
758
|
"Your score: ",
|
|
749
|
-
|
|
759
|
+
Q,
|
|
750
760
|
" out of ",
|
|
751
|
-
|
|
761
|
+
D
|
|
752
762
|
] }),
|
|
753
763
|
/* @__PURE__ */ m("p", { style: {
|
|
754
|
-
...
|
|
764
|
+
...p.gmBodyM,
|
|
755
765
|
color: "#10b981",
|
|
756
|
-
marginTop:
|
|
757
|
-
marginBottom:
|
|
758
|
-
fontSize:
|
|
766
|
+
marginTop: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F ? "0px" : "12px",
|
|
767
|
+
marginBottom: l && window.innerWidth > window.innerHeight || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 || M || A || G || $ || N || j || O || F ? "2px" : "16px",
|
|
768
|
+
fontSize: l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "14px" : "16px"
|
|
759
769
|
}, children: [
|
|
760
770
|
"Best score: ",
|
|
761
771
|
oe
|
|
762
772
|
] }),
|
|
763
773
|
/* @__PURE__ */ m("div", { style: {
|
|
764
774
|
display: "flex",
|
|
765
|
-
gap:
|
|
766
|
-
marginTop:
|
|
775
|
+
gap: l && window.innerWidth > window.innerHeight || l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "6px" : "12px",
|
|
776
|
+
marginTop: l && window.innerWidth > window.innerHeight || l && window.innerWidth <= 375 && window.innerHeight <= 667 || window.innerWidth === 896 && window.innerHeight === 414 || window.innerWidth === 844 && window.innerHeight === 390 || window.innerWidth === 926 && window.innerHeight === 428 || window.innerWidth === 932 && window.innerHeight === 430 ? "2px" : window.innerWidth === 1366 && window.innerHeight === 766 || window.innerWidth === 1366 && window.innerHeight === 768 || window.innerWidth === 1280 && window.innerHeight === 720 || window.innerWidth === 1440 && window.innerHeight === 900 || ke ? "12px" : "24px"
|
|
767
777
|
}, children: [
|
|
768
778
|
/* @__PURE__ */ a(
|
|
769
779
|
"button",
|
|
770
780
|
{
|
|
771
781
|
onClick: () => {
|
|
772
782
|
de(), R("start"), setTimeout(() => {
|
|
773
|
-
|
|
783
|
+
b("getready"), fe(null), Y(!1);
|
|
774
784
|
}, 800);
|
|
775
785
|
},
|
|
776
786
|
style: {
|
|
777
|
-
...
|
|
778
|
-
...
|
|
787
|
+
...p.gmButton,
|
|
788
|
+
...f("medium")
|
|
779
789
|
},
|
|
780
790
|
children: "🔁 Play again"
|
|
781
791
|
}
|
|
@@ -784,21 +794,21 @@ function ln(h = {}) {
|
|
|
784
794
|
"button",
|
|
785
795
|
{
|
|
786
796
|
onClick: () => {
|
|
787
|
-
R("click"),
|
|
797
|
+
R("click"), b("select"), V(null), he(null), U([]), q(0), ie([]), Y(!1);
|
|
788
798
|
},
|
|
789
799
|
style: {
|
|
790
|
-
...
|
|
791
|
-
...
|
|
800
|
+
...p.gmButton,
|
|
801
|
+
...f("medium")
|
|
792
802
|
},
|
|
793
803
|
children: "⬅️ Exit"
|
|
794
804
|
}
|
|
795
805
|
)
|
|
796
806
|
] })
|
|
797
|
-
] }), le = r || (
|
|
807
|
+
] }), le = r || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/magic%20sentence/logo.svg` : null);
|
|
798
808
|
return /* @__PURE__ */ a(
|
|
799
809
|
"div",
|
|
800
810
|
{
|
|
801
|
-
ref:
|
|
811
|
+
ref: ee,
|
|
802
812
|
style: {
|
|
803
813
|
width: "100%",
|
|
804
814
|
height: "100%",
|
|
@@ -818,21 +828,21 @@ function ln(h = {}) {
|
|
|
818
828
|
"div",
|
|
819
829
|
{
|
|
820
830
|
style: {
|
|
821
|
-
width:
|
|
822
|
-
height:
|
|
831
|
+
width: l ? "100%" : xe || 1e3,
|
|
832
|
+
height: l ? "100%" : xe || 1e3,
|
|
823
833
|
display: "flex",
|
|
824
834
|
justifyContent: "center",
|
|
825
835
|
alignItems: "center",
|
|
826
836
|
overflow: "hidden",
|
|
827
|
-
borderRadius:
|
|
837
|
+
borderRadius: l ? 0 : "20px",
|
|
828
838
|
background: "linear-gradient(to bottom, #fff8f8 0%, #f9fafb 100%)",
|
|
829
|
-
boxShadow:
|
|
830
|
-
margin:
|
|
839
|
+
boxShadow: l ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
840
|
+
margin: l ? "0 auto" : "unset",
|
|
831
841
|
position: "relative"
|
|
832
842
|
// needed so absolute logo is inside the square
|
|
833
843
|
},
|
|
834
844
|
children: [
|
|
835
|
-
!
|
|
845
|
+
!l && S ? /* @__PURE__ */ a("div", { style: { ...p.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: le ? /* @__PURE__ */ m("picture", { children: [
|
|
836
846
|
/* @__PURE__ */ a(
|
|
837
847
|
"source",
|
|
838
848
|
{
|
|
@@ -845,11 +855,11 @@ function ln(h = {}) {
|
|
|
845
855
|
{
|
|
846
856
|
src: le.replace(".svg", ".png"),
|
|
847
857
|
alt: "SPEAKID Logo",
|
|
848
|
-
style:
|
|
858
|
+
style: p.gmLogoImg,
|
|
849
859
|
loading: "lazy"
|
|
850
860
|
}
|
|
851
861
|
)
|
|
852
|
-
] }) : /* @__PURE__ */ a("div", { style:
|
|
862
|
+
] }) : /* @__PURE__ */ a("div", { style: p.gmLogoFallback, children: "SPEAKID" }) }) : null,
|
|
853
863
|
/* @__PURE__ */ a(
|
|
854
864
|
"div",
|
|
855
865
|
{
|
|
@@ -862,12 +872,12 @@ function ln(h = {}) {
|
|
|
862
872
|
alignItems: "center"
|
|
863
873
|
},
|
|
864
874
|
children: /* @__PURE__ */ m("div", { id: "magic-sentence-root", children: [
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
875
|
+
y === "select" ? Ne() : null,
|
|
876
|
+
y === "time" ? je() : null,
|
|
877
|
+
y === "type" ? Oe() : null,
|
|
878
|
+
y === "getready" ? Fe() : null,
|
|
879
|
+
y === "play" ? Ze() : null,
|
|
880
|
+
y === "results" ? Qe() : null
|
|
871
881
|
] })
|
|
872
882
|
}
|
|
873
883
|
)
|
|
@@ -877,7 +887,7 @@ function ln(h = {}) {
|
|
|
877
887
|
}
|
|
878
888
|
);
|
|
879
889
|
}
|
|
880
|
-
class
|
|
890
|
+
class ln extends Ue {
|
|
881
891
|
constructor(r) {
|
|
882
892
|
super(r), this.state = { hasError: !1 };
|
|
883
893
|
}
|
|
@@ -887,10 +897,10 @@ class cn extends Ye {
|
|
|
887
897
|
error: r
|
|
888
898
|
};
|
|
889
899
|
}
|
|
890
|
-
componentDidCatch(r,
|
|
891
|
-
console.error("Game Error:", r,
|
|
900
|
+
componentDidCatch(r, S) {
|
|
901
|
+
console.error("Game Error:", r, S), this.setState({
|
|
892
902
|
error: r,
|
|
893
|
-
errorInfo:
|
|
903
|
+
errorInfo: S
|
|
894
904
|
});
|
|
895
905
|
}
|
|
896
906
|
handleReset = () => {
|
|
@@ -948,12 +958,12 @@ class cn extends Ye {
|
|
|
948
958
|
}
|
|
949
959
|
}
|
|
950
960
|
export {
|
|
951
|
-
|
|
952
|
-
|
|
961
|
+
ln as ErrorBoundary,
|
|
962
|
+
dn as Game,
|
|
953
963
|
E as announceToScreenReader,
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
964
|
+
Ke as createAriaLabel,
|
|
965
|
+
dn as default,
|
|
966
|
+
_e as handleKeyDown,
|
|
967
|
+
Ye as useValidation
|
|
958
968
|
};
|
|
959
969
|
//# sourceMappingURL=speakid-build-a-sentence.es.js.map
|