@mblinkov/whats-missing 0.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/README.md +69 -0
- package/dist/vite.svg +1 -0
- package/dist/whats-missing.css +1 -0
- package/dist/whats-missing.es.js +644 -0
- package/dist/whats-missing.umd.js +22 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## Expanding the ESLint configuration
|
|
11
|
+
|
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
export default tseslint.config([
|
|
16
|
+
globalIgnores(['dist']),
|
|
17
|
+
{
|
|
18
|
+
files: ['**/*.{ts,tsx}'],
|
|
19
|
+
extends: [
|
|
20
|
+
// Other configs...
|
|
21
|
+
|
|
22
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
23
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
24
|
+
// Alternatively, use this for stricter rules
|
|
25
|
+
...tseslint.configs.strictTypeChecked,
|
|
26
|
+
// Optionally, add this for stylistic rules
|
|
27
|
+
...tseslint.configs.stylisticTypeChecked,
|
|
28
|
+
|
|
29
|
+
// Other configs...
|
|
30
|
+
],
|
|
31
|
+
languageOptions: {
|
|
32
|
+
parserOptions: {
|
|
33
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
34
|
+
tsconfigRootDir: import.meta.dirname,
|
|
35
|
+
},
|
|
36
|
+
// other options...
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
])
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
// eslint.config.js
|
|
46
|
+
import reactX from 'eslint-plugin-react-x'
|
|
47
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
48
|
+
|
|
49
|
+
export default tseslint.config([
|
|
50
|
+
globalIgnores(['dist']),
|
|
51
|
+
{
|
|
52
|
+
files: ['**/*.{ts,tsx}'],
|
|
53
|
+
extends: [
|
|
54
|
+
// Other configs...
|
|
55
|
+
// Enable lint rules for React
|
|
56
|
+
reactX.configs['recommended-typescript'],
|
|
57
|
+
// Enable lint rules for React DOM
|
|
58
|
+
reactDom.configs.recommended,
|
|
59
|
+
],
|
|
60
|
+
languageOptions: {
|
|
61
|
+
parserOptions: {
|
|
62
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
63
|
+
tsconfigRootDir: import.meta.dirname,
|
|
64
|
+
},
|
|
65
|
+
// other options...
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
])
|
|
69
|
+
```
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import"https://cdn.jsdelivr.net/npm/@geist-ui/fonts@latest/index.css";:root{--font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";--text: #1f2937;--muted: #6b7280;--bg: #ffffff;--card: #f9f9f9;--border: #e5e7eb;--accent: #ec4c44;--accent-contrast: #ffffff;--progress: #10b981;--success: #10b981;--error: #ec4c44;--card-size: 210px;--gap: 20px}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;font-family:var(--font-sans);color:var(--text);background:radial-gradient(1200px 700px at 50% 8%,#fdf2f1,#fdf2f1d9 30%,#eff6ffa6 70%) fixed,#fff}.headline1{font-weight:700;font-size:clamp(28px,4.2vw,40px);line-height:110%}.headline2{font-weight:600;font-size:24px;line-height:110%}.headline3{font-weight:600;font-size:18px;line-height:120%}.bodyL{font-weight:400;font-size:18px;line-height:140%}.bodyM{font-weight:400;font-size:16px;line-height:140%}.bodyS{font-weight:400;font-size:14px;line-height:140%;color:var(--muted)}.captionSB{font-weight:600;font-size:12px;line-height:120%;color:var(--muted)}.button{font:600 16px/100% var(--font-sans);padding:10px 16px;border-radius:12px;border:1px solid var(--border);background:var(--accent);color:var(--accent-contrast);cursor:pointer;box-shadow:0 6px 18px #ec4c442e;transition:transform .06s ease,box-shadow .2s ease,background .2s ease,opacity .2s ease}.button:hover{transform:translateY(-1px);box-shadow:0 10px 24px #ec4c4438}.button:active{transform:translateY(0);box-shadow:0 4px 12px #ec4c442e}.button[disabled]{opacity:.7;cursor:default}.button--ghost{background:#f9f9f9;color:#111827;box-shadow:none}.logo-fixed{position:fixed;top:16px;left:20px;z-index:1000}.logo-fixed img{height:clamp(28px,5vw,40px);width:auto}.centerScreen,.gameLayout{position:relative;z-index:1;height:100vh;padding:16px 12px;display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.progressContainer{width:min(80%,900px);height:10px;background:#eee;border-radius:999px;overflow:hidden;margin-bottom:16px}.progressBar{height:100%;background:var(--progress);transition:width .3s ease}.grid{width:100%;max-width:calc(var(--card-size)*3 + var(--gap)*2);margin:0 auto;display:grid;grid-template-columns:repeat(3,var(--card-size));grid-auto-rows:var(--card-size);gap:var(--gap)}.card{border:1px solid var(--border);border-radius:16px;background:var(--card);aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.card img{width:100%;height:100%;object-fit:cover}@keyframes hop{0%{transform:translateY(0)}30%{transform:translateY(-18px)}60%{transform:translateY(-6px)}to{transform:translateY(0)}}.hop{animation:hop .6s ease}.card.correct{border:2px solid var(--success);box-shadow:0 0 18px #10b98173;background:#ecfdf5}.card.wrong{border:2px solid var(--error);box-shadow:0 0 18px #ec4c4459;background:#fef2f2}.phase-wrapper{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(var(--card-size)*2 + var(--gap) + 120px)}.phase-title{font-size:42px;font-weight:700;margin-bottom:16px}.phase-title.red{color:var(--accent)}.phase-title.green{color:var(--success)}.phase-icon{font-size:64px;margin-bottom:12px;animation:spin 1.5s linear infinite}.phase-grid-placeholder{width:100%;max-width:calc(var(--card-size)*3 + var(--gap)*2);margin-top:24px;height:calc(var(--card-size)*2 + var(--gap))}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.spin{display:inline-block;animation:spin 1.5s linear infinite}.fade{animation:fadeIn .6s ease}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.pulse{animation:pulse 1s ease-in-out infinite}@keyframes pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.2);opacity:.7}}.bubbles{position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}.bubble{position:absolute;bottom:-120px;border-radius:50%;background:radial-gradient(circle at 30% 30%,#ffffffe6,#ffffff4d 60%,#fff0 70%);opacity:.18;filter:blur(.4px)}@keyframes floatUp{0%{transform:translateY(0) translate(0)}to{transform:translateY(-115vh) translate(30px)}}.bubble:nth-child(1){left:8%;width:120px;height:120px;animation:floatUp 16s linear infinite}.bubble:nth-child(2){left:24%;width:90px;height:90px;animation:floatUp 18s linear infinite .8s}.bubble:nth-child(3){left:52%;width:140px;height:140px;animation:floatUp 20s linear infinite .3s}.bubble:nth-child(4){left:74%;width:70px;height:70px;animation:floatUp 15s linear infinite 1.2s}.bubble:nth-child(5){left:88%;width:110px;height:110px;animation:floatUp 19s linear infinite .5s}@media (max-width: 900px){:root{--card-size: 180px;--gap: 16px}}@media (max-width: 640px){.grid{max-width:314px;grid-template-columns:repeat(2,150px);grid-auto-rows:150px;gap:14px}.button{font-size:14px;padding:9px 14px;border-radius:10px}.hide-logo-mobile{display:none!important}}
|
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import ue, { useState as u, useEffect as oe } from "react";
|
|
2
|
+
var re = { exports: {} }, z = {};
|
|
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 pe() {
|
|
14
|
+
if (ae) return z;
|
|
15
|
+
ae = 1;
|
|
16
|
+
var c = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
|
|
17
|
+
function i(o, n, f) {
|
|
18
|
+
var j = null;
|
|
19
|
+
if (f !== void 0 && (j = "" + f), n.key !== void 0 && (j = "" + n.key), "key" in n) {
|
|
20
|
+
f = {};
|
|
21
|
+
for (var R in n)
|
|
22
|
+
R !== "key" && (f[R] = n[R]);
|
|
23
|
+
} else f = n;
|
|
24
|
+
return n = f.ref, {
|
|
25
|
+
$$typeof: c,
|
|
26
|
+
type: o,
|
|
27
|
+
key: j,
|
|
28
|
+
ref: n !== void 0 ? n : null,
|
|
29
|
+
props: f
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return z.Fragment = m, z.jsx = i, z.jsxs = i, z;
|
|
33
|
+
}
|
|
34
|
+
var H = {};
|
|
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 ce;
|
|
45
|
+
function ge() {
|
|
46
|
+
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function c(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === y ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case P:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case O:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case U:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case Y:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case J:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case _:
|
|
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 W:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case L:
|
|
73
|
+
return (e.displayName || "Context") + ".Provider";
|
|
74
|
+
case q:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case F:
|
|
77
|
+
var t = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case K:
|
|
80
|
+
return t = e.displayName || null, t !== null ? t : c(e.type) || "Memo";
|
|
81
|
+
case S:
|
|
82
|
+
t = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return c(e(t));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function m(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function i(e) {
|
|
94
|
+
try {
|
|
95
|
+
m(e);
|
|
96
|
+
var t = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
t = !0;
|
|
99
|
+
}
|
|
100
|
+
if (t) {
|
|
101
|
+
t = console;
|
|
102
|
+
var a = t.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return a.call(
|
|
104
|
+
t,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
d
|
|
107
|
+
), m(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function o(e) {
|
|
111
|
+
if (e === P) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === S)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var t = c(e);
|
|
116
|
+
return t ? "<" + t + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function n() {
|
|
122
|
+
var e = C.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function f() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function j(e) {
|
|
129
|
+
if (N.call(e, "key")) {
|
|
130
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (t && t.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function R(e, t) {
|
|
136
|
+
function a() {
|
|
137
|
+
T || (T = !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
|
+
t
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: a,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function w() {
|
|
148
|
+
var e = c(this.type);
|
|
149
|
+
return $[e] || ($[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 V(e, t, a, d, x, h, Q, B) {
|
|
154
|
+
return a = h.ref, e = {
|
|
155
|
+
$$typeof: k,
|
|
156
|
+
type: e,
|
|
157
|
+
key: t,
|
|
158
|
+
props: h,
|
|
159
|
+
_owner: x
|
|
160
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
|
+
enumerable: !1,
|
|
162
|
+
get: w
|
|
163
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
|
+
configurable: !1,
|
|
165
|
+
enumerable: !1,
|
|
166
|
+
writable: !0,
|
|
167
|
+
value: 0
|
|
168
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
169
|
+
configurable: !1,
|
|
170
|
+
enumerable: !1,
|
|
171
|
+
writable: !0,
|
|
172
|
+
value: null
|
|
173
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
174
|
+
configurable: !1,
|
|
175
|
+
enumerable: !1,
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: Q
|
|
178
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
179
|
+
configurable: !1,
|
|
180
|
+
enumerable: !1,
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: B
|
|
183
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
|
+
}
|
|
185
|
+
function b(e, t, a, d, x, h, Q, B) {
|
|
186
|
+
var g = t.children;
|
|
187
|
+
if (g !== void 0)
|
|
188
|
+
if (d)
|
|
189
|
+
if (Z(g)) {
|
|
190
|
+
for (d = 0; d < g.length; d++)
|
|
191
|
+
X(g[d]);
|
|
192
|
+
Object.freeze && Object.freeze(g);
|
|
193
|
+
} else
|
|
194
|
+
console.error(
|
|
195
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
|
+
);
|
|
197
|
+
else X(g);
|
|
198
|
+
if (N.call(t, "key")) {
|
|
199
|
+
g = c(e);
|
|
200
|
+
var v = Object.keys(t).filter(function(r) {
|
|
201
|
+
return r !== "key";
|
|
202
|
+
});
|
|
203
|
+
d = 0 < v.length ? "{key: someKey, " + v.join(": ..., ") + ": ...}" : "{key: someKey}", M[g + d] || (v = 0 < v.length ? "{" + v.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
205
|
+
let props = %s;
|
|
206
|
+
<%s {...props} />
|
|
207
|
+
React keys must be passed directly to JSX without using spread:
|
|
208
|
+
let props = %s;
|
|
209
|
+
<%s key={someKey} {...props} />`,
|
|
210
|
+
d,
|
|
211
|
+
g,
|
|
212
|
+
v,
|
|
213
|
+
g
|
|
214
|
+
), M[g + d] = !0);
|
|
215
|
+
}
|
|
216
|
+
if (g = null, a !== void 0 && (i(a), g = "" + a), j(t) && (i(t.key), g = "" + t.key), "key" in t) {
|
|
217
|
+
a = {};
|
|
218
|
+
for (var G in t)
|
|
219
|
+
G !== "key" && (a[G] = t[G]);
|
|
220
|
+
} else a = t;
|
|
221
|
+
return g && R(
|
|
222
|
+
a,
|
|
223
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
|
+
), V(
|
|
225
|
+
e,
|
|
226
|
+
g,
|
|
227
|
+
h,
|
|
228
|
+
x,
|
|
229
|
+
n(),
|
|
230
|
+
a,
|
|
231
|
+
Q,
|
|
232
|
+
B
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function X(e) {
|
|
236
|
+
typeof e == "object" && e !== null && e.$$typeof === k && e._store && (e._store.validated = 1);
|
|
237
|
+
}
|
|
238
|
+
var p = ue, k = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), P = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), q = Symbol.for("react.consumer"), L = Symbol.for("react.context"), F = Symbol.for("react.forward_ref"), Y = Symbol.for("react.suspense"), J = Symbol.for("react.suspense_list"), K = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), _ = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), C = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, Z = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
239
|
+
return null;
|
|
240
|
+
};
|
|
241
|
+
p = {
|
|
242
|
+
react_stack_bottom_frame: function(e) {
|
|
243
|
+
return e();
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
var T, $ = {}, I = p.react_stack_bottom_frame.bind(
|
|
247
|
+
p,
|
|
248
|
+
f
|
|
249
|
+
)(), ee = D(o(f)), M = {};
|
|
250
|
+
H.Fragment = P, H.jsx = function(e, t, a, d, x) {
|
|
251
|
+
var h = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return b(
|
|
253
|
+
e,
|
|
254
|
+
t,
|
|
255
|
+
a,
|
|
256
|
+
!1,
|
|
257
|
+
d,
|
|
258
|
+
x,
|
|
259
|
+
h ? Error("react-stack-top-frame") : I,
|
|
260
|
+
h ? D(o(e)) : ee
|
|
261
|
+
);
|
|
262
|
+
}, H.jsxs = function(e, t, a, d, x) {
|
|
263
|
+
var h = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return b(
|
|
265
|
+
e,
|
|
266
|
+
t,
|
|
267
|
+
a,
|
|
268
|
+
!0,
|
|
269
|
+
d,
|
|
270
|
+
x,
|
|
271
|
+
h ? Error("react-stack-top-frame") : I,
|
|
272
|
+
h ? D(o(e)) : ee
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
})()), H;
|
|
276
|
+
}
|
|
277
|
+
var le;
|
|
278
|
+
function me() {
|
|
279
|
+
return le || (le = 1, process.env.NODE_ENV === "production" ? re.exports = pe() : re.exports = ge()), re.exports;
|
|
280
|
+
}
|
|
281
|
+
var s = me();
|
|
282
|
+
const fe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZEAAABFCAYAAACL+dvaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA75SURBVHgB7Z39eRO5FsZf+9n/b6gAbQUbKkBpgORWsEMFFypgqGChAkwFBBpAVABUgLYCQgOZq2ON8GRix9aR5vv8nkckhJBk4hm951sr5Oe8XmduPa7fqgOfa936161v9fvfIAiCIEyGFdLRbl3irnhwuYEXkvduGXhh6YMfOCx0XUHXarG7ZhJTg/6EtHTrFabLa/hr6JMrtz6AzwX8azwU2q3PiKevn7tw6x14WPif0x76hJvLywqRVKvV80fX1xtE8vPqqlxVVd/Pl4XfT27c9/52u15vDXT38xt0yB/goeGFo0CaaLQ5q7+2rv++gd8sLOYHXet5/b5ufJxuAuPWR7eu678L4+BvpEEiZCDsQyHNqJnrPhGDCu848dNOSLbvO/GkN8Z97It7e+1EJauhukYcGt6SofUCeQVkHwW8l0DWicIyoN8pbTZ0zT+xrGsfMwr+dUmBRKjrZ2aqkIAo8NjUSzgMicort746UfnhPKXCLYUMnCoiCjvx0OifAl5Mphx+4VJgeUI6RjTSaXqfwo6iXhwsvBcinI5yYvLOrR+/Li/fpYrJKSKi3fqKYcSjTQkfk16iNVfAvw4vIAxBLgNmiYbQMSSMNRAu4FWQd/Lr2TP2a3BMROgLk/cxpk2bQgpj+5n6gq75n3oJ/aGRzwvUkJBWEwljDc+Zy5eUdZhLIZKHRIRe3BLjhEICSxUSgrwRbhWLEE9qQr2NeJMeBf4eYyFhrNyobYgr0is5JCJk7ZcYNyQkS7bIC4hH0gcK/Hj9If4HgeCUGwck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ObpJkgSMe7j5EFj96xtZvt7MKH+oyz0kfV6lw2EuxuD+UURAEQZgI/wdUm/EYqXPURAAAAABJRU5ErkJggg==", ie = {
|
|
283
|
+
animals: [
|
|
284
|
+
"src/assets/Animals/bear.jpg",
|
|
285
|
+
"src/assets/Animals/cat.png",
|
|
286
|
+
"src/assets/Animals/crocodile.jpg",
|
|
287
|
+
"src/assets/Animals/dolphin.jpg",
|
|
288
|
+
"src/assets/Animals/elephant.jpg",
|
|
289
|
+
"src/assets/Animals/fox.jpg",
|
|
290
|
+
"src/assets/Animals/giraffe.jpg",
|
|
291
|
+
"src/assets/Animals/horse.jpg",
|
|
292
|
+
"src/assets/Animals/kangaroo.jpg",
|
|
293
|
+
"src/assets/Animals/lion.jpg",
|
|
294
|
+
"src/assets/Animals/monkey.jpg",
|
|
295
|
+
"src/assets/Animals/owl.jpg",
|
|
296
|
+
"src/assets/Animals/panda.jpg",
|
|
297
|
+
"src/assets/Animals/penguin.jpg",
|
|
298
|
+
"src/assets/Animals/rabbit.jpg",
|
|
299
|
+
"src/assets/Animals/squirrel.jpg",
|
|
300
|
+
"src/assets/Animals/tiger.png",
|
|
301
|
+
"src/assets/Animals/tortoise.jpg",
|
|
302
|
+
"src/assets/Animals/wolf.png",
|
|
303
|
+
"src/assets/Animals/zebra.jpg"
|
|
304
|
+
],
|
|
305
|
+
food: [
|
|
306
|
+
"src/assets/Food/apple.jpg",
|
|
307
|
+
"src/assets/Food/banana.jpg",
|
|
308
|
+
"src/assets/Food/bread.jpg",
|
|
309
|
+
"src/assets/Food/carrot.jpg",
|
|
310
|
+
"src/assets/Food/cake.jpg",
|
|
311
|
+
"src/assets/Food/pizza.jpg",
|
|
312
|
+
"src/assets/Food/rice.jpg",
|
|
313
|
+
"src/assets/Food/burger.jpg",
|
|
314
|
+
"src/assets/Food/cheese.jpg",
|
|
315
|
+
"src/assets/Food/chocolate.jpg",
|
|
316
|
+
"src/assets/Food/strawberry.jpg",
|
|
317
|
+
"src/assets/Food/orange.jpg",
|
|
318
|
+
"src/assets/Food/pear.jpg",
|
|
319
|
+
"src/assets/Food/watermelon.jpg",
|
|
320
|
+
"src/assets/Food/ice cream.jpg",
|
|
321
|
+
"src/assets/Food/soup.jpg",
|
|
322
|
+
"src/assets/Food/chicken.jpg",
|
|
323
|
+
"src/assets/Food/fish.jpg",
|
|
324
|
+
"src/assets/Food/fries.jpg",
|
|
325
|
+
"src/assets/Food/tomato.jpg",
|
|
326
|
+
"src/assets/Food/milk.jpg",
|
|
327
|
+
"src/assets/Food/grapes.jpg",
|
|
328
|
+
"src/assets/Food/corn.jpg",
|
|
329
|
+
"src/assets/Food/donut.jpg",
|
|
330
|
+
"src/assets/Food/sandwich.jpg"
|
|
331
|
+
],
|
|
332
|
+
toys: [
|
|
333
|
+
"src/assets/Toys/ball.jpg",
|
|
334
|
+
"src/assets/Toys/balloon.jpg",
|
|
335
|
+
"src/assets/Toys/blocks.jpg",
|
|
336
|
+
"src/assets/Toys/car.jpg",
|
|
337
|
+
"src/assets/Toys/doll.jpg",
|
|
338
|
+
"src/assets/Toys/drum.jpg",
|
|
339
|
+
"src/assets/Toys/guitar.jpg",
|
|
340
|
+
"src/assets/Toys/jump rope.jpg",
|
|
341
|
+
"src/assets/Toys/kite.jpg",
|
|
342
|
+
"src/assets/Toys/paints.jpg",
|
|
343
|
+
"src/assets/Toys/plane.jpg",
|
|
344
|
+
"src/assets/Toys/puzzle.jpg",
|
|
345
|
+
"src/assets/Toys/scooter.jpg",
|
|
346
|
+
"src/assets/Toys/rocket.jpg",
|
|
347
|
+
"src/assets/Toys/skateboard.jpg",
|
|
348
|
+
"src/assets/Toys/slide.jpg",
|
|
349
|
+
"src/assets/Toys/teddy bear.jpg",
|
|
350
|
+
"src/assets/Toys/train.jpg",
|
|
351
|
+
"src/assets/Toys/crayons.jpg",
|
|
352
|
+
"src/assets/Toys/yo-yo.jpg"
|
|
353
|
+
]
|
|
354
|
+
}, de = (c) => (c.split("/").pop() || "").replace(/\.(jpg|png|jpeg|webp)$/i, "").toLowerCase(), he = (c, m) => {
|
|
355
|
+
const i = Array.from(
|
|
356
|
+
{ length: c.length + 1 },
|
|
357
|
+
() => Array(m.length + 1).fill(0)
|
|
358
|
+
);
|
|
359
|
+
for (let o = 0; o <= c.length; o++) i[o][0] = o;
|
|
360
|
+
for (let o = 0; o <= m.length; o++) i[0][o] = o;
|
|
361
|
+
for (let o = 1; o <= c.length; o++)
|
|
362
|
+
for (let n = 1; n <= m.length; n++)
|
|
363
|
+
i[o][n] = c[o - 1] === m[n - 1] ? i[o - 1][n - 1] : Math.min(i[o - 1][n - 1], i[o][n - 1], i[o - 1][n]) + 1;
|
|
364
|
+
return i[c.length][m.length];
|
|
365
|
+
};
|
|
366
|
+
function xe() {
|
|
367
|
+
const [c, m] = u(null), [i, o] = u([]), [n, f] = u(4), [j, R] = u(!1), [w, V] = u(1), [b, X] = u(null), [p, k] = u("ready"), [W, P] = u(3), [U, O] = u(7), [q, L] = u(0), [F, Y] = u(!1), [J, K] = u(20), [S, _] = u(""), [y, C] = u(!1), [N, Z] = u(!1), [D, T] = u(
|
|
368
|
+
null
|
|
369
|
+
), [$, I] = u([]), [ee, M] = u([]), [e, t] = u(!1);
|
|
370
|
+
oe(() => {
|
|
371
|
+
const r = () => t(window.innerWidth < 768);
|
|
372
|
+
return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
373
|
+
}, []);
|
|
374
|
+
const a = (r) => [...r].sort(() => Math.random() - 0.5).slice(0, 6), d = () => {
|
|
375
|
+
if (!c) return;
|
|
376
|
+
const r = a(ie[c]);
|
|
377
|
+
o(r), R(!0), Y(!1), V(1), L(0), I([]), M([]), x(r, [], !0);
|
|
378
|
+
}, x = (r = i, l = ee, E = !1) => {
|
|
379
|
+
const A = a(r.length ? r : ie[c]);
|
|
380
|
+
let se = Math.floor(Math.random() * A.length), te = A[se], ne = 0;
|
|
381
|
+
for (; l.includes(te) && ne < 20; )
|
|
382
|
+
se = Math.floor(Math.random() * A.length), te = A[se], ne++;
|
|
383
|
+
o(A), X(se), M([...l, te]), C(!1), _(""), K(20), T(null), E ? (k("ready"), P(3), O(7)) : (k("memorize"), O(7));
|
|
384
|
+
};
|
|
385
|
+
oe(() => {
|
|
386
|
+
if (!(!j || F || y)) {
|
|
387
|
+
if (p === "ready")
|
|
388
|
+
if (W <= 0)
|
|
389
|
+
k("memorize"), O(7);
|
|
390
|
+
else {
|
|
391
|
+
const r = setTimeout(() => P((l) => l - 1), 1e3);
|
|
392
|
+
return () => clearTimeout(r);
|
|
393
|
+
}
|
|
394
|
+
if (p === "memorize")
|
|
395
|
+
if (U <= 0)
|
|
396
|
+
k("guess");
|
|
397
|
+
else {
|
|
398
|
+
const r = setTimeout(() => O((l) => l - 1), 1e3);
|
|
399
|
+
return () => clearTimeout(r);
|
|
400
|
+
}
|
|
401
|
+
if (p === "guess") {
|
|
402
|
+
if (J <= 0) {
|
|
403
|
+
C(!0), T("wrong");
|
|
404
|
+
const l = de(i[b]);
|
|
405
|
+
I((E) => [
|
|
406
|
+
...E,
|
|
407
|
+
{ round: w, answer: S, correct: l, result: "wrong" }
|
|
408
|
+
]);
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
const r = setTimeout(() => K((l) => l - 1), 1e3);
|
|
412
|
+
return () => clearTimeout(r);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}, [
|
|
416
|
+
p,
|
|
417
|
+
W,
|
|
418
|
+
U,
|
|
419
|
+
J,
|
|
420
|
+
j,
|
|
421
|
+
F,
|
|
422
|
+
y,
|
|
423
|
+
i,
|
|
424
|
+
b,
|
|
425
|
+
w,
|
|
426
|
+
S
|
|
427
|
+
]);
|
|
428
|
+
const h = () => {
|
|
429
|
+
if (b === null || N) return;
|
|
430
|
+
const r = de(i[b]), l = S.toLowerCase().trim();
|
|
431
|
+
let E = "wrong";
|
|
432
|
+
l === r ? (L((A) => A + 1), T("correct"), E = "correct") : he(l, r) === 1 ? (L((A) => A + 0.5), T("almost"), E = "almost") : (T("wrong"), E = "wrong"), I((A) => [
|
|
433
|
+
...A,
|
|
434
|
+
{ round: w, answer: l, correct: r, result: E }
|
|
435
|
+
]), Z(!0), setTimeout(() => {
|
|
436
|
+
Z(!1), C(!0);
|
|
437
|
+
}, 600);
|
|
438
|
+
}, Q = () => {
|
|
439
|
+
w < n ? (V((r) => r + 1), x()) : Y(!0);
|
|
440
|
+
}, B = () => {
|
|
441
|
+
R(!1), Y(!1), m(null);
|
|
442
|
+
}, g = 52, v = 28, G = () => /* @__PURE__ */ s.jsx(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
style: {
|
|
446
|
+
position: "fixed",
|
|
447
|
+
top: 16,
|
|
448
|
+
left: 20,
|
|
449
|
+
zIndex: 1e3
|
|
450
|
+
},
|
|
451
|
+
children: /* @__PURE__ */ s.jsx(
|
|
452
|
+
"img",
|
|
453
|
+
{
|
|
454
|
+
src: fe,
|
|
455
|
+
alt: "SPEAKID Logo",
|
|
456
|
+
style: { height: "clamp(28px, 5vw, 40px)", width: "auto" }
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
|
|
462
|
+
!e && /* @__PURE__ */ s.jsx(G, {}),
|
|
463
|
+
!c && !j && /* @__PURE__ */ s.jsxs("div", { className: "centerScreen fade", children: [
|
|
464
|
+
/* @__PURE__ */ s.jsx("h1", { className: "headline1", children: "WHAT'S MISSING?" }),
|
|
465
|
+
/* @__PURE__ */ s.jsx("p", { className: "bodyM", children: "Select a theme:" }),
|
|
466
|
+
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
|
|
467
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: () => m("animals"), children: "🐶 Animals" }),
|
|
468
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: () => m("food"), children: "🍎 Food" }),
|
|
469
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: () => m("toys"), children: "🧸 Toys" })
|
|
470
|
+
] }),
|
|
471
|
+
/* @__PURE__ */ s.jsxs("div", { style: { marginTop: 24 }, children: [
|
|
472
|
+
/* @__PURE__ */ s.jsx("p", { className: "bodyS", children: "Choose number of rounds:" }),
|
|
473
|
+
/* @__PURE__ */ s.jsx("div", { style: { display: "flex", gap: 12, marginTop: 8 }, children: [3, 4, 5].map((r) => /* @__PURE__ */ s.jsx(
|
|
474
|
+
"button",
|
|
475
|
+
{
|
|
476
|
+
className: "button button--ghost",
|
|
477
|
+
style: {
|
|
478
|
+
background: n === r ? "#333" : void 0,
|
|
479
|
+
color: n === r ? "#fff" : void 0
|
|
480
|
+
},
|
|
481
|
+
onClick: () => f(r),
|
|
482
|
+
children: r
|
|
483
|
+
},
|
|
484
|
+
r
|
|
485
|
+
)) })
|
|
486
|
+
] })
|
|
487
|
+
] }),
|
|
488
|
+
c && !j && /* @__PURE__ */ s.jsxs("div", { className: "centerScreen fade", children: [
|
|
489
|
+
/* @__PURE__ */ s.jsxs("h1", { className: "headline1", children: [
|
|
490
|
+
"Theme selected: ",
|
|
491
|
+
c
|
|
492
|
+
] }),
|
|
493
|
+
/* @__PURE__ */ s.jsxs("p", { className: "bodyM", children: [
|
|
494
|
+
"Rounds: ",
|
|
495
|
+
n
|
|
496
|
+
] }),
|
|
497
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: d, children: "▶ Start game" })
|
|
498
|
+
] }),
|
|
499
|
+
F && /* @__PURE__ */ s.jsxs("div", { className: "centerScreen fade", children: [
|
|
500
|
+
/* @__PURE__ */ s.jsx("h1", { className: "headline1", children: "Results" }),
|
|
501
|
+
/* @__PURE__ */ s.jsxs("h2", { className: "headline3", children: [
|
|
502
|
+
"Your score: ",
|
|
503
|
+
q,
|
|
504
|
+
" / ",
|
|
505
|
+
n
|
|
506
|
+
] }),
|
|
507
|
+
/* @__PURE__ */ s.jsxs("table", { style: { marginTop: 20, borderCollapse: "collapse" }, children: [
|
|
508
|
+
/* @__PURE__ */ s.jsx("thead", { children: /* @__PURE__ */ s.jsxs("tr", { className: "bodyM", style: { textAlign: "left" }, children: [
|
|
509
|
+
/* @__PURE__ */ s.jsx("th", { style: { padding: "6px 12px" }, children: "Round" }),
|
|
510
|
+
/* @__PURE__ */ s.jsx("th", { style: { padding: "6px 12px" }, children: "Your Answer" }),
|
|
511
|
+
/* @__PURE__ */ s.jsx("th", { style: { padding: "6px 12px" }, children: "Correct" }),
|
|
512
|
+
/* @__PURE__ */ s.jsx("th", { style: { padding: "6px 12px" }, children: "Result" })
|
|
513
|
+
] }) }),
|
|
514
|
+
/* @__PURE__ */ s.jsx("tbody", { children: $.map((r, l) => /* @__PURE__ */ s.jsxs("tr", { children: [
|
|
515
|
+
/* @__PURE__ */ s.jsx("td", { style: { padding: "6px 12px" }, children: r.round }),
|
|
516
|
+
/* @__PURE__ */ s.jsx("td", { style: { padding: "6px 12px" }, children: r.answer || "—" }),
|
|
517
|
+
/* @__PURE__ */ s.jsx("td", { style: { padding: "6px 12px" }, children: r.correct }),
|
|
518
|
+
/* @__PURE__ */ s.jsxs("td", { style: { padding: "6px 12px" }, children: [
|
|
519
|
+
r.result === "correct" && /* @__PURE__ */ s.jsx("span", { style: { color: "green" }, children: "✔ Correct" }),
|
|
520
|
+
r.result === "almost" && /* @__PURE__ */ s.jsx("span", { style: { color: "orange" }, children: "◐ Almost (0.5)" }),
|
|
521
|
+
r.result === "wrong" && /* @__PURE__ */ s.jsx("span", { style: { color: "red" }, children: "✘ Wrong" })
|
|
522
|
+
] })
|
|
523
|
+
] }, l)) })
|
|
524
|
+
] }),
|
|
525
|
+
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", gap: 12, marginTop: 24 }, children: [
|
|
526
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: d, children: "🔁 Play again" }),
|
|
527
|
+
/* @__PURE__ */ s.jsx("button", { className: "button", onClick: B, children: "⬅️ Choose theme" })
|
|
528
|
+
] })
|
|
529
|
+
] }),
|
|
530
|
+
j && !F && /* @__PURE__ */ s.jsxs("div", { className: "gameLayout fade", children: [
|
|
531
|
+
/* @__PURE__ */ s.jsxs(
|
|
532
|
+
"div",
|
|
533
|
+
{
|
|
534
|
+
style: {
|
|
535
|
+
width: "100%",
|
|
536
|
+
display: "flex",
|
|
537
|
+
flexDirection: "column",
|
|
538
|
+
alignItems: "center"
|
|
539
|
+
},
|
|
540
|
+
children: [
|
|
541
|
+
/* @__PURE__ */ s.jsx("div", { className: "progressContainer", children: /* @__PURE__ */ s.jsx(
|
|
542
|
+
"div",
|
|
543
|
+
{
|
|
544
|
+
className: "progressBar",
|
|
545
|
+
style: { width: `${w / n * 100}%` }
|
|
546
|
+
}
|
|
547
|
+
) }),
|
|
548
|
+
/* @__PURE__ */ s.jsxs(
|
|
549
|
+
"div",
|
|
550
|
+
{
|
|
551
|
+
style: {
|
|
552
|
+
minHeight: g,
|
|
553
|
+
display: "flex",
|
|
554
|
+
alignItems: "center"
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
p === "ready" && /* @__PURE__ */ s.jsx("h1", { className: "headline1", style: { color: "#ec4c44" }, children: "GET READY" }),
|
|
558
|
+
(p === "memorize" || p === "guess") && /* @__PURE__ */ s.jsxs("h2", { className: "headline3", children: [
|
|
559
|
+
"Round ",
|
|
560
|
+
w,
|
|
561
|
+
" of ",
|
|
562
|
+
n,
|
|
563
|
+
" — Score: ",
|
|
564
|
+
q
|
|
565
|
+
] })
|
|
566
|
+
]
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
/* @__PURE__ */ s.jsxs(
|
|
570
|
+
"div",
|
|
571
|
+
{
|
|
572
|
+
style: {
|
|
573
|
+
minHeight: v,
|
|
574
|
+
display: "flex",
|
|
575
|
+
alignItems: "center"
|
|
576
|
+
},
|
|
577
|
+
children: [
|
|
578
|
+
p === "ready" && /* @__PURE__ */ s.jsx("div", { className: "spin", style: { fontSize: 36 }, children: "⏳" }),
|
|
579
|
+
p === "memorize" && /* @__PURE__ */ s.jsxs("p", { className: "bodyM", style: { color: "#10b981" }, children: [
|
|
580
|
+
"MEMORIZE ",
|
|
581
|
+
/* @__PURE__ */ s.jsxs("span", { className: "pulse", children: [
|
|
582
|
+
"(",
|
|
583
|
+
U,
|
|
584
|
+
")"
|
|
585
|
+
] })
|
|
586
|
+
] }),
|
|
587
|
+
p === "guess" && !y && /* @__PURE__ */ s.jsxs("p", { className: "bodyM", children: [
|
|
588
|
+
"⏳ Time left: ",
|
|
589
|
+
J,
|
|
590
|
+
"s"
|
|
591
|
+
] })
|
|
592
|
+
]
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
),
|
|
598
|
+
p !== "ready" && /* @__PURE__ */ s.jsx("div", { className: "grid", children: i.map((r, l) => {
|
|
599
|
+
const E = b === l && p === "guess" && !y;
|
|
600
|
+
return /* @__PURE__ */ s.jsx(
|
|
601
|
+
"div",
|
|
602
|
+
{
|
|
603
|
+
className: `card ${E && N ? "hop" : ""} ${D === "correct" && b === l ? "correct" : ""} ${D === "wrong" && b === l ? "wrong" : ""}`,
|
|
604
|
+
children: (!E || y) && /* @__PURE__ */ s.jsx("img", { src: r, alt: `img-${l}` })
|
|
605
|
+
},
|
|
606
|
+
l
|
|
607
|
+
);
|
|
608
|
+
}) }),
|
|
609
|
+
/* @__PURE__ */ s.jsxs("div", { style: { marginTop: 16, height: 80 }, children: [
|
|
610
|
+
p === "guess" && !y && /* @__PURE__ */ s.jsxs("div", { children: [
|
|
611
|
+
/* @__PURE__ */ s.jsx(
|
|
612
|
+
"input",
|
|
613
|
+
{
|
|
614
|
+
type: "text",
|
|
615
|
+
placeholder: "Type the missing word",
|
|
616
|
+
value: S,
|
|
617
|
+
onChange: (r) => _(r.target.value),
|
|
618
|
+
className: "bodyM",
|
|
619
|
+
style: {
|
|
620
|
+
padding: "6px 12px",
|
|
621
|
+
borderRadius: 6,
|
|
622
|
+
border: "1px solid #ccc"
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
/* @__PURE__ */ s.jsx(
|
|
627
|
+
"button",
|
|
628
|
+
{
|
|
629
|
+
className: "button",
|
|
630
|
+
onClick: h,
|
|
631
|
+
disabled: N,
|
|
632
|
+
style: { marginLeft: 8 },
|
|
633
|
+
children: N ? "..." : "Check"
|
|
634
|
+
}
|
|
635
|
+
)
|
|
636
|
+
] }),
|
|
637
|
+
y && /* @__PURE__ */ s.jsx("div", { children: /* @__PURE__ */ s.jsx("button", { className: "button", onClick: Q, children: "Next round" }) })
|
|
638
|
+
] })
|
|
639
|
+
] })
|
|
640
|
+
] });
|
|
641
|
+
}
|
|
642
|
+
export {
|
|
643
|
+
xe as default
|
|
644
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(function(a,R){typeof exports=="object"&&typeof module<"u"?module.exports=R(require("react")):typeof define=="function"&&define.amd?define(["react"],R):(a=typeof globalThis<"u"?globalThis:a||self,a.WhatsMissingGame=R(a.React))})(this,(function(a){"use strict";var R={exports:{}},L={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ne;function de(){if(ne)return L;ne=1;var l=Symbol.for("react.transitional.element"),m=Symbol.for("react.fragment");function d(o,n,f){var j=null;if(f!==void 0&&(j=""+f),n.key!==void 0&&(j=""+n.key),"key"in n){f={};for(var T in n)T!=="key"&&(f[T]=n[T])}else f=n;return n=f.ref,{$$typeof:l,type:o,key:j,ref:n!==void 0?n:null,props:f}}return L.Fragment=m,L.jsx=d,L.jsxs=d,L}var Y={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ae;function ue(){return ae||(ae=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===b?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case F:return"Profiler";case M:return"StrictMode";case Q:return"Suspense";case B:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case K:return"Portal";case J:return(e.displayName||"Context")+".Provider";case _:return(e._context.displayName||"Context")+".Consumer";case D:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case C:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function m(e){return""+e}function d(e){try{m(e);var r=!1}catch{r=!0}if(r){r=console;var c=r.error,u=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return c.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),m(e)}}function o(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function n(){var e=N.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function j(e){if(P.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function T(e,r){function c(){v||(v=!0,console.error("%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)",r))}c.isReactWarning=!0,Object.defineProperty(e,"key",{get:c,configurable:!0})}function w(){var e=l(this.type);return ee[e]||(ee[e]=!0,console.error("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.")),e=this.props.ref,e!==void 0?e:null}function W(e,r,c,u,x,h,z,H){return c=h.ref,e={$$typeof:S,type:e,key:r,props:h,_owner:x},(c!==void 0?c:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:w}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:z}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e,r,c,u,x,h,z,H){var g=r.children;if(g!==void 0)if(u)if($(g)){for(u=0;u<g.length;u++)X(g[u]);Object.freeze&&Object.freeze(g)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else X(g);if(P.call(r,"key")){g=l(e);var k=Object.keys(r).filter(function(t){return t!=="key"});u=0<k.length?"{key: someKey, "+k.join(": ..., ")+": ...}":"{key: someKey}",G[g+u]||(k=0<k.length?"{"+k.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,u,g,k,g),G[g+u]=!0)}if(g=null,c!==void 0&&(d(c),g=""+c),j(r)&&(d(r.key),g=""+r.key),"key"in r){c={};for(var V in r)V!=="key"&&(c[V]=r[V])}else c=r;return g&&T(c,typeof e=="function"?e.displayName||e.name||"Unknown":e),W(e,g,h,x,n(),c,z,H)}function X(e){typeof e=="object"&&e!==null&&e.$$typeof===S&&e._store&&(e._store.validated=1)}var p=a,S=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),J=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),b=Symbol.for("react.client.reference"),N=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,$=Array.isArray,I=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(e){return e()}};var v,ee={},U=p.react_stack_bottom_frame.bind(p,f)(),se=I(o(f)),G={};Y.Fragment=O,Y.jsx=function(e,r,c,u,x){var h=1e4>N.recentlyCreatedOwnerStacks++;return y(e,r,c,!1,u,x,h?Error("react-stack-top-frame"):U,h?I(o(e)):se)},Y.jsxs=function(e,r,c,u,x){var h=1e4>N.recentlyCreatedOwnerStacks++;return y(e,r,c,!0,u,x,h?Error("react-stack-top-frame"):U,h?I(o(e)):se)}})()),Y}var oe;function pe(){return oe||(oe=1,process.env.NODE_ENV==="production"?R.exports=de():R.exports=ue()),R.exports}var s=pe();const ge="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZEAAABFCAYAAACL+dvaAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAA75SURBVHgB7Z39eRO5FsZf+9n/b6gAbQUbKkBpgORWsEMFFypgqGChAkwFBBpAVABUgLYCQgOZq2ON8GRix9aR5vv8nkckhJBk4hm951sr5Oe8XmduPa7fqgOfa936161v9fvfIAiCIEyGFdLRbl3irnhwuYEXkvduGXhh6YMfOCx0XUHXarG7ZhJTg/6E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MbwrB6NgKyKdP5bHPOzTFt8C0hIS8JwtB8JuLQjy0sQ2dT+MWhUxxBBEZqwZ8KMkuvSMdsQ1hnSAgxEOj4Aukzb3pC/JAJJkuBLgJ9TGM3t+A9zOEIpapkRI6V5DekS6wdRL95PDqsfNEKLY81mR1GEe/gSB4FPhhjjF43imNslPcUMM5Olzk3JGMUB+IE5An7Y70Y5xyKFUJf8KexXgw8PXiBoKwQ4OHxXjuJa7RpjHN8E6JtL2Fe9SwEFitzNb7+PTpxaEy3oc49WRDCy8krzGsmIRhbheQHIhwH641bjAeDPhhNW5V2pDQtaYUxVBlWgkhnlo8zq6vL2K9jyaxx+OW8Bs4vegW/RGqOUjI5txoJPDR4DdqjS33xw2tTXVisUGakFNhgYJwHC8cr916lCoegT8Qj4XPQ9DS8An4p8j/IpJw0MOUOgFUWAbcDfQbxjewk+55TsWVwnROPWxDhik1OnNCcqF35AJCkxsnGrbajZ665oSrjsERkSYGuxv2vLH+qt+eekOEM8fpQr/XX7PPB5ss0dib12DaGEwb0/o7HUTGyScYjA8DH7bNneOw4P2OLLrHwgtJSuMk/b4ObpJkgSMe7j5EFj96xtZvt7MKH+oyz0kfV6lw2EuxuD+UURAEQZgI/wdUm/EYqXPURAAAAABJRU5ErkJggg==",ce={animals:["src/assets/Animals/bear.jpg","src/assets/Animals/cat.png","src/assets/Animals/crocodile.jpg","src/assets/Animals/dolphin.jpg","src/assets/Animals/elephant.jpg","src/assets/Animals/fox.jpg","src/assets/Animals/giraffe.jpg","src/assets/Animals/horse.jpg","src/assets/Animals/kangaroo.jpg","src/assets/Animals/lion.jpg","src/assets/Animals/monkey.jpg","src/assets/Animals/owl.jpg","src/assets/Animals/panda.jpg","src/assets/Animals/penguin.jpg","src/assets/Animals/rabbit.jpg","src/assets/Animals/squirrel.jpg","src/assets/Animals/tiger.png","src/assets/Animals/tortoise.jpg","src/assets/Animals/wolf.png","src/assets/Animals/zebra.jpg"],food:["src/assets/Food/apple.jpg","src/assets/Food/banana.jpg","src/assets/Food/bread.jpg","src/assets/Food/carrot.jpg","src/assets/Food/cake.jpg","src/assets/Food/pizza.jpg","src/assets/Food/rice.jpg","src/assets/Food/burger.jpg","src/assets/Food/cheese.jpg","src/assets/Food/chocolate.jpg","src/assets/Food/strawberry.jpg","src/assets/Food/orange.jpg","src/assets/Food/pear.jpg","src/assets/Food/watermelon.jpg","src/assets/Food/ice cream.jpg","src/assets/Food/soup.jpg","src/assets/Food/chicken.jpg","src/assets/Food/fish.jpg","src/assets/Food/fries.jpg","src/assets/Food/tomato.jpg","src/assets/Food/milk.jpg","src/assets/Food/grapes.jpg","src/assets/Food/corn.jpg","src/assets/Food/donut.jpg","src/assets/Food/sandwich.jpg"],toys:["src/assets/Toys/ball.jpg","src/assets/Toys/balloon.jpg","src/assets/Toys/blocks.jpg","src/assets/Toys/car.jpg","src/assets/Toys/doll.jpg","src/assets/Toys/drum.jpg","src/assets/Toys/guitar.jpg","src/assets/Toys/jump rope.jpg","src/assets/Toys/kite.jpg","src/assets/Toys/paints.jpg","src/assets/Toys/plane.jpg","src/assets/Toys/puzzle.jpg","src/assets/Toys/scooter.jpg","src/assets/Toys/rocket.jpg","src/assets/Toys/skateboard.jpg","src/assets/Toys/slide.jpg","src/assets/Toys/teddy bear.jpg","src/assets/Toys/train.jpg","src/assets/Toys/crayons.jpg","src/assets/Toys/yo-yo.jpg"]},le=l=>(l.split("/").pop()||"").replace(/\.(jpg|png|jpeg|webp)$/i,"").toLowerCase(),me=(l,m)=>{const d=Array.from({length:l.length+1},()=>Array(m.length+1).fill(0));for(let o=0;o<=l.length;o++)d[o][0]=o;for(let o=0;o<=m.length;o++)d[0][o]=o;for(let o=1;o<=l.length;o++)for(let n=1;n<=m.length;n++)d[o][n]=l[o-1]===m[n-1]?d[o-1][n-1]:Math.min(d[o-1][n-1],d[o][n-1],d[o-1][n])+1;return d[l.length][m.length]};function fe(){const[l,m]=a.useState(null),[d,o]=a.useState([]),[n,f]=a.useState(4),[j,T]=a.useState(!1),[w,W]=a.useState(1),[y,X]=a.useState(null),[p,S]=a.useState("ready"),[K,O]=a.useState(3),[M,F]=a.useState(7),[_,J]=a.useState(0),[D,Q]=a.useState(!1),[B,Z]=a.useState(20),[C,q]=a.useState(""),[b,N]=a.useState(!1),[P,$]=a.useState(!1),[I,v]=a.useState(null),[ee,U]=a.useState([]),[se,G]=a.useState([]),[e,r]=a.useState(!1);a.useEffect(()=>{const t=()=>r(window.innerWidth<768);return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]);const c=t=>[...t].sort(()=>Math.random()-.5).slice(0,6),u=()=>{if(!l)return;const t=c(ce[l]);o(t),T(!0),Q(!1),W(1),J(0),U([]),G([]),x(t,[],!0)},x=(t=d,i=se,E=!1)=>{const A=c(t.length?t:ce[l]);let te=Math.floor(Math.random()*A.length),re=A[te],ie=0;for(;i.includes(re)&&ie<20;)te=Math.floor(Math.random()*A.length),re=A[te],ie++;o(A),X(te),G([...i,re]),N(!1),q(""),Z(20),v(null),E?(S("ready"),O(3),F(7)):(S("memorize"),F(7))};a.useEffect(()=>{if(!(!j||D||b)){if(p==="ready")if(K<=0)S("memorize"),F(7);else{const t=setTimeout(()=>O(i=>i-1),1e3);return()=>clearTimeout(t)}if(p==="memorize")if(M<=0)S("guess");else{const t=setTimeout(()=>F(i=>i-1),1e3);return()=>clearTimeout(t)}if(p==="guess"){if(B<=0){N(!0),v("wrong");const i=le(d[y]);U(E=>[...E,{round:w,answer:C,correct:i,result:"wrong"}]);return}const t=setTimeout(()=>Z(i=>i-1),1e3);return()=>clearTimeout(t)}}},[p,K,M,B,j,D,b,d,y,w,C]);const h=()=>{if(y===null||P)return;const t=le(d[y]),i=C.toLowerCase().trim();let E="wrong";i===t?(J(A=>A+1),v("correct"),E="correct"):me(i,t)===1?(J(A=>A+.5),v("almost"),E="almost"):(v("wrong"),E="wrong"),U(A=>[...A,{round:w,answer:i,correct:t,result:E}]),$(!0),setTimeout(()=>{$(!1),N(!0)},600)},z=()=>{w<n?(W(t=>t+1),x()):Q(!0)},H=()=>{T(!1),Q(!1),m(null)},g=52,k=28,V=()=>s.jsx("div",{style:{position:"fixed",top:16,left:20,zIndex:1e3},children:s.jsx("img",{src:ge,alt:"SPEAKID Logo",style:{height:"clamp(28px, 5vw, 40px)",width:"auto"}})});return s.jsxs(s.Fragment,{children:[!e&&s.jsx(V,{}),!l&&!j&&s.jsxs("div",{className:"centerScreen fade",children:[s.jsx("h1",{className:"headline1",children:"WHAT'S MISSING?"}),s.jsx("p",{className:"bodyM",children:"Select a theme:"}),s.jsxs("div",{style:{display:"flex",gap:16},children:[s.jsx("button",{className:"button",onClick:()=>m("animals"),children:"🐶 Animals"}),s.jsx("button",{className:"button",onClick:()=>m("food"),children:"🍎 Food"}),s.jsx("button",{className:"button",onClick:()=>m("toys"),children:"🧸 Toys"})]}),s.jsxs("div",{style:{marginTop:24},children:[s.jsx("p",{className:"bodyS",children:"Choose number of rounds:"}),s.jsx("div",{style:{display:"flex",gap:12,marginTop:8},children:[3,4,5].map(t=>s.jsx("button",{className:"button button--ghost",style:{background:n===t?"#333":void 0,color:n===t?"#fff":void 0},onClick:()=>f(t),children:t},t))})]})]}),l&&!j&&s.jsxs("div",{className:"centerScreen fade",children:[s.jsxs("h1",{className:"headline1",children:["Theme selected: ",l]}),s.jsxs("p",{className:"bodyM",children:["Rounds: ",n]}),s.jsx("button",{className:"button",onClick:u,children:"▶ Start game"})]}),D&&s.jsxs("div",{className:"centerScreen fade",children:[s.jsx("h1",{className:"headline1",children:"Results"}),s.jsxs("h2",{className:"headline3",children:["Your score: ",_," / ",n]}),s.jsxs("table",{style:{marginTop:20,borderCollapse:"collapse"},children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bodyM",style:{textAlign:"left"},children:[s.jsx("th",{style:{padding:"6px 12px"},children:"Round"}),s.jsx("th",{style:{padding:"6px 12px"},children:"Your Answer"}),s.jsx("th",{style:{padding:"6px 12px"},children:"Correct"}),s.jsx("th",{style:{padding:"6px 12px"},children:"Result"})]})}),s.jsx("tbody",{children:ee.map((t,i)=>s.jsxs("tr",{children:[s.jsx("td",{style:{padding:"6px 12px"},children:t.round}),s.jsx("td",{style:{padding:"6px 12px"},children:t.answer||"—"}),s.jsx("td",{style:{padding:"6px 12px"},children:t.correct}),s.jsxs("td",{style:{padding:"6px 12px"},children:[t.result==="correct"&&s.jsx("span",{style:{color:"green"},children:"✔ Correct"}),t.result==="almost"&&s.jsx("span",{style:{color:"orange"},children:"◐ Almost (0.5)"}),t.result==="wrong"&&s.jsx("span",{style:{color:"red"},children:"✘ Wrong"})]})]},i))})]}),s.jsxs("div",{style:{display:"flex",gap:12,marginTop:24},children:[s.jsx("button",{className:"button",onClick:u,children:"🔁 Play again"}),s.jsx("button",{className:"button",onClick:H,children:"⬅️ Choose theme"})]})]}),j&&!D&&s.jsxs("div",{className:"gameLayout fade",children:[s.jsxs("div",{style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center"},children:[s.jsx("div",{className:"progressContainer",children:s.jsx("div",{className:"progressBar",style:{width:`${w/n*100}%`}})}),s.jsxs("div",{style:{minHeight:g,display:"flex",alignItems:"center"},children:[p==="ready"&&s.jsx("h1",{className:"headline1",style:{color:"#ec4c44"},children:"GET READY"}),(p==="memorize"||p==="guess")&&s.jsxs("h2",{className:"headline3",children:["Round ",w," of ",n," — Score: ",_]})]}),s.jsxs("div",{style:{minHeight:k,display:"flex",alignItems:"center"},children:[p==="ready"&&s.jsx("div",{className:"spin",style:{fontSize:36},children:"⏳"}),p==="memorize"&&s.jsxs("p",{className:"bodyM",style:{color:"#10b981"},children:["MEMORIZE ",s.jsxs("span",{className:"pulse",children:["(",M,")"]})]}),p==="guess"&&!b&&s.jsxs("p",{className:"bodyM",children:["⏳ Time left: ",B,"s"]})]})]}),p!=="ready"&&s.jsx("div",{className:"grid",children:d.map((t,i)=>{const E=y===i&&p==="guess"&&!b;return s.jsx("div",{className:`card ${E&&P?"hop":""} ${I==="correct"&&y===i?"correct":""} ${I==="wrong"&&y===i?"wrong":""}`,children:(!E||b)&&s.jsx("img",{src:t,alt:`img-${i}`})},i)})}),s.jsxs("div",{style:{marginTop:16,height:80},children:[p==="guess"&&!b&&s.jsxs("div",{children:[s.jsx("input",{type:"text",placeholder:"Type the missing word",value:C,onChange:t=>q(t.target.value),className:"bodyM",style:{padding:"6px 12px",borderRadius:6,border:"1px solid #ccc"}}),s.jsx("button",{className:"button",onClick:h,disabled:P,style:{marginLeft:8},children:P?"...":"Check"})]}),b&&s.jsx("div",{children:s.jsx("button",{className:"button",onClick:z,children:"Next round"})})]})]})]})}return fe}));
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mblinkov/whats-missing",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/whats-missing.umd.js",
|
|
6
|
+
"module": "dist/whats-missing.es.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "npm run build:types && vite build",
|
|
14
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"preview": "vite preview"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"react": "^19.1.1",
|
|
20
|
+
"react-dom": "^19.1.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@eslint/js": "^9.33.0",
|
|
24
|
+
"@types/react": "^19.1.10",
|
|
25
|
+
"@types/react-dom": "^19.1.7",
|
|
26
|
+
"@vitejs/plugin-react": "^5.0.0",
|
|
27
|
+
"eslint": "^9.33.0",
|
|
28
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
29
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
30
|
+
"globals": "^16.3.0",
|
|
31
|
+
"typescript": "~5.8.3",
|
|
32
|
+
"typescript-eslint": "^8.39.1",
|
|
33
|
+
"vite": "^7.1.2"
|
|
34
|
+
},
|
|
35
|
+
"description": "A memory game What's Missing built with React",
|
|
36
|
+
"keywords": ["game", "react", "memory", "speakid"],
|
|
37
|
+
"author": "Mikhail Blinkov",
|
|
38
|
+
"license": "MIT"
|
|
39
|
+
}
|