@mblinkov/whats-missing 0.0.9 → 20.0.1
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/.prettierrc +9 -0
- package/dist/whats-missing.es.js +738 -249
- package/dist/whats-missing.umd.js +57 -1
- package/package.json +8 -49
- package/src/Game.styles.ts +205 -0
- package/src/Game.tsx +436 -0
- package/src/index.ts +4 -0
- package/src/themes.ts +91 -72
- package/tsconfig.json +19 -0
- package/vite.config.ts +33 -0
- package/dist/vite.svg +0 -1
- package/dist/whats-missing.css +0 -1
- package/src/Game.module.css +0 -183
- package/src/assets/Animals/bear.jpg +0 -0
- package/src/assets/Animals/cat.png +0 -0
- package/src/assets/Animals/crocodile.jpg +0 -0
- package/src/assets/Animals/dolphin.jpg +0 -0
- package/src/assets/Animals/elephant.jpg +0 -0
- package/src/assets/Animals/fox.jpg +0 -0
- package/src/assets/Animals/giraffe.jpg +0 -0
- package/src/assets/Animals/horse.jpg +0 -0
- package/src/assets/Animals/kangaroo.jpg +0 -0
- package/src/assets/Animals/lion.jpg +0 -0
- package/src/assets/Animals/monkey.jpg +0 -0
- package/src/assets/Animals/owl.jpg +0 -0
- package/src/assets/Animals/panda.jpg +0 -0
- package/src/assets/Animals/penguin.jpg +0 -0
- package/src/assets/Animals/rabbit.jpg +0 -0
- package/src/assets/Animals/squirrel.jpg +0 -0
- package/src/assets/Animals/tiger.png +0 -0
- package/src/assets/Animals/tortoise.jpg +0 -0
- package/src/assets/Animals/wolf.png +0 -0
- package/src/assets/Animals/zebra.jpg +0 -0
- package/src/assets/Food/apple.jpg +0 -0
- package/src/assets/Food/banana.jpg +0 -0
- package/src/assets/Food/bread.jpg +0 -0
- package/src/assets/Food/burger.jpg +0 -0
- package/src/assets/Food/cake.jpg +0 -0
- package/src/assets/Food/carrot.jpg +0 -0
- package/src/assets/Food/cheese.jpg +0 -0
- package/src/assets/Food/chicken.jpg +0 -0
- package/src/assets/Food/chocolate.jpg +0 -0
- package/src/assets/Food/corn.jpg +0 -0
- package/src/assets/Food/donut.jpg +0 -0
- package/src/assets/Food/fish.jpg +0 -0
- package/src/assets/Food/fries.jpg +0 -0
- package/src/assets/Food/grapes.jpg +0 -0
- package/src/assets/Food/ice cream.jpg +0 -0
- package/src/assets/Food/milk.jpg +0 -0
- package/src/assets/Food/orange.jpg +0 -0
- package/src/assets/Food/pear.jpg +0 -0
- package/src/assets/Food/pizza.jpg +0 -0
- package/src/assets/Food/rice.jpg +0 -0
- package/src/assets/Food/sandwich.jpg +0 -0
- package/src/assets/Food/soup.jpg +0 -0
- package/src/assets/Food/strawberry.jpg +0 -0
- package/src/assets/Food/tomato.jpg +0 -0
- package/src/assets/Food/watermelon.jpg +0 -0
- package/src/assets/Toys/ball.jpg +0 -0
- package/src/assets/Toys/balloon.jpg +0 -0
- package/src/assets/Toys/blocks.jpg +0 -0
- package/src/assets/Toys/car.jpg +0 -0
- package/src/assets/Toys/doll.jpg +0 -0
- package/src/assets/Toys/drum.jpg +0 -0
- package/src/assets/Toys/guitar.jpg +0 -0
- package/src/assets/Toys/jump rope.jpg +0 -0
- package/src/assets/Toys/kite.jpg +0 -0
- package/src/assets/Toys/paints.jpg +0 -0
- package/src/assets/Toys/plane.jpg +0 -0
- package/src/assets/Toys/puzzle.jpg +0 -0
- package/src/assets/Toys/rocket.jpg +0 -0
- package/src/assets/Toys/scooter.jpg +0 -0
- package/src/assets/Toys/skateboard.jpg +0 -0
- package/src/assets/Toys/slide.jpg +0 -0
- package/src/assets/Toys/teddy bear.jpg +0 -0
- package/src/assets/Toys/train.jpg +0 -0
- package/src/assets/Toys/yo-yo.jpg +0 -0
- package/src/assets/Toys//321/201rayons.jpg +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/react.svg +0 -1
package/dist/whats-missing.es.js
CHANGED
|
@@ -1,304 +1,793 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
1
|
+
import de, { useEffect as ne, useState as f } from "react";
|
|
2
|
+
var ee = { exports: {} }, D = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var ae;
|
|
13
|
+
function ue() {
|
|
14
|
+
if (ae) return D;
|
|
15
|
+
ae = 1;
|
|
16
|
+
var a = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
|
|
17
|
+
function u(s, i, h) {
|
|
18
|
+
var x = null;
|
|
19
|
+
if (h !== void 0 && (x = "" + h), i.key !== void 0 && (x = "" + i.key), "key" in i) {
|
|
20
|
+
h = {};
|
|
21
|
+
for (var v in i)
|
|
22
|
+
v !== "key" && (h[v] = i[v]);
|
|
23
|
+
} else h = i;
|
|
24
|
+
return i = h.ref, {
|
|
25
|
+
$$typeof: a,
|
|
26
|
+
type: s,
|
|
27
|
+
key: x,
|
|
28
|
+
ref: i !== void 0 ? i : null,
|
|
29
|
+
props: h
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return D.Fragment = p, D.jsx = u, D.jsxs = u, D;
|
|
33
|
+
}
|
|
34
|
+
var G = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var ie;
|
|
45
|
+
function me() {
|
|
46
|
+
return ie || (ie = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function a(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === H ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case E:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case L:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case M:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case A:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case F:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case R:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case V:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case te:
|
|
73
|
+
return e.displayName || "Context";
|
|
74
|
+
case J:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case W:
|
|
77
|
+
var n = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case O:
|
|
80
|
+
return n = e.displayName || null, n !== null ? n : a(e.type) || "Memo";
|
|
81
|
+
case P:
|
|
82
|
+
n = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return a(e(n));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function p(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function u(e) {
|
|
94
|
+
try {
|
|
95
|
+
p(e);
|
|
96
|
+
var n = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
n = !0;
|
|
99
|
+
}
|
|
100
|
+
if (n) {
|
|
101
|
+
n = console;
|
|
102
|
+
var l = n.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return l.call(
|
|
104
|
+
n,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
d
|
|
107
|
+
), p(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function s(e) {
|
|
111
|
+
if (e === E) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === P)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var n = a(e);
|
|
116
|
+
return n ? "<" + n + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function i() {
|
|
122
|
+
var e = _.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function h() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function x(e) {
|
|
129
|
+
if (Y.call(e, "key")) {
|
|
130
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (n && n.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function v(e, n) {
|
|
136
|
+
function l() {
|
|
137
|
+
Z || (Z = !0, console.error(
|
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
+
n
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: l,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function C() {
|
|
148
|
+
var e = a(this.type);
|
|
149
|
+
return I[e] || (I[e] = !0, console.error(
|
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function U(e, n, l, d, z, $) {
|
|
154
|
+
var m = l.ref;
|
|
155
|
+
return e = {
|
|
156
|
+
$$typeof: N,
|
|
157
|
+
type: e,
|
|
158
|
+
key: n,
|
|
159
|
+
props: l,
|
|
160
|
+
_owner: d
|
|
161
|
+
}, (m !== void 0 ? m : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: C
|
|
164
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: z
|
|
179
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: $
|
|
184
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
+
}
|
|
186
|
+
function y(e, n, l, d, z, $) {
|
|
187
|
+
var m = n.children;
|
|
188
|
+
if (m !== void 0)
|
|
189
|
+
if (d)
|
|
190
|
+
if (X(m)) {
|
|
191
|
+
for (d = 0; d < m.length; d++)
|
|
192
|
+
q(m[d]);
|
|
193
|
+
Object.freeze && Object.freeze(m);
|
|
194
|
+
} else
|
|
195
|
+
console.error(
|
|
196
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
+
);
|
|
198
|
+
else q(m);
|
|
199
|
+
if (Y.call(n, "key")) {
|
|
200
|
+
m = a(e);
|
|
201
|
+
var k = Object.keys(n).filter(function(c) {
|
|
202
|
+
return c !== "key";
|
|
203
|
+
});
|
|
204
|
+
d = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", S[m + d] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
+
let props = %s;
|
|
207
|
+
<%s {...props} />
|
|
208
|
+
React keys must be passed directly to JSX without using spread:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s key={someKey} {...props} />`,
|
|
211
|
+
d,
|
|
212
|
+
m,
|
|
213
|
+
k,
|
|
214
|
+
m
|
|
215
|
+
), S[m + d] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (m = null, l !== void 0 && (u(l), m = "" + l), x(n) && (u(n.key), m = "" + n.key), "key" in n) {
|
|
218
|
+
l = {};
|
|
219
|
+
for (var r in n)
|
|
220
|
+
r !== "key" && (l[r] = n[r]);
|
|
221
|
+
} else l = n;
|
|
222
|
+
return m && v(
|
|
223
|
+
l,
|
|
224
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
+
), U(
|
|
226
|
+
e,
|
|
227
|
+
m,
|
|
228
|
+
l,
|
|
229
|
+
i(),
|
|
230
|
+
z,
|
|
231
|
+
$
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function q(e) {
|
|
235
|
+
g(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? g(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
+
}
|
|
237
|
+
function g(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
239
|
+
}
|
|
240
|
+
var T = de, N = Symbol.for("react.transitional.element"), V = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), M = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), te = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), A = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), O = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), R = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), _ = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, X = Array.isArray, j = console.createTask ? console.createTask : function() {
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
T = {
|
|
244
|
+
react_stack_bottom_frame: function(e) {
|
|
245
|
+
return e();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var Z, I = {}, Q = T.react_stack_bottom_frame.bind(
|
|
249
|
+
T,
|
|
250
|
+
h
|
|
251
|
+
)(), B = j(s(h)), S = {};
|
|
252
|
+
G.Fragment = E, G.jsx = function(e, n, l) {
|
|
253
|
+
var d = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return y(
|
|
255
|
+
e,
|
|
256
|
+
n,
|
|
257
|
+
l,
|
|
258
|
+
!1,
|
|
259
|
+
d ? Error("react-stack-top-frame") : Q,
|
|
260
|
+
d ? j(s(e)) : B
|
|
261
|
+
);
|
|
262
|
+
}, G.jsxs = function(e, n, l) {
|
|
263
|
+
var d = 1e4 > _.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return y(
|
|
265
|
+
e,
|
|
266
|
+
n,
|
|
267
|
+
l,
|
|
268
|
+
!0,
|
|
269
|
+
d ? Error("react-stack-top-frame") : Q,
|
|
270
|
+
d ? j(s(e)) : B
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
})()), G;
|
|
274
|
+
}
|
|
275
|
+
var le;
|
|
276
|
+
function fe() {
|
|
277
|
+
return le || (le = 1, process.env.NODE_ENV === "production" ? ee.exports = ue() : ee.exports = me()), ee.exports;
|
|
278
|
+
}
|
|
279
|
+
var t = fe();
|
|
280
|
+
const pe = window.origin + "/cloud/speakid/games/whatsmissing/", oe = (a, p) => a.map(([u, s]) => ({
|
|
281
|
+
src: `${pe}${p}/${s.replace(/\s/g, "%20")}.png`,
|
|
282
|
+
name: s
|
|
283
|
+
})), ge = [
|
|
284
|
+
["apple", "apple"],
|
|
285
|
+
["banana", "banana"],
|
|
286
|
+
["bread", "bread"],
|
|
287
|
+
["burger", "burger"],
|
|
288
|
+
["cake", "cake"],
|
|
289
|
+
["carrot", "carrot"],
|
|
290
|
+
["cheese", "cheese"],
|
|
291
|
+
["chicken", "chicken"],
|
|
292
|
+
["chocolate", "chocolate"],
|
|
293
|
+
["corn", "corn"],
|
|
294
|
+
["donut", "donut"],
|
|
295
|
+
["fish", "fish"],
|
|
296
|
+
["fries", "fries"],
|
|
297
|
+
["grapes", "grapes"],
|
|
298
|
+
["ice_cream", "ice cream"],
|
|
299
|
+
["milk", "milk"],
|
|
300
|
+
["orange", "orange"],
|
|
301
|
+
["pear", "pear"],
|
|
302
|
+
["pizza", "pizza"],
|
|
303
|
+
["rice", "rice"],
|
|
304
|
+
["sandwich", "sandwich"],
|
|
305
|
+
["soup", "soup"],
|
|
306
|
+
["strawberry", "strawberry"],
|
|
307
|
+
["tomato", "tomato"],
|
|
308
|
+
["watermelon", "watermelon"]
|
|
309
|
+
], he = [
|
|
310
|
+
["bear", "bear"],
|
|
311
|
+
["cat", "cat"],
|
|
312
|
+
["crocodile", "crocodile"],
|
|
313
|
+
["dolphin", "dolphin"],
|
|
314
|
+
["elephant", "elephant"],
|
|
315
|
+
["fox", "fox"],
|
|
316
|
+
["giraffe", "giraffe"],
|
|
317
|
+
["horse", "horse"],
|
|
318
|
+
["kangaroo", "kangaroo"],
|
|
319
|
+
["lion", "lion"],
|
|
320
|
+
["monkey", "monkey"],
|
|
321
|
+
["owl", "owl"],
|
|
322
|
+
["panda", "panda"],
|
|
323
|
+
["penguin", "penguin"],
|
|
324
|
+
["squirrel", "squirrel"],
|
|
325
|
+
["tiger", "tiger"],
|
|
326
|
+
["tortoise", "tortoise"],
|
|
327
|
+
["wolf", "wolf"],
|
|
328
|
+
["zebra", "zebra"]
|
|
329
|
+
], xe = [
|
|
330
|
+
["ball", "ball"],
|
|
331
|
+
["balloon", "balloon"],
|
|
332
|
+
["blocks", "blocks"],
|
|
333
|
+
["car", "car"],
|
|
334
|
+
["doll", "doll"],
|
|
335
|
+
["drum", "drum"],
|
|
336
|
+
["guitar", "guitar"],
|
|
337
|
+
["jump_rope", "jump rope"],
|
|
338
|
+
["kite", "kite"],
|
|
339
|
+
["paints", "paints"],
|
|
340
|
+
["plane", "plane"],
|
|
341
|
+
["puzzle", "puzzle"],
|
|
342
|
+
["rocket", "rocket"],
|
|
343
|
+
["scooter", "scooter"],
|
|
344
|
+
["skateboard", "skateboard"],
|
|
345
|
+
["slide", "slide"],
|
|
346
|
+
["teddy_bear", "teddy bear"],
|
|
347
|
+
["yo-yo", "yo-yo"],
|
|
348
|
+
["crayons", "crayons"]
|
|
349
|
+
], ce = {
|
|
350
|
+
food: oe(ge, "food"),
|
|
351
|
+
animals: oe(he, "animals"),
|
|
352
|
+
toys: oe(xe, "toys")
|
|
353
|
+
}, be = `
|
|
354
|
+
@keyframes spin {
|
|
355
|
+
from { transform: rotate(0deg); }
|
|
356
|
+
to { transform: rotate(360deg); }
|
|
357
|
+
}
|
|
358
|
+
`;
|
|
359
|
+
if (typeof document < "u" && !document.getElementById("spin-keyframes")) {
|
|
360
|
+
const a = document.createElement("style");
|
|
361
|
+
a.id = "spin-keyframes", a.innerHTML = be, document.head.appendChild(a);
|
|
362
|
+
}
|
|
363
|
+
const ye = {
|
|
364
|
+
animation: "spin 1.4s linear infinite"
|
|
365
|
+
}, o = {
|
|
366
|
+
gmCenterScreen: {
|
|
367
|
+
position: "relative",
|
|
368
|
+
zIndex: 1,
|
|
369
|
+
minHeight: "100vh",
|
|
370
|
+
width: "100%",
|
|
371
|
+
display: "flex",
|
|
372
|
+
flexDirection: "column",
|
|
373
|
+
justifyContent: "center",
|
|
374
|
+
alignItems: "center",
|
|
375
|
+
textAlign: "center",
|
|
376
|
+
color: "#1f2937",
|
|
377
|
+
padding: "24px 16px",
|
|
378
|
+
boxSizing: "border-box",
|
|
379
|
+
transform: "translateY(20px)"
|
|
380
|
+
// чуть вниз, чтобы компенсировать логотип
|
|
381
|
+
},
|
|
382
|
+
gmHeadline1: {
|
|
383
|
+
fontWeight: 700,
|
|
384
|
+
fontSize: "clamp(28px, 4vw, 40px)",
|
|
385
|
+
lineHeight: "110%"
|
|
386
|
+
},
|
|
387
|
+
gmHeadline3: {
|
|
388
|
+
fontWeight: 600,
|
|
389
|
+
fontSize: "18px",
|
|
390
|
+
lineHeight: "130%"
|
|
391
|
+
},
|
|
392
|
+
gmBodyM: {
|
|
393
|
+
fontWeight: 400,
|
|
394
|
+
fontSize: "16px",
|
|
395
|
+
lineHeight: "140%"
|
|
396
|
+
},
|
|
397
|
+
gmBodyS: {
|
|
398
|
+
fontWeight: 400,
|
|
399
|
+
fontSize: "14px",
|
|
400
|
+
lineHeight: "140%",
|
|
401
|
+
color: "#6b7280"
|
|
402
|
+
},
|
|
403
|
+
gmButton: {
|
|
404
|
+
fontFamily: '"Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans"',
|
|
405
|
+
fontWeight: 600,
|
|
406
|
+
fontSize: "16px",
|
|
407
|
+
padding: "10px 16px",
|
|
408
|
+
borderRadius: "12px",
|
|
409
|
+
border: "1px solid #e5e7eb",
|
|
410
|
+
background: "#ec4c44",
|
|
411
|
+
color: "#ffffff",
|
|
412
|
+
cursor: "pointer",
|
|
413
|
+
boxShadow: "0 6px 18px rgba(236, 76, 68, .18)",
|
|
414
|
+
transition: "transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease"
|
|
415
|
+
},
|
|
416
|
+
gmButtonActive: {
|
|
417
|
+
background: "#333",
|
|
418
|
+
color: "#fff"
|
|
419
|
+
},
|
|
420
|
+
gmGameLayout: {
|
|
421
|
+
position: "relative",
|
|
422
|
+
width: "100%",
|
|
423
|
+
maxWidth: "600px",
|
|
424
|
+
// ограничение ширины для мобильных
|
|
425
|
+
minHeight: "100vh",
|
|
426
|
+
display: "flex",
|
|
427
|
+
flexDirection: "column",
|
|
428
|
+
alignItems: "center",
|
|
429
|
+
justifyContent: "center",
|
|
430
|
+
textAlign: "center",
|
|
431
|
+
color: "#1f2937",
|
|
432
|
+
padding: "16px 8px",
|
|
433
|
+
margin: "0 auto"
|
|
434
|
+
},
|
|
435
|
+
gmGrid: {
|
|
436
|
+
width: "100%",
|
|
437
|
+
maxWidth: "calc(210px * 3 + 20px * 2)",
|
|
438
|
+
margin: "0 auto",
|
|
439
|
+
display: "grid",
|
|
440
|
+
gridTemplateColumns: "repeat(3, 210px)",
|
|
441
|
+
gridAutoRows: "210px",
|
|
442
|
+
gap: "20px",
|
|
443
|
+
justifyContent: "center"
|
|
444
|
+
},
|
|
445
|
+
gmCard: {
|
|
446
|
+
border: "1px solid #e5e7eb",
|
|
447
|
+
borderRadius: "16px",
|
|
448
|
+
background: "#f9f9f9",
|
|
449
|
+
aspectRatio: "1 / 1",
|
|
450
|
+
display: "flex",
|
|
451
|
+
alignItems: "center",
|
|
452
|
+
justifyContent: "center",
|
|
453
|
+
overflow: "hidden",
|
|
454
|
+
transition: "transform .2s ease, box-shadow .2s ease, border-color .2s ease"
|
|
455
|
+
},
|
|
456
|
+
gmCorrect: {
|
|
457
|
+
border: "2px solid #10b981",
|
|
458
|
+
boxShadow: "0 0 18px rgba(16,185,129,.45)",
|
|
459
|
+
background: "#ecfdf5"
|
|
460
|
+
},
|
|
461
|
+
gmWrong: {
|
|
462
|
+
border: "2px solid #ec4c44",
|
|
463
|
+
boxShadow: "0 0 18px rgba(236,76,68,.35)",
|
|
464
|
+
background: "#fef2f2"
|
|
465
|
+
},
|
|
466
|
+
gmInput: {
|
|
467
|
+
padding: "6px 10px",
|
|
468
|
+
borderRadius: "6px",
|
|
469
|
+
border: "1px solid #ccc",
|
|
470
|
+
fontSize: "16px",
|
|
471
|
+
fontFamily: '"Geist", system-ui',
|
|
472
|
+
width: "160px"
|
|
473
|
+
},
|
|
474
|
+
gmTable: {
|
|
475
|
+
marginTop: "20px",
|
|
476
|
+
marginBottom: "32px",
|
|
477
|
+
borderCollapse: "collapse",
|
|
478
|
+
width: "100%",
|
|
479
|
+
maxWidth: "520px",
|
|
480
|
+
tableLayout: "fixed",
|
|
481
|
+
textAlign: "center"
|
|
482
|
+
},
|
|
483
|
+
gmTableCell: {
|
|
484
|
+
padding: "8px 12px",
|
|
485
|
+
borderBottom: "1px solid #e5e7eb",
|
|
486
|
+
whiteSpace: "nowrap",
|
|
487
|
+
overflow: "hidden",
|
|
488
|
+
textOverflow: "ellipsis"
|
|
489
|
+
},
|
|
490
|
+
gmLogoFixed: {
|
|
491
|
+
position: "sticky",
|
|
492
|
+
top: "16px",
|
|
493
|
+
left: "20px",
|
|
494
|
+
zIndex: 9999,
|
|
495
|
+
background: "white",
|
|
496
|
+
padding: "4px 8px",
|
|
497
|
+
borderRadius: "8px"
|
|
498
|
+
},
|
|
499
|
+
gmLogoImg: {
|
|
500
|
+
height: "clamp(28px, 5vw, 40px)",
|
|
501
|
+
width: "auto"
|
|
502
|
+
},
|
|
503
|
+
gmHourglass: {
|
|
504
|
+
fontSize: "42px",
|
|
505
|
+
...ye
|
|
506
|
+
}
|
|
507
|
+
}, we = window.origin + "/cloud/speakid/games/whatsmissing/logo.png", Te = () => {
|
|
508
|
+
const a = document.createElement("style");
|
|
509
|
+
a.textContent = `
|
|
510
|
+
html, body, #root {
|
|
511
|
+
margin: 0;
|
|
512
|
+
padding: 0;
|
|
513
|
+
height: 100%;
|
|
514
|
+
}
|
|
515
|
+
*, *::before, *::after {
|
|
516
|
+
box-sizing: border-box;
|
|
517
|
+
}
|
|
518
|
+
body {
|
|
519
|
+
font-family: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
|
|
520
|
+
background-color: #fff;
|
|
521
|
+
color: #1f2937;
|
|
522
|
+
}
|
|
523
|
+
button, input {
|
|
524
|
+
font-family: inherit;
|
|
525
|
+
outline: none;
|
|
526
|
+
border: none;
|
|
527
|
+
background: none;
|
|
528
|
+
}
|
|
529
|
+
img {
|
|
530
|
+
max-width: 100%;
|
|
531
|
+
height: auto;
|
|
532
|
+
display: block;
|
|
533
|
+
user-select: none;
|
|
534
|
+
}
|
|
535
|
+
@keyframes spin {
|
|
536
|
+
from { transform: rotate(0deg); }
|
|
537
|
+
to { transform: rotate(360deg); }
|
|
538
|
+
}
|
|
539
|
+
`, document.head.appendChild(a);
|
|
540
|
+
}, je = (a, p) => {
|
|
541
|
+
const u = Array.from({ length: a.length + 1 }, () => Array(p.length + 1).fill(0));
|
|
542
|
+
for (let s = 0; s <= a.length; s++) u[s][0] = s;
|
|
543
|
+
for (let s = 0; s <= p.length; s++) u[0][s] = s;
|
|
544
|
+
for (let s = 1; s <= a.length; s++)
|
|
545
|
+
for (let i = 1; i <= p.length; i++)
|
|
546
|
+
u[s][i] = a[s - 1] === p[i - 1] ? u[s - 1][i - 1] : Math.min(u[s - 1][i - 1], u[s][i - 1], u[s - 1][i]) + 1;
|
|
547
|
+
return u[a.length][p.length];
|
|
111
548
|
};
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
), [Z, S] = n([]), [q, G] = n([]), [$, ss] = n(!1);
|
|
116
|
-
X(() => {
|
|
117
|
-
const s = () => ss(window.innerWidth < 768);
|
|
118
|
-
return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
|
549
|
+
function Re() {
|
|
550
|
+
ne(() => {
|
|
551
|
+
Te();
|
|
119
552
|
}, []);
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
r(
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
553
|
+
const [a, p] = f(null), [u, s] = f([]), [i, h] = f(4), [x, v] = f(!1), [C, U] = f(1), [y, q] = f(null), [g, T] = f("ready"), [N, V] = f(3), [E, M] = f(7), [L, J] = f(20), [te, W] = f(0), [A, F] = f(!1), [O, P] = f(""), [R, H] = f(!1), [_, Y] = f(!1), [X, j] = f(null), [Z, I] = f([]), [Q, B] = f([]), [S, e] = f(!1);
|
|
554
|
+
ne(() => {
|
|
555
|
+
const r = () => e(window.innerWidth < 768);
|
|
556
|
+
return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
557
|
+
}, []);
|
|
558
|
+
const n = (r) => [...r].sort(() => Math.random() - 0.5).slice(0, 6), l = () => {
|
|
559
|
+
if (!a) return;
|
|
560
|
+
const r = n(ce[a]);
|
|
561
|
+
s(r), v(!0), F(!1), U(1), W(0), I([]), B([]), d(r, [], !0);
|
|
562
|
+
}, d = (r = u, c = Q, w = !1) => {
|
|
563
|
+
const b = n(r.length ? r : ce[a]);
|
|
564
|
+
let K = Math.floor(Math.random() * b.length), re = b[K].name, se = 0;
|
|
565
|
+
for (; c.includes(re) && se < 20; )
|
|
566
|
+
K = Math.floor(Math.random() * b.length), re = b[K].name, se++;
|
|
567
|
+
s(b), q(K), B([...c, re]), H(!1), P(""), J(20), j(null), w ? (T("ready"), V(3), M(7)) : (T("memorize"), M(7));
|
|
130
568
|
};
|
|
131
|
-
|
|
132
|
-
if (!(!
|
|
133
|
-
if (
|
|
134
|
-
if (
|
|
135
|
-
|
|
569
|
+
ne(() => {
|
|
570
|
+
if (!(!x || A || R)) {
|
|
571
|
+
if (g === "ready")
|
|
572
|
+
if (N <= 0)
|
|
573
|
+
T("memorize");
|
|
136
574
|
else {
|
|
137
|
-
const
|
|
138
|
-
return () => clearTimeout(
|
|
575
|
+
const r = setTimeout(() => V((c) => c - 1), 1e3);
|
|
576
|
+
return () => clearTimeout(r);
|
|
139
577
|
}
|
|
140
|
-
if (
|
|
141
|
-
if (
|
|
142
|
-
|
|
578
|
+
if (g === "memorize")
|
|
579
|
+
if (E <= 0)
|
|
580
|
+
T("guess");
|
|
143
581
|
else {
|
|
144
|
-
const
|
|
145
|
-
return () => clearTimeout(
|
|
582
|
+
const r = setTimeout(() => M((c) => c - 1), 1e3);
|
|
583
|
+
return () => clearTimeout(r);
|
|
146
584
|
}
|
|
147
|
-
if (
|
|
148
|
-
if (
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
...
|
|
153
|
-
{ round:
|
|
585
|
+
if (g === "guess") {
|
|
586
|
+
if (L <= 0) {
|
|
587
|
+
H(!0), j("wrong");
|
|
588
|
+
const c = u[y].name;
|
|
589
|
+
I((w) => [
|
|
590
|
+
...w,
|
|
591
|
+
{ round: C, answer: O, correct: c, result: "wrong" }
|
|
154
592
|
]);
|
|
155
593
|
return;
|
|
156
594
|
}
|
|
157
|
-
const
|
|
158
|
-
return () => clearTimeout(
|
|
595
|
+
const r = setTimeout(() => J((c) => c - 1), 1e3);
|
|
596
|
+
return () => clearTimeout(r);
|
|
159
597
|
}
|
|
160
598
|
}
|
|
161
599
|
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
600
|
+
g,
|
|
601
|
+
N,
|
|
602
|
+
E,
|
|
603
|
+
L,
|
|
604
|
+
x,
|
|
605
|
+
A,
|
|
606
|
+
R,
|
|
166
607
|
u,
|
|
608
|
+
y,
|
|
167
609
|
C,
|
|
168
|
-
|
|
169
|
-
g,
|
|
170
|
-
h,
|
|
171
|
-
p,
|
|
172
|
-
f
|
|
610
|
+
O
|
|
173
611
|
]);
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
let
|
|
178
|
-
|
|
179
|
-
...
|
|
180
|
-
{ round:
|
|
181
|
-
]),
|
|
182
|
-
|
|
612
|
+
const z = () => {
|
|
613
|
+
if (y === null || _) return;
|
|
614
|
+
const r = u[y].name, c = O.toLowerCase().trim();
|
|
615
|
+
let w = "wrong";
|
|
616
|
+
c === r ? (W((b) => b + 1), j("correct"), w = "correct") : je(c, r) === 1 ? (W((b) => b + 0.5), j("almost"), w = "almost") : (j("wrong"), w = "wrong"), I((b) => [
|
|
617
|
+
...b,
|
|
618
|
+
{ round: C, answer: c, correct: r, result: w }
|
|
619
|
+
]), Y(!0), setTimeout(() => {
|
|
620
|
+
Y(!1), H(!0);
|
|
183
621
|
}, 600);
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
/* @__PURE__ */
|
|
194
|
-
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */ e("button", { className: t.gmButton, onClick: () => l("food"), children: "🍎 Food" }),
|
|
197
|
-
/* @__PURE__ */ e("button", { className: t.gmButton, onClick: () => l("toys"), children: "🧸 Toys" })
|
|
198
|
-
] }),
|
|
199
|
-
/* @__PURE__ */ a("div", { style: { marginTop: 24 }, children: [
|
|
200
|
-
/* @__PURE__ */ e("p", { className: t.gmBodyS, children: "Choose number of rounds:" }),
|
|
201
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", gap: 12, marginTop: 8 }, children: [3, 4, 5].map((s) => /* @__PURE__ */ e(
|
|
622
|
+
}, $ = () => C < i ? (U((r) => r + 1), d()) : F(!0), m = () => {
|
|
623
|
+
v(!1), F(!1), p(null);
|
|
624
|
+
}, k = () => /* @__PURE__ */ t.jsx("div", { style: o.gmLogoFixed, children: /* @__PURE__ */ t.jsx("img", { src: we, alt: "SPEAKID Logo", style: o.gmLogoImg }) });
|
|
625
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
626
|
+
!S && /* @__PURE__ */ t.jsx(k, {}),
|
|
627
|
+
!a && !x && /* @__PURE__ */ t.jsxs("div", { style: o.gmCenterScreen, children: [
|
|
628
|
+
/* @__PURE__ */ t.jsx("h1", { style: o.gmHeadline1, children: "WHAT'S MISSING?" }),
|
|
629
|
+
/* @__PURE__ */ t.jsx("p", { style: o.gmBodyM, children: "Select a theme:" }),
|
|
630
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 16 }, children: ["animals", "food", "toys"].map((r) => /* @__PURE__ */ t.jsx("button", { style: o.gmButton, onClick: () => p(r), children: r === "animals" ? "🐶 Animals" : r === "food" ? "🍎 Food" : "🧸 Toys" }, r)) }),
|
|
631
|
+
/* @__PURE__ */ t.jsxs("div", { style: { marginTop: 24 }, children: [
|
|
632
|
+
/* @__PURE__ */ t.jsx("p", { style: o.gmBodyS, children: "Choose number of rounds:" }),
|
|
633
|
+
/* @__PURE__ */ t.jsx("div", { style: { display: "flex", gap: 12, marginTop: 8 }, children: [3, 4, 5].map((r) => /* @__PURE__ */ t.jsx(
|
|
202
634
|
"button",
|
|
203
635
|
{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
636
|
+
style: {
|
|
637
|
+
...o.gmButton,
|
|
638
|
+
...i === r ? o.gmButtonActive : {}
|
|
639
|
+
},
|
|
640
|
+
onClick: () => h(r),
|
|
641
|
+
children: r
|
|
207
642
|
},
|
|
208
|
-
|
|
643
|
+
r
|
|
209
644
|
)) })
|
|
210
645
|
] })
|
|
211
646
|
] }),
|
|
212
|
-
|
|
213
|
-
/* @__PURE__ */
|
|
647
|
+
a && !x && /* @__PURE__ */ t.jsxs("div", { style: o.gmCenterScreen, children: [
|
|
648
|
+
/* @__PURE__ */ t.jsxs("h1", { style: o.gmHeadline1, children: [
|
|
214
649
|
"Theme selected: ",
|
|
215
|
-
|
|
650
|
+
a
|
|
651
|
+
] }),
|
|
652
|
+
/* @__PURE__ */ t.jsxs("p", { style: o.gmBodyM, children: [
|
|
653
|
+
"Rounds: ",
|
|
654
|
+
i
|
|
216
655
|
] }),
|
|
217
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ t.jsx("button", { style: o.gmButton, onClick: l, children: "▶ Start game" })
|
|
218
657
|
] }),
|
|
219
|
-
|
|
220
|
-
/* @__PURE__ */
|
|
221
|
-
/* @__PURE__ */
|
|
658
|
+
A && /* @__PURE__ */ t.jsxs("div", { style: o.gmCenterScreen, children: [
|
|
659
|
+
/* @__PURE__ */ t.jsx("h1", { style: o.gmHeadline1, children: "Results" }),
|
|
660
|
+
/* @__PURE__ */ t.jsxs("h2", { style: o.gmHeadline3, children: [
|
|
222
661
|
"Your score: ",
|
|
223
|
-
|
|
662
|
+
te,
|
|
224
663
|
" / ",
|
|
225
664
|
i
|
|
226
665
|
] }),
|
|
227
|
-
/* @__PURE__ */
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
/* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ t.jsxs("table", { style: o.gmTable, children: [
|
|
667
|
+
/* @__PURE__ */ t.jsx("thead", { children: /* @__PURE__ */ t.jsxs("tr", { children: [
|
|
668
|
+
/* @__PURE__ */ t.jsx("th", { children: "Round" }),
|
|
669
|
+
/* @__PURE__ */ t.jsx("th", { children: "Your Answer" }),
|
|
670
|
+
/* @__PURE__ */ t.jsx("th", { children: "Correct" }),
|
|
671
|
+
/* @__PURE__ */ t.jsx("th", { children: "Result" })
|
|
233
672
|
] }) }),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
] },
|
|
673
|
+
/* @__PURE__ */ t.jsx("tbody", { children: Z.map((r, c) => /* @__PURE__ */ t.jsxs("tr", { children: [
|
|
674
|
+
/* @__PURE__ */ t.jsx("td", { style: o.gmTableCell, children: r.round }),
|
|
675
|
+
/* @__PURE__ */ t.jsx("td", { style: o.gmTableCell, children: r.answer || "—" }),
|
|
676
|
+
/* @__PURE__ */ t.jsx("td", { style: o.gmTableCell, children: r.correct }),
|
|
677
|
+
/* @__PURE__ */ t.jsx("td", { style: o.gmTableCell, children: r.result === "correct" ? "✔ Correct" : r.result === "almost" ? "◐ Almost (0.5)" : "✘ Wrong" })
|
|
678
|
+
] }, c)) })
|
|
240
679
|
] }),
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
243
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12, marginTop: 24 }, children: [
|
|
681
|
+
/* @__PURE__ */ t.jsx("button", { style: o.gmButton, onClick: l, children: "🔁 Play again" }),
|
|
682
|
+
/* @__PURE__ */ t.jsx("button", { style: o.gmButton, onClick: m, children: "⬅️ Choose theme" })
|
|
244
683
|
] })
|
|
245
684
|
] }),
|
|
246
|
-
|
|
247
|
-
/* @__PURE__ */
|
|
685
|
+
x && !A && /* @__PURE__ */ t.jsxs("div", { style: o.gmGameLayout, children: [
|
|
686
|
+
/* @__PURE__ */ t.jsxs(
|
|
248
687
|
"div",
|
|
249
688
|
{
|
|
250
|
-
|
|
251
|
-
|
|
689
|
+
style: {
|
|
690
|
+
minHeight: 160,
|
|
691
|
+
display: "flex",
|
|
692
|
+
flexDirection: "column",
|
|
693
|
+
justifyContent: "center",
|
|
694
|
+
alignItems: "center"
|
|
695
|
+
},
|
|
696
|
+
children: [
|
|
697
|
+
g === "ready" && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
698
|
+
/* @__PURE__ */ t.jsx("h1", { style: { ...o.gmHeadline1, color: "#ec4c44" }, children: "GET READY" }),
|
|
699
|
+
/* @__PURE__ */ t.jsx("div", { style: o.gmHourglass, children: "⏳" })
|
|
700
|
+
] }),
|
|
701
|
+
g === "memorize" && /* @__PURE__ */ t.jsxs("p", { style: { ...o.gmBodyM, color: "#10b981" }, children: [
|
|
702
|
+
"MEMORIZE (",
|
|
703
|
+
E,
|
|
704
|
+
")"
|
|
705
|
+
] }),
|
|
706
|
+
g === "guess" && !R && /* @__PURE__ */ t.jsxs("p", { style: o.gmBodyM, children: [
|
|
707
|
+
"⏳ Time left: ",
|
|
708
|
+
L,
|
|
709
|
+
"s"
|
|
710
|
+
] })
|
|
711
|
+
]
|
|
252
712
|
}
|
|
253
|
-
)
|
|
254
|
-
/* @__PURE__ */
|
|
255
|
-
"
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
713
|
+
),
|
|
714
|
+
g !== "ready" && /* @__PURE__ */ t.jsx(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
style: {
|
|
718
|
+
...o.gmGrid,
|
|
719
|
+
gridTemplateColumns: S ? "repeat(2, 1fr)" : "repeat(3, 210px)",
|
|
720
|
+
gridAutoRows: S ? "150px" : "210px",
|
|
721
|
+
gap: S ? "12px" : "20px",
|
|
722
|
+
justifyItems: "center",
|
|
723
|
+
// 🔹 увеличение только при >2000px
|
|
724
|
+
...window.innerWidth > 2e3 ? {
|
|
725
|
+
gridTemplateColumns: "repeat(3, 260px)",
|
|
726
|
+
gridAutoRows: "260px",
|
|
727
|
+
gap: "28px"
|
|
728
|
+
} : {},
|
|
729
|
+
...window.innerWidth > 2560 ? {
|
|
730
|
+
gridTemplateColumns: "repeat(3, 300px)",
|
|
731
|
+
gridAutoRows: "300px",
|
|
732
|
+
gap: "32px"
|
|
733
|
+
} : {}
|
|
269
734
|
},
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
735
|
+
children: u.map((r, c) => {
|
|
736
|
+
const w = y === c && g === "guess" && !R;
|
|
737
|
+
return /* @__PURE__ */ t.jsx(
|
|
738
|
+
"div",
|
|
739
|
+
{
|
|
740
|
+
style: {
|
|
741
|
+
...o.gmCard,
|
|
742
|
+
...X === "correct" && y === c ? o.gmCorrect : {},
|
|
743
|
+
...X === "wrong" && y === c ? o.gmWrong : {}
|
|
744
|
+
},
|
|
745
|
+
children: !w && /* @__PURE__ */ t.jsx(
|
|
746
|
+
"img",
|
|
747
|
+
{
|
|
748
|
+
src: r.src,
|
|
749
|
+
alt: r.name,
|
|
750
|
+
style: {
|
|
751
|
+
width: "100%",
|
|
752
|
+
height: "100%",
|
|
753
|
+
objectFit: "cover"
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
},
|
|
758
|
+
c
|
|
759
|
+
);
|
|
760
|
+
})
|
|
761
|
+
}
|
|
762
|
+
),
|
|
763
|
+
/* @__PURE__ */ t.jsxs("div", { style: { marginTop: 16, height: 80 }, children: [
|
|
764
|
+
g === "guess" && !R && /* @__PURE__ */ t.jsxs("div", { children: [
|
|
765
|
+
/* @__PURE__ */ t.jsx(
|
|
276
766
|
"input",
|
|
277
767
|
{
|
|
278
768
|
type: "text",
|
|
279
769
|
placeholder: "Type the missing word",
|
|
280
|
-
value:
|
|
281
|
-
onChange: (
|
|
282
|
-
|
|
770
|
+
value: O,
|
|
771
|
+
onChange: (r) => P(r.target.value),
|
|
772
|
+
style: o.gmInput
|
|
283
773
|
}
|
|
284
774
|
),
|
|
285
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ t.jsx(
|
|
286
776
|
"button",
|
|
287
777
|
{
|
|
288
|
-
|
|
289
|
-
onClick:
|
|
290
|
-
disabled:
|
|
291
|
-
|
|
292
|
-
children: R ? "..." : "Check"
|
|
778
|
+
style: { ...o.gmButton, marginLeft: 8 },
|
|
779
|
+
onClick: z,
|
|
780
|
+
disabled: _,
|
|
781
|
+
children: _ ? "..." : "Check"
|
|
293
782
|
}
|
|
294
783
|
)
|
|
295
784
|
] }),
|
|
296
|
-
|
|
785
|
+
R && /* @__PURE__ */ t.jsx("button", { style: o.gmButton, onClick: $, children: "Next round" })
|
|
297
786
|
] })
|
|
298
787
|
] })
|
|
299
788
|
] });
|
|
300
789
|
}
|
|
301
790
|
export {
|
|
302
|
-
|
|
303
|
-
|
|
791
|
+
Re as Game,
|
|
792
|
+
ce as themes
|
|
304
793
|
};
|