speakid-hangman 1.0.0
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 +134 -0
- package/dist/components/HangmanLobbyGame.d.ts +10 -0
- package/dist/components/HangmanLobbyGame.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/speakid-hangman.cjs.js +46 -0
- package/dist/speakid-hangman.cjs.js.map +1 -0
- package/dist/speakid-hangman.es.js +1040 -0
- package/dist/speakid-hangman.es.js.map +1 -0
- package/dist/styles/style.d.ts +3 -0
- package/dist/styles/style.d.ts.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,1040 @@
|
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as $, useCallback as it, useEffect as at, useMemo as xt } from "react";
|
|
3
|
+
const a = {
|
|
4
|
+
gmCenterScreen: {
|
|
5
|
+
position: "relative",
|
|
6
|
+
zIndex: 1,
|
|
7
|
+
minHeight: "100%",
|
|
8
|
+
width: "100%",
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "column",
|
|
11
|
+
justifyContent: "center",
|
|
12
|
+
alignItems: "center",
|
|
13
|
+
textAlign: "center",
|
|
14
|
+
color: "#1f2937",
|
|
15
|
+
// colorTextPrimary
|
|
16
|
+
padding: "24px 16px",
|
|
17
|
+
boxSizing: "border-box",
|
|
18
|
+
fontFamily: '"Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif',
|
|
19
|
+
background: "transparent"
|
|
20
|
+
// Прозрачный по умолчанию, переопределяется в компоненте
|
|
21
|
+
},
|
|
22
|
+
// Desktop: Headline 1 - Onest SemiBold 32px, line-height 110%
|
|
23
|
+
gmHeadline1: {
|
|
24
|
+
fontWeight: 600,
|
|
25
|
+
// SemiBold
|
|
26
|
+
fontSize: "clamp(30px, 4vw, 32px)",
|
|
27
|
+
// Mobile 30px, Desktop 32px
|
|
28
|
+
lineHeight: "110%",
|
|
29
|
+
marginBottom: "24px",
|
|
30
|
+
color: "#1f2937",
|
|
31
|
+
// colorTextPrimary
|
|
32
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
33
|
+
},
|
|
34
|
+
// Desktop: Headline 3 - Onest Medium 24px, line-height 110%
|
|
35
|
+
// Mobile: Headline 3 - Onest Medium 16px, line-height 110%
|
|
36
|
+
gmHeadline3: {
|
|
37
|
+
fontWeight: 500,
|
|
38
|
+
// Medium
|
|
39
|
+
fontSize: "clamp(16px, 2vw, 24px)",
|
|
40
|
+
// Mobile 16px, Desktop 24px
|
|
41
|
+
lineHeight: "110%",
|
|
42
|
+
marginBottom: "12px",
|
|
43
|
+
color: "#1f2937",
|
|
44
|
+
// colorTextPrimary
|
|
45
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
46
|
+
},
|
|
47
|
+
// Desktop: Body L - Onest Regular 18px, line-height 120%
|
|
48
|
+
gmBodyL: {
|
|
49
|
+
fontWeight: 400,
|
|
50
|
+
// Regular
|
|
51
|
+
fontSize: "18px",
|
|
52
|
+
lineHeight: "120%",
|
|
53
|
+
marginBottom: "12px",
|
|
54
|
+
color: "#1f2937",
|
|
55
|
+
// colorTextPrimary
|
|
56
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
57
|
+
},
|
|
58
|
+
// Desktop: Body M - Onest Regular 16px, line-height 120%
|
|
59
|
+
// Mobile: Body M - Onest Regular 14px, line-height 120%
|
|
60
|
+
gmBodyM: {
|
|
61
|
+
fontWeight: 400,
|
|
62
|
+
// Regular
|
|
63
|
+
fontSize: "clamp(14px, 1.5vw, 16px)",
|
|
64
|
+
// Mobile 14px, Desktop 16px
|
|
65
|
+
lineHeight: "120%",
|
|
66
|
+
marginBottom: "8px",
|
|
67
|
+
color: "#1f2937",
|
|
68
|
+
// colorTextPrimary
|
|
69
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
70
|
+
},
|
|
71
|
+
// Desktop: Body S - Onest Regular 14px, line-height 120%
|
|
72
|
+
// Mobile: Body S - Onest Regular 12px, line-height 120%
|
|
73
|
+
gmBodyS: {
|
|
74
|
+
fontWeight: 400,
|
|
75
|
+
// Regular
|
|
76
|
+
fontSize: "clamp(12px, 1.5vw, 14px)",
|
|
77
|
+
// Mobile 12px, Desktop 14px
|
|
78
|
+
lineHeight: "120%",
|
|
79
|
+
color: "#6b7280",
|
|
80
|
+
// colorTextSecondary
|
|
81
|
+
marginBottom: "8px",
|
|
82
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
83
|
+
},
|
|
84
|
+
// Button: Onest Regular 16px, line-height 100%
|
|
85
|
+
gmButton: {
|
|
86
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
87
|
+
fontWeight: 400,
|
|
88
|
+
// Regular
|
|
89
|
+
fontSize: "16px",
|
|
90
|
+
lineHeight: "100%",
|
|
91
|
+
padding: "10px 16px",
|
|
92
|
+
borderRadius: "8px",
|
|
93
|
+
// Более мягкие углы для минималистичного стиля
|
|
94
|
+
border: "1px solid #e5e7eb",
|
|
95
|
+
// colorSeparator
|
|
96
|
+
background: "#ec4c44",
|
|
97
|
+
// colorAccent (Default)
|
|
98
|
+
color: "#ffffff",
|
|
99
|
+
// colorTextContrast
|
|
100
|
+
cursor: "pointer",
|
|
101
|
+
boxShadow: "none",
|
|
102
|
+
// Плоский стиль без теней
|
|
103
|
+
transition: "background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease",
|
|
104
|
+
margin: "4px"
|
|
105
|
+
},
|
|
106
|
+
gmButtonSecondary: {
|
|
107
|
+
background: "#f9f9f9",
|
|
108
|
+
// colorBackgroundAccent
|
|
109
|
+
color: "#1f2937",
|
|
110
|
+
// colorTextPrimary
|
|
111
|
+
border: "1px solid #e5e7eb",
|
|
112
|
+
// colorSeparator
|
|
113
|
+
boxShadow: "none"
|
|
114
|
+
// Плоский стиль
|
|
115
|
+
},
|
|
116
|
+
gmButtonGroup: {
|
|
117
|
+
display: "flex",
|
|
118
|
+
flexWrap: "wrap",
|
|
119
|
+
gap: "8px",
|
|
120
|
+
justifyContent: "center",
|
|
121
|
+
marginBottom: "24px"
|
|
122
|
+
},
|
|
123
|
+
gmWordDisplay: {
|
|
124
|
+
fontSize: "clamp(20px, 5vw, 28px)",
|
|
125
|
+
fontWeight: 500,
|
|
126
|
+
// Medium
|
|
127
|
+
letterSpacing: "6px",
|
|
128
|
+
margin: "32px 0",
|
|
129
|
+
color: "#1f2937",
|
|
130
|
+
// colorTextPrimary
|
|
131
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
132
|
+
lineHeight: "120%"
|
|
133
|
+
},
|
|
134
|
+
gmGuessedLetters: {
|
|
135
|
+
fontSize: "clamp(12px, 1.5vw, 16px)",
|
|
136
|
+
// Body S / Body M
|
|
137
|
+
color: "#6b7280",
|
|
138
|
+
// colorTextSecondary
|
|
139
|
+
marginTop: "16px",
|
|
140
|
+
minHeight: "24px",
|
|
141
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
142
|
+
lineHeight: "120%"
|
|
143
|
+
},
|
|
144
|
+
gmStatusWin: {
|
|
145
|
+
color: "#10b981",
|
|
146
|
+
// colorTextPositive / colorIconPositive
|
|
147
|
+
fontWeight: 500,
|
|
148
|
+
// Medium
|
|
149
|
+
fontSize: "clamp(14px, 1.5vw, 18px)",
|
|
150
|
+
// Body M / Body L
|
|
151
|
+
lineHeight: "120%",
|
|
152
|
+
margin: "16px 0",
|
|
153
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
154
|
+
},
|
|
155
|
+
gmStatusLose: {
|
|
156
|
+
color: "#ec4c44",
|
|
157
|
+
// colorTextNegative / colorIconNegative
|
|
158
|
+
fontWeight: 500,
|
|
159
|
+
// Medium
|
|
160
|
+
fontSize: "clamp(14px, 1.5vw, 18px)",
|
|
161
|
+
// Body M / Body L
|
|
162
|
+
lineHeight: "120%",
|
|
163
|
+
margin: "16px 0",
|
|
164
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
165
|
+
},
|
|
166
|
+
gmInfoBox: {
|
|
167
|
+
background: "#f9f9f9",
|
|
168
|
+
// colorBackgroundAccent
|
|
169
|
+
border: "1px solid #e5e7eb",
|
|
170
|
+
// colorSeparator
|
|
171
|
+
borderRadius: "8px",
|
|
172
|
+
// Мягкие углы
|
|
173
|
+
padding: "16px",
|
|
174
|
+
marginBottom: "24px",
|
|
175
|
+
maxWidth: "500px",
|
|
176
|
+
width: "100%",
|
|
177
|
+
boxShadow: "none"
|
|
178
|
+
// Плоский стиль
|
|
179
|
+
},
|
|
180
|
+
// ✅ Обновлено только для качества логотипа (размер как в magic-sentence)
|
|
181
|
+
gmLogoFixed: {
|
|
182
|
+
position: "absolute",
|
|
183
|
+
top: "16px",
|
|
184
|
+
left: "16px",
|
|
185
|
+
width: "auto",
|
|
186
|
+
zIndex: 10,
|
|
187
|
+
pointerEvents: "none",
|
|
188
|
+
background: "transparent",
|
|
189
|
+
transform: "none",
|
|
190
|
+
willChange: "auto"
|
|
191
|
+
},
|
|
192
|
+
gmLogoImg: {
|
|
193
|
+
height: "28px",
|
|
194
|
+
width: "auto",
|
|
195
|
+
background: "transparent",
|
|
196
|
+
objectFit: "contain",
|
|
197
|
+
imageRendering: "auto",
|
|
198
|
+
transform: "translateZ(0)",
|
|
199
|
+
backfaceVisibility: "hidden",
|
|
200
|
+
WebkitFontSmoothing: "antialiased",
|
|
201
|
+
display: "block"
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
function bt({
|
|
205
|
+
mistakes: r,
|
|
206
|
+
maxMistakes: f,
|
|
207
|
+
size: x = 200
|
|
208
|
+
}) {
|
|
209
|
+
const l = x, c = x * 1.25, b = Math.max(2, x / 100), W = 10 * (l / 200), w = 240 * (c / 250), m = 150 * (l / 200), y = 80 * (l / 200), K = 20 * (c / 250), _ = 240 * (c / 250), S = 80 * (l / 200), V = 20 * (c / 250), L = 150 * (l / 200), H = 150 * (l / 200), F = 20 * (c / 250), R = 50 * (c / 250), T = 150 * (l / 200), I = 70 * (c / 250), P = 20 * (l / 200), B = 150 * (l / 200), q = 90 * (c / 250), O = 150 * (c / 250), u = 150 * (l / 200), z = 110 * (c / 250), h = 130 * (l / 200), E = 130 * (c / 250), st = 150 * (l / 200), C = 110 * (c / 250), J = 170 * (l / 200), U = 130 * (c / 250), s = 150 * (l / 200), v = 150 * (c / 250), g = 130 * (l / 200), i = 190 * (c / 250), j = 150 * (l / 200), n = 150 * (c / 250), k = 170 * (l / 200), tt = 190 * (c / 250), M = r === 0 || r <= f * 0.5 ? "#1f2937" : r <= f * 0.75 ? "#f59e0b" : "#ec4c44";
|
|
210
|
+
return /* @__PURE__ */ p(
|
|
211
|
+
"svg",
|
|
212
|
+
{
|
|
213
|
+
width: l,
|
|
214
|
+
height: c,
|
|
215
|
+
style: {
|
|
216
|
+
display: "block",
|
|
217
|
+
margin: "0 auto"
|
|
218
|
+
},
|
|
219
|
+
children: [
|
|
220
|
+
r > 0 && /* @__PURE__ */ e(
|
|
221
|
+
"line",
|
|
222
|
+
{
|
|
223
|
+
x1: W,
|
|
224
|
+
y1: w,
|
|
225
|
+
x2: m,
|
|
226
|
+
y2: w,
|
|
227
|
+
stroke: M,
|
|
228
|
+
strokeWidth: b
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
r > 1 && /* @__PURE__ */ e(
|
|
232
|
+
"line",
|
|
233
|
+
{
|
|
234
|
+
x1: y,
|
|
235
|
+
y1: K,
|
|
236
|
+
x2: y,
|
|
237
|
+
y2: _,
|
|
238
|
+
stroke: M,
|
|
239
|
+
strokeWidth: b
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
r > 2 && /* @__PURE__ */ e(
|
|
243
|
+
"line",
|
|
244
|
+
{
|
|
245
|
+
x1: S,
|
|
246
|
+
y1: V,
|
|
247
|
+
x2: L,
|
|
248
|
+
y2: V,
|
|
249
|
+
stroke: M,
|
|
250
|
+
strokeWidth: b
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
r > 3 && /* @__PURE__ */ e(
|
|
254
|
+
"line",
|
|
255
|
+
{
|
|
256
|
+
x1: H,
|
|
257
|
+
y1: F,
|
|
258
|
+
x2: H,
|
|
259
|
+
y2: R,
|
|
260
|
+
stroke: M,
|
|
261
|
+
strokeWidth: b
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
r > 4 && /* @__PURE__ */ e(
|
|
265
|
+
"circle",
|
|
266
|
+
{
|
|
267
|
+
cx: T,
|
|
268
|
+
cy: I,
|
|
269
|
+
r: P,
|
|
270
|
+
stroke: M,
|
|
271
|
+
fill: "none",
|
|
272
|
+
strokeWidth: b
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
r > 5 && /* @__PURE__ */ e(
|
|
276
|
+
"line",
|
|
277
|
+
{
|
|
278
|
+
x1: B,
|
|
279
|
+
y1: q,
|
|
280
|
+
x2: B,
|
|
281
|
+
y2: O,
|
|
282
|
+
stroke: M,
|
|
283
|
+
strokeWidth: b
|
|
284
|
+
}
|
|
285
|
+
),
|
|
286
|
+
r > 6 && /* @__PURE__ */ e(
|
|
287
|
+
"line",
|
|
288
|
+
{
|
|
289
|
+
x1: u,
|
|
290
|
+
y1: z,
|
|
291
|
+
x2: h,
|
|
292
|
+
y2: E,
|
|
293
|
+
stroke: M,
|
|
294
|
+
strokeWidth: b
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
r > 7 && /* @__PURE__ */ e(
|
|
298
|
+
"line",
|
|
299
|
+
{
|
|
300
|
+
x1: st,
|
|
301
|
+
y1: C,
|
|
302
|
+
x2: J,
|
|
303
|
+
y2: U,
|
|
304
|
+
stroke: M,
|
|
305
|
+
strokeWidth: b
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
r > 8 && /* @__PURE__ */ e(
|
|
309
|
+
"line",
|
|
310
|
+
{
|
|
311
|
+
x1: s,
|
|
312
|
+
y1: v,
|
|
313
|
+
x2: g,
|
|
314
|
+
y2: i,
|
|
315
|
+
stroke: M,
|
|
316
|
+
strokeWidth: b
|
|
317
|
+
}
|
|
318
|
+
),
|
|
319
|
+
r > 9 && /* @__PURE__ */ e(
|
|
320
|
+
"line",
|
|
321
|
+
{
|
|
322
|
+
x1: j,
|
|
323
|
+
y1: n,
|
|
324
|
+
x2: k,
|
|
325
|
+
y2: tt,
|
|
326
|
+
stroke: M,
|
|
327
|
+
strokeWidth: b
|
|
328
|
+
}
|
|
329
|
+
)
|
|
330
|
+
]
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
function Mt({
|
|
335
|
+
gameCubeSize: r = 400,
|
|
336
|
+
screenHeight: f = 800,
|
|
337
|
+
screenWidth: x = 800,
|
|
338
|
+
logoUrl: l,
|
|
339
|
+
showLogo: c = !0,
|
|
340
|
+
baseURL: b
|
|
341
|
+
} = {}) {
|
|
342
|
+
const W = {
|
|
343
|
+
Professions: ["teacher", "doctor", "nurse", "driver", "police", "firefighter", "cook", "waiter", "farmer", "builder", "singer", "actor", "dentist", "pilot", "vet", "artist", "cleaner", "student", "baker", "mechanic"],
|
|
344
|
+
Family: ["mother", "father", "sister", "brother", "grandmother", "grandfather", "aunt", "uncle", "cousin", "baby", "parents", "children", "wife", "husband", "son", "daughter", "family", "twins", "relatives"],
|
|
345
|
+
"Farm animals": ["cow", "pig", "horse", "sheep", "goat", "duck", "chicken", "rooster", "turkey", "goose", "rabbit", "mouse", "donkey", "bee", "hen", "lamb", "bull", "pony"],
|
|
346
|
+
Food: ["apple", "banana", "bread", "cheese", "milk", "egg", "rice", "soup", "fish", "meat", "potato", "carrot", "tomato", "cucumber", "butter", "cake", "salad", "pasta", "pizza", "juice"],
|
|
347
|
+
Hobbies: ["reading", "drawing", "painting", "dancing", "singing", "cooking", "swimming", "fishing", "running", "cycling", "skating", "writing", "camping", "photography", "hiking", "games"],
|
|
348
|
+
Christmas: ["tree", "present", "gift", "santa", "snow", "snowman", "bell", "star", "lights", "card", "cookies", "elf", "sleigh", "reindeer", "candle", "stocking"],
|
|
349
|
+
Halloween: ["pumpkin", "costume", "candy", "ghost", "witch", "spider", "bat", "skeleton", "mask", "monster", "mummy", "cat", "broom", "zombie", "trick", "treat", "candle", "night", "party"],
|
|
350
|
+
Sport: ["football", "basketball", "tennis", "swimming", "running", "baseball", "skiing", "skating", "volleyball", "hockey", "golf", "boxing", "cycling", "rugby", "karate", "yoga", "surfing", "climbing", "dancing", "gym", "chess"],
|
|
351
|
+
"Body parts": ["head", "hair", "eyes", "ears", "nose", "mouth", "teeth", "tongue", "neck", "shoulder", "arm", "hand", "finger", "leg", "knee", "foot", "toe", "back", "stomach", "heart", "legs", "nails", "chin", "beard"],
|
|
352
|
+
"School subjects": ["math", "english", "history", "geography", "art", "music", "science", "biology", "chemistry", "physics", "pe", "literature", "drama", "design", "economics"],
|
|
353
|
+
Animals: ["cat", "dog", "rabbit", "elephant", "lion", "tiger", "monkey", "bear", "fox", "wolf", "giraffe", "zebra", "crocodile", "dolphin", "whale", "shark", "frog", "parrot", "mouse", "penguin", "deer", "lizard", "turtle", "snake"],
|
|
354
|
+
Countries: ["russia", "canada", "china", "japan", "france", "germany", "italy", "spain", "brazil", "india", "australia", "america", "england", "korea", "mexico", "egypt", "turkey", "vietnam", "norway", "finland", "thailand", "georgia", "kazakhstan"],
|
|
355
|
+
Clothes: ["shirt", "dress", "skirt", "trousers", "jeans", "coat", "jacket", "sweater", "socks", "shoes", "boots", "hat", "scarf", "gloves", "shorts", "cap", "belt", "tie", "uniform", "pants", "underwear"],
|
|
356
|
+
Traveling: ["ticket", "luggage", "suitcase", "airport", "flight", "passport", "visa", "map", "guide", "hotel", "reservation", "bus", "train", "taxi", "tourist", "sightseeing", "backpack", "journey", "adventure", "beach", "tour", "souvenir"],
|
|
357
|
+
Environment: ["tree", "forest", "air", "water", "pollution", "recycle", "nature", "clean", "waste", "plastic", "energy", "animal", "climate", "earth", "ocean", "river", "planet", "save", "green", "environment", "litter", "organic"],
|
|
358
|
+
Space: ["planet", "star", "sun", "moon", "astronaut", "rocket", "space", "galaxy", "universe", "telescope", "comet", "asteroid", "orbit", "gravity", "alien", "spaceship", "mars", "satellite", "sky", "eclipse"],
|
|
359
|
+
Devices: ["computer", "laptop", "phone", "tablet", "tv", "keyboard", "mouse", "printer", "camera", "headphones", "charger", "screen", "watch", "microphone", "speaker", "console", "router", "battery", "cable", "remote"]
|
|
360
|
+
}, [w, m] = $("lobby"), [y, K] = $(""), [_] = $("Normal"), [S, V] = $(0), [L, H] = $(1), [F, R] = $(""), [T, I] = $([]), [P, B] = $(0), [q, O] = $(0), [u, z] = $(null), [h, E] = $(null), [st, C] = $([]), J = _ === "Easy" ? 8 : _ === "Normal" ? 6 : 4, U = b || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman` : "/cloud/speakid/games/hangman"), s = (x ?? (typeof window < "u" ? window.innerWidth : 800)) < 768 || (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 926 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 428 || (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 932 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 430 || r < 600, v = (x ?? (typeof window < "u" ? window.innerWidth : 800)) === 1024 && (f ?? (typeof window < "u" ? window.innerHeight : 800)) === 600, g = r / 400, i = {
|
|
361
|
+
headline1: s ? Math.max(24, Math.min(30, 30 * g)) : Math.max(28, Math.min(32, 32 * g)),
|
|
362
|
+
// Desktop: 24px
|
|
363
|
+
headline3: s ? Math.max(14, Math.min(18, 16 * g)) : Math.max(20, Math.min(26, 24 * g)),
|
|
364
|
+
// Desktop: 24px
|
|
365
|
+
bodyL: Math.max(14, Math.min(20, 18 * g)),
|
|
366
|
+
// Desktop: 18px
|
|
367
|
+
bodyM: s ? Math.max(12, Math.min(16, 14 * g)) : Math.max(14, Math.min(18, 16 * g)),
|
|
368
|
+
// Desktop: 16px
|
|
369
|
+
bodyS: s ? Math.max(10, Math.min(14, 12 * g)) : Math.max(12, Math.min(16, 14 * g)),
|
|
370
|
+
// Desktop: 14px
|
|
371
|
+
wordDisplay: Math.max(18, Math.min(32, 26 * g)),
|
|
372
|
+
// Адаптивный размер
|
|
373
|
+
button: Math.max(12, Math.min(18, 16 * g))
|
|
374
|
+
// Desktop: 16px
|
|
375
|
+
}, j = v ? Math.max(8, Math.min(12, 10 * g)) : Math.max(12, Math.min(24, 16 * g)), n = v ? Math.max(3, Math.min(6, 5 * g)) : Math.max(4, Math.min(12, 8 * g)), k = Math.max(6, Math.min(10, 8 * g)), tt = (t, o) => t.split("").every((d) => o.includes(d)), lt = (t, o) => t.split("").map((d) => o.includes(d) ? d : "_").join(" "), M = (t) => "abcdefghijklmnopqrstuvwxyz".split("").filter((d) => !t.includes(d)), Z = (t, o = []) => {
|
|
376
|
+
var pt;
|
|
377
|
+
if (!t || !W[t]) {
|
|
378
|
+
const A = Object.keys(W)[0];
|
|
379
|
+
return ((pt = W[A]) == null ? void 0 : pt[0]) || "";
|
|
380
|
+
}
|
|
381
|
+
const d = W[t];
|
|
382
|
+
if (!d || d.length === 0)
|
|
383
|
+
return "";
|
|
384
|
+
const Y = d.filter((A) => !o.includes(A)), G = Y.length > 0 ? Y : d;
|
|
385
|
+
if (G.length === 0)
|
|
386
|
+
return "";
|
|
387
|
+
let N;
|
|
388
|
+
if (typeof crypto < "u" && crypto.getRandomValues) {
|
|
389
|
+
const A = new Uint32Array(1);
|
|
390
|
+
crypto.getRandomValues(A);
|
|
391
|
+
const yt = A[0] / 4294967295;
|
|
392
|
+
N = Math.floor(yt * G.length);
|
|
393
|
+
} else
|
|
394
|
+
N = Math.floor(Math.random() * G.length);
|
|
395
|
+
return G[N];
|
|
396
|
+
}, ut = () => {
|
|
397
|
+
if (!y) return;
|
|
398
|
+
C([]);
|
|
399
|
+
const t = Z(y, []);
|
|
400
|
+
if (!t) {
|
|
401
|
+
m("category");
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
R(t), C([t]), I([]), B(0), H(1), O(0), z(null), m("game");
|
|
405
|
+
}, et = it((t) => {
|
|
406
|
+
if (w !== "game" || u !== null) return;
|
|
407
|
+
const o = t.toLowerCase();
|
|
408
|
+
/^[a-z]$/.test(o) && (I((d) => d.includes(o) ? d : [...d, o]), R((d) => (d && !d.includes(o) && B((Y) => Y + 1), d)));
|
|
409
|
+
}, [w, u]), nt = it((t) => {
|
|
410
|
+
et(t.key);
|
|
411
|
+
}, [et]);
|
|
412
|
+
at(() => {
|
|
413
|
+
if (w === "game")
|
|
414
|
+
return window.addEventListener("keydown", nt), () => window.removeEventListener("keydown", nt);
|
|
415
|
+
}, [w, nt]);
|
|
416
|
+
const mt = F ? lt(F, T) : "", dt = F ? tt(F, T) : !1, ct = P >= 10, ht = M(T), ot = it(() => {
|
|
417
|
+
if (!y || L >= S) {
|
|
418
|
+
m("result");
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
H((t) => t + 1), C((t) => {
|
|
422
|
+
const o = Z(y, t);
|
|
423
|
+
return o ? (R(o), [...t, o]) : t;
|
|
424
|
+
}), I([]), B(0), z(null);
|
|
425
|
+
}, [y, L, S]);
|
|
426
|
+
at(() => {
|
|
427
|
+
if (dt && u === null) {
|
|
428
|
+
z("win"), O((o) => o + 1);
|
|
429
|
+
const t = setTimeout(() => {
|
|
430
|
+
ot();
|
|
431
|
+
}, 2e3);
|
|
432
|
+
return () => clearTimeout(t);
|
|
433
|
+
}
|
|
434
|
+
if (ct && u === null) {
|
|
435
|
+
z("lose");
|
|
436
|
+
const t = setTimeout(() => {
|
|
437
|
+
ot();
|
|
438
|
+
}, 2e3);
|
|
439
|
+
return () => clearTimeout(t);
|
|
440
|
+
}
|
|
441
|
+
}, [dt, ct, u, ot]);
|
|
442
|
+
const ft = () => {
|
|
443
|
+
if (!y || L >= S) {
|
|
444
|
+
m("result");
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
H((t) => t + 1), C((t) => {
|
|
448
|
+
const o = Z(y, t);
|
|
449
|
+
return o ? (R(o), [...t, o]) : t;
|
|
450
|
+
}), I([]), B(0), z(null);
|
|
451
|
+
};
|
|
452
|
+
at(() => {
|
|
453
|
+
const t = x ?? window.innerWidth, o = f ?? window.innerHeight, d = o < 700;
|
|
454
|
+
if (s)
|
|
455
|
+
E(r && r >= 320 ? r : null);
|
|
456
|
+
else if (v) {
|
|
457
|
+
const Y = r ? Math.max(400, Math.min(950, r)) : Math.min(950, Math.min(t * 0.92, o * 0.92));
|
|
458
|
+
E(Y);
|
|
459
|
+
} else if (d)
|
|
460
|
+
E(r && r >= 400 ? r : null);
|
|
461
|
+
else {
|
|
462
|
+
const N = r ? Math.max(400, Math.min(1200, r)) : Math.min(1e3, Math.min(t, o) * 0.9);
|
|
463
|
+
E(N);
|
|
464
|
+
}
|
|
465
|
+
}, [x, f, r, s, v]);
|
|
466
|
+
const X = {
|
|
467
|
+
width: "100%",
|
|
468
|
+
height: "100%",
|
|
469
|
+
display: "flex",
|
|
470
|
+
justifyContent: "center",
|
|
471
|
+
alignItems: "center",
|
|
472
|
+
background: "transparent",
|
|
473
|
+
overflow: "hidden",
|
|
474
|
+
position: "absolute",
|
|
475
|
+
top: 0,
|
|
476
|
+
left: 0,
|
|
477
|
+
right: 0,
|
|
478
|
+
bottom: 0
|
|
479
|
+
}, rt = `
|
|
480
|
+
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg" style="position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0.2;">
|
|
481
|
+
<!-- Каракули мелками и фломастерами -->
|
|
482
|
+
|
|
483
|
+
<!-- Сердечко -->
|
|
484
|
+
<path d="M 85% 15% Q 85% 10%, 90% 10% Q 95% 10%, 95% 15% Q 95% 20%, 90% 25% Q 85% 30%, 85% 15%"
|
|
485
|
+
fill="none" stroke="#FF69B4" stroke-width="3" stroke-linecap="round"/>
|
|
486
|
+
|
|
487
|
+
<!-- Звезда -->
|
|
488
|
+
<path d="M 10% 85% L 12% 80% L 14% 85% L 18% 85% L 13% 88% L 15% 92% L 10% 89% L 5% 92% L 7% 88% L 2% 85% Z"
|
|
489
|
+
fill="#FFA500" stroke="#FF8C00" stroke-width="1.5"/>
|
|
490
|
+
|
|
491
|
+
<!-- Волнистые линии (мелки) -->
|
|
492
|
+
<path d="M 20% 25% Q 22% 23%, 24% 25% T 28% 25% T 32% 25%"
|
|
493
|
+
fill="none" stroke="#FF6B6B" stroke-width="3.5" stroke-linecap="round"/>
|
|
494
|
+
<path d="M 60% 30% Q 62% 28%, 64% 30% T 68% 30% T 72% 30%"
|
|
495
|
+
fill="none" stroke="#4ECDC4" stroke-width="3.5" stroke-linecap="round"/>
|
|
496
|
+
|
|
497
|
+
<!-- Спираль -->
|
|
498
|
+
<path d="M 5% 45% Q 8% 42%, 10% 45% Q 12% 48%, 10% 50% Q 8% 52%, 5% 50% Q 3% 48%, 5% 45%"
|
|
499
|
+
fill="none" stroke="#9B59B6" stroke-width="3" stroke-linecap="round"/>
|
|
500
|
+
|
|
501
|
+
<!-- Зигзаг -->
|
|
502
|
+
<path d="M 88% 55% L 92% 50% L 94% 55% L 96% 50% L 98% 55%"
|
|
503
|
+
fill="none" stroke="#E74C3C" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
504
|
+
|
|
505
|
+
<!-- Ромашка -->
|
|
506
|
+
<circle cx="25%" cy="70%" r="15" fill="none" stroke="#FFD700" stroke-width="2.5"/>
|
|
507
|
+
<circle cx="25%" cy="70%" r="8" fill="#FFD700"/>
|
|
508
|
+
<line x1="25%" y1="70%" x2="22%" y2="65%" stroke="#FFFFFF" stroke-width="2.5"/>
|
|
509
|
+
<line x1="25%" y1="70%" x2="28%" y2="65%" stroke="#FFFFFF" stroke-width="2.5"/>
|
|
510
|
+
<line x1="25%" y1="70%" x2="22%" y2="75%" stroke="#FFFFFF" stroke-width="2.5"/>
|
|
511
|
+
<line x1="25%" y1="70%" x2="28%" y2="75%" stroke="#FFFFFF" stroke-width="2.5"/>
|
|
512
|
+
|
|
513
|
+
<!-- Каляки-маляки (случайные линии) -->
|
|
514
|
+
<path d="M 40% 20% Q 42% 22%, 40% 24% T 40% 28%"
|
|
515
|
+
fill="none" stroke="#32CD32" stroke-width="3" stroke-linecap="round"/>
|
|
516
|
+
<path d="M 50% 60% L 53% 57% L 55% 60% L 57% 57%"
|
|
517
|
+
fill="none" stroke="#FF1493" stroke-width="3" stroke-linecap="round"/>
|
|
518
|
+
|
|
519
|
+
<!-- Еще волнистые линии -->
|
|
520
|
+
<path d="M 35% 85% Q 37% 83%, 39% 85% T 43% 85% T 47% 85%"
|
|
521
|
+
fill="none" stroke="#FF4500" stroke-width="3.5" stroke-linecap="round"/>
|
|
522
|
+
</svg>
|
|
523
|
+
`, D = {
|
|
524
|
+
...a.gmCenterScreen,
|
|
525
|
+
width: s ? "100%" : v ? h || r || 950 : h || r || 1e3,
|
|
526
|
+
height: s ? "100%" : v ? "auto" : h || r || 1e3,
|
|
527
|
+
minHeight: s ? "100%" : v ? "auto" : h || r || 1e3,
|
|
528
|
+
maxHeight: s ? "100%" : v ? "92vh" : h || r || 1e3,
|
|
529
|
+
padding: `${j}px`,
|
|
530
|
+
overflow: "auto",
|
|
531
|
+
borderRadius: s ? 0 : "20px",
|
|
532
|
+
position: "relative",
|
|
533
|
+
boxSizing: "border-box",
|
|
534
|
+
background: "#ffffff",
|
|
535
|
+
// Белый фон как на скриншоте
|
|
536
|
+
boxShadow: s ? "none" : "0 0 40px rgba(0,0,0,0.1)",
|
|
537
|
+
// Легкая тень для десктопа
|
|
538
|
+
margin: s ? "0 auto" : "unset"
|
|
539
|
+
}, gt = !s && c, Q = xt(
|
|
540
|
+
() => {
|
|
541
|
+
if (s && (x ?? window.innerWidth) > (f ?? window.innerHeight) || (f ?? window.innerHeight) < 700 || !gt)
|
|
542
|
+
return null;
|
|
543
|
+
const t = l || (typeof window < "u" && window.origin ? `${window.origin}/cloud/speakid/games/hangman/logo` : "/cloud/speakid/games/hangman/logo");
|
|
544
|
+
return /* @__PURE__ */ e("div", { style: { ...a.gmLogoFixed, position: "absolute", top: 16, left: 16, zIndex: 30 }, children: /* @__PURE__ */ p("picture", { children: [
|
|
545
|
+
/* @__PURE__ */ e(
|
|
546
|
+
"source",
|
|
547
|
+
{
|
|
548
|
+
srcSet: `${t}.svg`,
|
|
549
|
+
type: "image/svg+xml"
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
/* @__PURE__ */ e(
|
|
553
|
+
"img",
|
|
554
|
+
{
|
|
555
|
+
src: `${t}.png`,
|
|
556
|
+
alt: "SPEAKID Logo",
|
|
557
|
+
style: a.gmLogoImg,
|
|
558
|
+
loading: "lazy"
|
|
559
|
+
}
|
|
560
|
+
)
|
|
561
|
+
] }) });
|
|
562
|
+
},
|
|
563
|
+
[s, gt, l, x, f]
|
|
564
|
+
);
|
|
565
|
+
return w === "lobby" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
|
|
566
|
+
Q,
|
|
567
|
+
/* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
|
|
568
|
+
/* @__PURE__ */ e("h1", { style: {
|
|
569
|
+
...a.gmHeadline1,
|
|
570
|
+
fontSize: `${i.headline1}px`,
|
|
571
|
+
marginBottom: `${n * 3}px`,
|
|
572
|
+
position: "relative",
|
|
573
|
+
zIndex: 1
|
|
574
|
+
}, children: "HANGMAN" }),
|
|
575
|
+
/* @__PURE__ */ p(
|
|
576
|
+
"button",
|
|
577
|
+
{
|
|
578
|
+
onClick: () => m("category"),
|
|
579
|
+
style: {
|
|
580
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
581
|
+
fontWeight: 500,
|
|
582
|
+
// Medium для более заметности
|
|
583
|
+
fontSize: `${i.button}px`,
|
|
584
|
+
padding: `${n * 1.2}px ${n * 3}px`,
|
|
585
|
+
borderRadius: `${k * 1.5}px`,
|
|
586
|
+
position: "relative",
|
|
587
|
+
zIndex: 1,
|
|
588
|
+
display: "flex",
|
|
589
|
+
alignItems: "center",
|
|
590
|
+
justifyContent: "center",
|
|
591
|
+
background: "#ec4c44",
|
|
592
|
+
color: "#ffffff",
|
|
593
|
+
border: "none",
|
|
594
|
+
cursor: "pointer",
|
|
595
|
+
transition: "background 0.2s ease, transform 0.1s ease",
|
|
596
|
+
boxShadow: "0 2px 8px rgba(236, 76, 68, 0.2)",
|
|
597
|
+
minWidth: "120px"
|
|
598
|
+
},
|
|
599
|
+
onMouseEnter: (t) => {
|
|
600
|
+
t.currentTarget.style.background = "#d43a32", t.currentTarget.style.transform = "translateY(-2px)", t.currentTarget.style.boxShadow = "0 4px 12px rgba(236, 76, 68, 0.3)";
|
|
601
|
+
},
|
|
602
|
+
onMouseLeave: (t) => {
|
|
603
|
+
t.currentTarget.style.background = "#ec4c44", t.currentTarget.style.transform = "translateY(0)", t.currentTarget.style.boxShadow = "0 2px 8px rgba(236, 76, 68, 0.2)";
|
|
604
|
+
},
|
|
605
|
+
onMouseDown: (t) => {
|
|
606
|
+
t.currentTarget.style.transform = "translateY(0)";
|
|
607
|
+
},
|
|
608
|
+
children: [
|
|
609
|
+
/* @__PURE__ */ e(
|
|
610
|
+
"svg",
|
|
611
|
+
{
|
|
612
|
+
width: `${i.button * 1.3}px`,
|
|
613
|
+
height: `${i.button * 1.3}px`,
|
|
614
|
+
viewBox: "0 0 24 24",
|
|
615
|
+
fill: "none",
|
|
616
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
617
|
+
style: { display: "block", marginRight: `${n}px` },
|
|
618
|
+
children: /* @__PURE__ */ e(
|
|
619
|
+
"path",
|
|
620
|
+
{
|
|
621
|
+
d: "M8 5V19L19 12L8 5Z",
|
|
622
|
+
fill: "#ffffff",
|
|
623
|
+
stroke: "none"
|
|
624
|
+
}
|
|
625
|
+
)
|
|
626
|
+
}
|
|
627
|
+
),
|
|
628
|
+
/* @__PURE__ */ e("span", { style: { fontWeight: 500 }, children: "PLAY" })
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
),
|
|
632
|
+
/* @__PURE__ */ p("div", { style: {
|
|
633
|
+
position: "absolute",
|
|
634
|
+
top: "50%",
|
|
635
|
+
left: "50%",
|
|
636
|
+
transform: "translate(-50%, -50%)",
|
|
637
|
+
width: "100%",
|
|
638
|
+
height: "100%",
|
|
639
|
+
pointerEvents: "none",
|
|
640
|
+
zIndex: 0
|
|
641
|
+
}, children: [
|
|
642
|
+
/* @__PURE__ */ e(
|
|
643
|
+
"img",
|
|
644
|
+
{
|
|
645
|
+
src: `${U}/sun.png`,
|
|
646
|
+
alt: "Sun",
|
|
647
|
+
style: {
|
|
648
|
+
position: "absolute",
|
|
649
|
+
left: s ? "-10%" : "5%",
|
|
650
|
+
top: "20%",
|
|
651
|
+
width: "auto",
|
|
652
|
+
height: s ? `${Math.min(f * 0.33, 200)}px` : `${Math.min((h || r) * 0.33, 300)}px`,
|
|
653
|
+
maxHeight: "33vh",
|
|
654
|
+
objectFit: "contain",
|
|
655
|
+
opacity: 0.6
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
),
|
|
659
|
+
/* @__PURE__ */ e(
|
|
660
|
+
"img",
|
|
661
|
+
{
|
|
662
|
+
src: `${U}/character.png`,
|
|
663
|
+
alt: "Hangman character",
|
|
664
|
+
style: {
|
|
665
|
+
position: "absolute",
|
|
666
|
+
right: s ? "5%" : "10%",
|
|
667
|
+
bottom: "10%",
|
|
668
|
+
width: "auto",
|
|
669
|
+
height: s ? `${Math.min(f * 0.33, 200)}px` : `${Math.min((h || r) * 0.33, 300)}px`,
|
|
670
|
+
maxHeight: "33vh",
|
|
671
|
+
objectFit: "contain",
|
|
672
|
+
opacity: 0.6
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
)
|
|
676
|
+
] })
|
|
677
|
+
] }) }) : w === "category" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
|
|
678
|
+
Q,
|
|
679
|
+
/* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
|
|
680
|
+
/* @__PURE__ */ e(
|
|
681
|
+
"button",
|
|
682
|
+
{
|
|
683
|
+
onClick: () => m("lobby"),
|
|
684
|
+
onMouseEnter: (t) => {
|
|
685
|
+
t.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
686
|
+
},
|
|
687
|
+
onMouseLeave: (t) => {
|
|
688
|
+
t.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
689
|
+
},
|
|
690
|
+
style: {
|
|
691
|
+
...a.gmButton,
|
|
692
|
+
...a.gmButtonSecondary,
|
|
693
|
+
fontSize: `${i.button}px`,
|
|
694
|
+
padding: `${n}px ${n * 1.5}px`,
|
|
695
|
+
borderRadius: `${k}px`,
|
|
696
|
+
position: "absolute",
|
|
697
|
+
top: `${j}px`,
|
|
698
|
+
left: `${j}px`,
|
|
699
|
+
zIndex: 10
|
|
700
|
+
},
|
|
701
|
+
children: "←"
|
|
702
|
+
}
|
|
703
|
+
),
|
|
704
|
+
/* @__PURE__ */ e("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, marginTop: `${n * 4}px`, position: "relative", zIndex: 1 }, children: Object.keys(W).map((t) => /* @__PURE__ */ e(
|
|
705
|
+
"button",
|
|
706
|
+
{
|
|
707
|
+
onClick: () => {
|
|
708
|
+
K(t), m("rounds");
|
|
709
|
+
},
|
|
710
|
+
onMouseEnter: (o) => {
|
|
711
|
+
o.currentTarget.style.backgroundColor = "#f0f0f0", o.currentTarget.style.borderColor = "#1f2937", o.currentTarget.style.transform = "scale(1.05)";
|
|
712
|
+
},
|
|
713
|
+
onMouseLeave: (o) => {
|
|
714
|
+
o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.borderColor = "#e5e7eb", o.currentTarget.style.transform = "scale(1)";
|
|
715
|
+
},
|
|
716
|
+
style: {
|
|
717
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
718
|
+
fontWeight: 500,
|
|
719
|
+
fontSize: `${i.button}px`,
|
|
720
|
+
padding: `${n * 1.2}px ${n * 2}px`,
|
|
721
|
+
borderRadius: `${k * 2}px`,
|
|
722
|
+
// Более округлые для облачков
|
|
723
|
+
margin: `${n / 2}px`,
|
|
724
|
+
background: "transparent",
|
|
725
|
+
border: "2px solid #e5e7eb",
|
|
726
|
+
color: "#1f2937",
|
|
727
|
+
cursor: "pointer",
|
|
728
|
+
transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
|
|
729
|
+
boxShadow: "none"
|
|
730
|
+
},
|
|
731
|
+
children: t
|
|
732
|
+
},
|
|
733
|
+
t
|
|
734
|
+
)) })
|
|
735
|
+
] }) }) : w === "rounds" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
|
|
736
|
+
Q,
|
|
737
|
+
/* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: rt } }),
|
|
738
|
+
/* @__PURE__ */ e(
|
|
739
|
+
"button",
|
|
740
|
+
{
|
|
741
|
+
onClick: () => m("category"),
|
|
742
|
+
onMouseEnter: (t) => {
|
|
743
|
+
t.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
744
|
+
},
|
|
745
|
+
onMouseLeave: (t) => {
|
|
746
|
+
t.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
747
|
+
},
|
|
748
|
+
style: {
|
|
749
|
+
...a.gmButton,
|
|
750
|
+
...a.gmButtonSecondary,
|
|
751
|
+
fontSize: `${i.button}px`,
|
|
752
|
+
padding: `${n}px ${n * 1.5}px`,
|
|
753
|
+
borderRadius: `${k}px`,
|
|
754
|
+
position: "absolute",
|
|
755
|
+
top: `${j}px`,
|
|
756
|
+
left: `${j}px`,
|
|
757
|
+
zIndex: 10
|
|
758
|
+
},
|
|
759
|
+
children: "←"
|
|
760
|
+
}
|
|
761
|
+
),
|
|
762
|
+
/* @__PURE__ */ e("h1", { style: { ...a.gmHeadline1, fontSize: `${i.headline1}px`, marginBottom: `${n * 2}px`, position: "relative", zIndex: 1 }, children: "Choose rounds" }),
|
|
763
|
+
/* @__PURE__ */ e("div", { style: { ...a.gmButtonGroup, gap: `${n}px`, marginBottom: `${n * 3}px`, position: "relative", zIndex: 1 }, children: [1, 3, 5].map((t) => /* @__PURE__ */ e(
|
|
764
|
+
"button",
|
|
765
|
+
{
|
|
766
|
+
onClick: () => {
|
|
767
|
+
V(t), ut();
|
|
768
|
+
},
|
|
769
|
+
onMouseEnter: (o) => {
|
|
770
|
+
o.currentTarget.style.backgroundColor = "#f0f0f0", o.currentTarget.style.borderColor = "#1f2937", o.currentTarget.style.transform = "scale(1.05)";
|
|
771
|
+
},
|
|
772
|
+
onMouseLeave: (o) => {
|
|
773
|
+
o.currentTarget.style.backgroundColor = "transparent", o.currentTarget.style.borderColor = "#e5e7eb", o.currentTarget.style.transform = "scale(1)";
|
|
774
|
+
},
|
|
775
|
+
style: {
|
|
776
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
777
|
+
fontWeight: 500,
|
|
778
|
+
fontSize: `${i.button}px`,
|
|
779
|
+
padding: `${n * 1.2}px ${n * 2}px`,
|
|
780
|
+
borderRadius: `${k * 2}px`,
|
|
781
|
+
// Более округлые для облачков
|
|
782
|
+
margin: `${n / 2}px`,
|
|
783
|
+
background: "transparent",
|
|
784
|
+
border: "2px solid #e5e7eb",
|
|
785
|
+
color: "#1f2937",
|
|
786
|
+
cursor: "pointer",
|
|
787
|
+
transition: "background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease",
|
|
788
|
+
boxShadow: "none"
|
|
789
|
+
},
|
|
790
|
+
children: t
|
|
791
|
+
},
|
|
792
|
+
t
|
|
793
|
+
)) })
|
|
794
|
+
] }) }) : w === "game" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
|
|
795
|
+
Q,
|
|
796
|
+
/* @__PURE__ */ p("div", { style: {
|
|
797
|
+
...a.gmInfoBox,
|
|
798
|
+
padding: `${n * 0.8}px`,
|
|
799
|
+
marginBottom: `${n * 0.5}px`,
|
|
800
|
+
maxWidth: `${(h || r) * 0.9}px`
|
|
801
|
+
}, children: [
|
|
802
|
+
/* @__PURE__ */ p("h3", { style: { ...a.gmHeadline3, fontSize: `${i.headline3}px`, marginBottom: `${n * 0.5}px` }, children: [
|
|
803
|
+
"Category: ",
|
|
804
|
+
y
|
|
805
|
+
] }),
|
|
806
|
+
/* @__PURE__ */ p("p", { style: { ...a.gmBodyM, fontSize: `${i.bodyM}px`, marginBottom: "0px" }, children: [
|
|
807
|
+
"Round ",
|
|
808
|
+
L,
|
|
809
|
+
" of ",
|
|
810
|
+
S
|
|
811
|
+
] })
|
|
812
|
+
] }),
|
|
813
|
+
F && /* @__PURE__ */ p("p", { style: {
|
|
814
|
+
...a.gmBodyS,
|
|
815
|
+
fontSize: `${i.bodyS}px`,
|
|
816
|
+
marginTop: `${n * 0.5}px`,
|
|
817
|
+
marginBottom: `${n}px`
|
|
818
|
+
}, children: [
|
|
819
|
+
"I am thinking of a word that is ",
|
|
820
|
+
/* @__PURE__ */ e("strong", { children: F.length }),
|
|
821
|
+
" letters long"
|
|
822
|
+
] }),
|
|
823
|
+
/* @__PURE__ */ e("div", { style: {
|
|
824
|
+
margin: `${n}px 0`,
|
|
825
|
+
display: "flex",
|
|
826
|
+
justifyContent: "center",
|
|
827
|
+
alignItems: "center"
|
|
828
|
+
}, children: /* @__PURE__ */ e(
|
|
829
|
+
bt,
|
|
830
|
+
{
|
|
831
|
+
mistakes: P,
|
|
832
|
+
maxMistakes: J,
|
|
833
|
+
size: v ? Math.max(80, Math.min(110, (h || r) * 0.16)) : Math.max(100, Math.min(150, (h || r) * 0.2))
|
|
834
|
+
}
|
|
835
|
+
) }),
|
|
836
|
+
/* @__PURE__ */ e("div", { style: {
|
|
837
|
+
...a.gmWordDisplay,
|
|
838
|
+
fontSize: `${Math.max(16, Math.min(24, i.wordDisplay * 0.9))}px`,
|
|
839
|
+
margin: `${n}px 0`,
|
|
840
|
+
letterSpacing: `${n * 0.8}px`,
|
|
841
|
+
minHeight: `${Math.max(16, Math.min(24, i.wordDisplay * 0.9)) * 1.2}px`
|
|
842
|
+
}, children: mt || "Loading..." }),
|
|
843
|
+
/* @__PURE__ */ p("div", { style: {
|
|
844
|
+
...a.gmInfoBox,
|
|
845
|
+
padding: `${n}px`,
|
|
846
|
+
marginTop: `${n}px`,
|
|
847
|
+
marginBottom: `${n}px`,
|
|
848
|
+
maxWidth: `${(h || r) * 0.95}px`
|
|
849
|
+
}, children: [
|
|
850
|
+
/* @__PURE__ */ e("p", { style: {
|
|
851
|
+
...a.gmBodyS,
|
|
852
|
+
fontSize: `${i.bodyS}px`,
|
|
853
|
+
marginBottom: `${n}px`,
|
|
854
|
+
fontWeight: 500
|
|
855
|
+
// Medium
|
|
856
|
+
}, children: "Available letters:" }),
|
|
857
|
+
/* @__PURE__ */ e("div", { style: {
|
|
858
|
+
display: "flex",
|
|
859
|
+
flexWrap: "wrap",
|
|
860
|
+
gap: `${n / 3}px`,
|
|
861
|
+
justifyContent: "center",
|
|
862
|
+
fontSize: `${Math.max(9, Math.min(12, i.bodyS * 0.75))}px`,
|
|
863
|
+
fontFamily: '"Onest", system-ui, sans-serif'
|
|
864
|
+
}, children: ht.map((t) => /* @__PURE__ */ e(
|
|
865
|
+
"button",
|
|
866
|
+
{
|
|
867
|
+
onClick: () => et(t),
|
|
868
|
+
disabled: u !== null,
|
|
869
|
+
onMouseEnter: (o) => {
|
|
870
|
+
u === null && (o.currentTarget.style.backgroundColor = "#e5e7eb", o.currentTarget.style.cursor = "pointer");
|
|
871
|
+
},
|
|
872
|
+
onMouseLeave: (o) => {
|
|
873
|
+
u === null && (o.currentTarget.style.backgroundColor = "#f9f9f9", o.currentTarget.style.cursor = "pointer");
|
|
874
|
+
},
|
|
875
|
+
style: {
|
|
876
|
+
padding: `${n / 4}px ${n / 3}px`,
|
|
877
|
+
borderRadius: `${k * 0.5}px`,
|
|
878
|
+
background: "#f9f9f9",
|
|
879
|
+
color: "#1f2937",
|
|
880
|
+
border: "1px solid #e5e7eb",
|
|
881
|
+
minWidth: `${Math.max(n * 1.5, (h || r) * 0.04)}px`,
|
|
882
|
+
textAlign: "center",
|
|
883
|
+
display: "inline-block",
|
|
884
|
+
cursor: u === null ? "pointer" : "default",
|
|
885
|
+
fontFamily: '"Onest", system-ui, sans-serif',
|
|
886
|
+
fontSize: `${Math.max(9, Math.min(12, i.bodyS * 0.75))}px`,
|
|
887
|
+
transition: "background-color 0.2s ease"
|
|
888
|
+
},
|
|
889
|
+
children: t
|
|
890
|
+
},
|
|
891
|
+
t
|
|
892
|
+
)) })
|
|
893
|
+
] }),
|
|
894
|
+
T.length > 0 && /* @__PURE__ */ e("div", { style: {
|
|
895
|
+
...a.gmGuessedLetters,
|
|
896
|
+
fontSize: `${Math.max(10, Math.min(12, i.bodyS * 0.85))}px`,
|
|
897
|
+
marginTop: `${n * 0.5}px`,
|
|
898
|
+
marginBottom: "2px"
|
|
899
|
+
}, children: /* @__PURE__ */ p("span", { style: { color: "#6b7280" }, children: [
|
|
900
|
+
"Guessed letters: ",
|
|
901
|
+
/* @__PURE__ */ e("strong", { children: T.join(", ") })
|
|
902
|
+
] }) }),
|
|
903
|
+
u === "win" && /* @__PURE__ */ e("div", { style: {
|
|
904
|
+
...a.gmStatusWin,
|
|
905
|
+
fontSize: `${i.bodyL}px`,
|
|
906
|
+
margin: "2px 0"
|
|
907
|
+
}, children: "🎉 You won this round!" }),
|
|
908
|
+
u === "lose" && /* @__PURE__ */ p("div", { style: {
|
|
909
|
+
...a.gmStatusLose,
|
|
910
|
+
fontSize: `${i.bodyL}px`,
|
|
911
|
+
margin: "2px 0"
|
|
912
|
+
}, children: [
|
|
913
|
+
"The hangman is complete! The word was: ",
|
|
914
|
+
/* @__PURE__ */ e("strong", { children: F })
|
|
915
|
+
] }),
|
|
916
|
+
u !== null && L < S && /* @__PURE__ */ e("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ e(
|
|
917
|
+
"button",
|
|
918
|
+
{
|
|
919
|
+
onClick: ft,
|
|
920
|
+
onMouseEnter: (t) => {
|
|
921
|
+
t.currentTarget.style.backgroundColor = "#d43a32";
|
|
922
|
+
},
|
|
923
|
+
onMouseLeave: (t) => {
|
|
924
|
+
t.currentTarget.style.backgroundColor = "#ec4c44";
|
|
925
|
+
},
|
|
926
|
+
style: {
|
|
927
|
+
...a.gmButton,
|
|
928
|
+
fontSize: `${Math.max(11, Math.min(14, i.button * 0.85))}px`,
|
|
929
|
+
padding: `${n * 0.6}px ${n * 1.2}px`,
|
|
930
|
+
borderRadius: `${k}px`
|
|
931
|
+
},
|
|
932
|
+
children: "NEXT"
|
|
933
|
+
}
|
|
934
|
+
) }),
|
|
935
|
+
u !== null && L >= S && /* @__PURE__ */ e("div", { style: { marginTop: "2px", marginBottom: `${n}px` }, children: /* @__PURE__ */ e(
|
|
936
|
+
"button",
|
|
937
|
+
{
|
|
938
|
+
onClick: () => m("result"),
|
|
939
|
+
onMouseEnter: (t) => {
|
|
940
|
+
t.currentTarget.style.backgroundColor = "#d43a32";
|
|
941
|
+
},
|
|
942
|
+
onMouseLeave: (t) => {
|
|
943
|
+
t.currentTarget.style.backgroundColor = "#ec4c44";
|
|
944
|
+
},
|
|
945
|
+
style: {
|
|
946
|
+
...a.gmButton,
|
|
947
|
+
fontSize: `${i.button}px`,
|
|
948
|
+
padding: `${n}px ${n * 1.5}px`,
|
|
949
|
+
borderRadius: `${k}px`
|
|
950
|
+
},
|
|
951
|
+
children: "View Results →"
|
|
952
|
+
}
|
|
953
|
+
) }),
|
|
954
|
+
u === null && T.length === 0 && /* @__PURE__ */ e("p", { style: {
|
|
955
|
+
...a.gmBodyS,
|
|
956
|
+
fontSize: `${i.bodyS}px`,
|
|
957
|
+
marginTop: `${n}px`,
|
|
958
|
+
marginBottom: `${n}px`
|
|
959
|
+
}, children: "Type a letter on your keyboard" })
|
|
960
|
+
] }) }) : w === "result" ? /* @__PURE__ */ e("div", { style: X, children: /* @__PURE__ */ p("div", { style: D, children: [
|
|
961
|
+
Q,
|
|
962
|
+
/* @__PURE__ */ e("h1", { style: {
|
|
963
|
+
...a.gmHeadline1,
|
|
964
|
+
fontSize: `${i.headline1}px`,
|
|
965
|
+
marginBottom: `${n * 2}px`
|
|
966
|
+
}, children: "🎊 Game Finished!" }),
|
|
967
|
+
/* @__PURE__ */ p("p", { style: {
|
|
968
|
+
...a.gmBodyL,
|
|
969
|
+
fontSize: `${i.bodyL}px`,
|
|
970
|
+
marginBottom: `${n * 2}px`
|
|
971
|
+
}, children: [
|
|
972
|
+
"You guessed ",
|
|
973
|
+
/* @__PURE__ */ e("strong", { children: q }),
|
|
974
|
+
" out of ",
|
|
975
|
+
/* @__PURE__ */ e("strong", { children: S }),
|
|
976
|
+
" words correctly."
|
|
977
|
+
] }),
|
|
978
|
+
/* @__PURE__ */ p("div", { style: {
|
|
979
|
+
display: "flex",
|
|
980
|
+
flexDirection: "column",
|
|
981
|
+
gap: `${n}px`,
|
|
982
|
+
alignItems: "center"
|
|
983
|
+
}, children: [
|
|
984
|
+
/* @__PURE__ */ e(
|
|
985
|
+
"button",
|
|
986
|
+
{
|
|
987
|
+
onClick: () => {
|
|
988
|
+
if (!y || S === 0) {
|
|
989
|
+
m("lobby");
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
C([]);
|
|
993
|
+
const t = Z(y, []);
|
|
994
|
+
t && (R(t), C([t]), I([]), B(0), H(1), O(0), z(null), m("game"));
|
|
995
|
+
},
|
|
996
|
+
onMouseEnter: (t) => {
|
|
997
|
+
t.currentTarget.style.backgroundColor = "#d43a32";
|
|
998
|
+
},
|
|
999
|
+
onMouseLeave: (t) => {
|
|
1000
|
+
t.currentTarget.style.backgroundColor = "#ec4c44";
|
|
1001
|
+
},
|
|
1002
|
+
style: {
|
|
1003
|
+
...a.gmButton,
|
|
1004
|
+
fontSize: `${i.button}px`,
|
|
1005
|
+
padding: `${n}px ${n * 1.5}px`,
|
|
1006
|
+
borderRadius: `${k}px`,
|
|
1007
|
+
minWidth: "200px"
|
|
1008
|
+
},
|
|
1009
|
+
children: "Play again"
|
|
1010
|
+
}
|
|
1011
|
+
),
|
|
1012
|
+
/* @__PURE__ */ e(
|
|
1013
|
+
"button",
|
|
1014
|
+
{
|
|
1015
|
+
onClick: () => m("lobby"),
|
|
1016
|
+
onMouseEnter: (t) => {
|
|
1017
|
+
t.currentTarget.style.backgroundColor = "#e5e7eb";
|
|
1018
|
+
},
|
|
1019
|
+
onMouseLeave: (t) => {
|
|
1020
|
+
t.currentTarget.style.backgroundColor = "#f9f9f9";
|
|
1021
|
+
},
|
|
1022
|
+
style: {
|
|
1023
|
+
...a.gmButton,
|
|
1024
|
+
...a.gmButtonSecondary,
|
|
1025
|
+
fontSize: `${i.button}px`,
|
|
1026
|
+
padding: `${n}px ${n * 1.5}px`,
|
|
1027
|
+
borderRadius: `${k}px`,
|
|
1028
|
+
minWidth: "200px"
|
|
1029
|
+
},
|
|
1030
|
+
children: "Exit"
|
|
1031
|
+
}
|
|
1032
|
+
)
|
|
1033
|
+
] })
|
|
1034
|
+
] }) }) : null;
|
|
1035
|
+
}
|
|
1036
|
+
export {
|
|
1037
|
+
Mt as HangmanLobbyGame,
|
|
1038
|
+
Mt as default
|
|
1039
|
+
};
|
|
1040
|
+
//# sourceMappingURL=speakid-hangman.es.js.map
|