gonzmart commited on
Commit
979db68
·
1 Parent(s): 496791a

alfa version

Browse files
Files changed (10) hide show
  1. Dockerfile +26 -0
  2. package-lock.json +0 -0
  3. package.json +28 -0
  4. public/index.html +11 -0
  5. src/App.css +1020 -0
  6. src/App.js +360 -0
  7. src/data.json +387 -0
  8. src/data/messageDatabase.js +52 -0
  9. src/index.js +12 -0
  10. src/styles.css +90 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Node runtime as a parent image
2
+ FROM node:16
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy package.json and package-lock.json
8
+ COPY package*.json ./
9
+
10
+ # Install dependencies
11
+ RUN npm install
12
+
13
+ # Copy the rest of the application code
14
+ COPY . .
15
+
16
+ # Build the React app
17
+ RUN npm run build
18
+
19
+ # Install serve to serve the built app
20
+ RUN npm install -g serve
21
+
22
+ # Make port 7860 available to the world outside this container
23
+ EXPOSE 7860
24
+
25
+ # Run the app using serve
26
+ CMD ["serve", "-s", "build", "-l", "7860"]
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "react.dev",
3
+ "version": "0.0.0",
4
+ "main": "/src/index.js",
5
+ "scripts": {
6
+ "start": "react-scripts start",
7
+ "build": "react-scripts build",
8
+ "test": "react-scripts test --env=jsdom",
9
+ "eject": "react-scripts eject"
10
+ },
11
+ "dependencies": {
12
+ "react": "^18.0.0",
13
+ "react-dom": "^18.0.0",
14
+ "react-scripts": "^5.0.1"
15
+ },
16
+ "browserslist": {
17
+ "production": [
18
+ ">0.2%",
19
+ "not dead",
20
+ "not op_mini all"
21
+ ],
22
+ "development": [
23
+ "last 1 chrome version",
24
+ "last 1 firefox version",
25
+ "last 1 safari version"
26
+ ]
27
+ }
28
+ }
public/index.html ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Document</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ </body>
11
+ </html>
src/App.css ADDED
@@ -0,0 +1,1020 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *, *::before, *::after {
2
+ box-sizing: border-box;
3
+ margin: 0;
4
+ padding: 0;
5
+ }
6
+
7
+ :root {
8
+ --sz: 15px;
9
+ --c0: #000;
10
+ --c1: #333;
11
+ --primary: #10a37f;
12
+ --secondary: #1a7f64;
13
+ --dark: #202123;
14
+ --light: #f7f7f8;
15
+ --gray: #343541;
16
+ --success: #10a37f;
17
+ --accent: #e5e5e5;
18
+ --border-radius: 12px;
19
+ --border-radius-lg: 16px;
20
+ --box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
21
+ --transition: all 0.2s ease;
22
+ --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
23
+ --bg-gradient: linear-gradient(180deg, #f0f4f9 0%, #ffffff 100%);
24
+ --message-user: #10a37f;
25
+ --message-ai: #7f56d9;
26
+ --message-ai_2: #6731db;
27
+ --message-ai_3: #5b1ae8;
28
+ --message-error: #ef4444;
29
+ }
30
+
31
+ html, body {
32
+ width: 100%;
33
+ height: 100vh;
34
+ overflow: hidden;
35
+ }
36
+
37
+ html {
38
+ margin: 0;
39
+ padding: 0;
40
+ min-height: 100vh;
41
+ width: 100vw;
42
+ background: var(--gray);
43
+ position: relative;
44
+ overflow-x: hidden;
45
+ color: var(--light);
46
+ }
47
+
48
+ html::before {
49
+ content: '';
50
+ position: absolute;
51
+ top: 0;
52
+ left: 0;
53
+ right: 0;
54
+ bottom: 0;
55
+ background:
56
+ radial-gradient(circle at 20% 30%, rgba(16, 163, 127, 0.05), transparent 40%),
57
+ radial-gradient(circle at 80% 70%, rgba(127, 86, 217, 0.05), transparent 40%);
58
+ z-index: -1;
59
+ }
60
+
61
+ body {
62
+ margin: 0;
63
+ padding: 0;
64
+ min-height: 100vh;
65
+ background-color: transparent;
66
+ display: flex;
67
+ justify-content: center;
68
+ align-items: center;
69
+ height: 100vh;
70
+ width: 100vw;
71
+ position: fixed;
72
+ top: 0;
73
+ left: 0;
74
+ overflow-x: hidden;
75
+ font-family: var(--font-main);
76
+ }
77
+
78
+ #root {
79
+ width: 100%;
80
+ height: 100%;
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ position: relative;
85
+ }
86
+
87
+ .chat-container {
88
+ font-family: var(--font-main);
89
+ width: 100%;
90
+ max-width: 1000px;
91
+ height: 100vh;
92
+ margin: 0 auto;
93
+ background: transparent;
94
+ overflow: hidden;
95
+ display: flex;
96
+ flex-direction: column;
97
+ justify-content: center;
98
+ position: relative;
99
+ z-index: 1;
100
+ padding-bottom: 100px;
101
+ }
102
+
103
+ /* Header style for the container */
104
+ .chat-container::before {
105
+ content: 'Which model should I use?';
106
+ display: block;
107
+ padding: 18px;
108
+ text-align: center;
109
+ color: var(--light);
110
+ font-size: 16px;
111
+ font-weight: 600;
112
+ background: transparent;
113
+ position: relative;
114
+ letter-spacing: 0.3px;
115
+ }
116
+
117
+ .chat-container::after {
118
+ display: none;
119
+ }
120
+
121
+ .message {
122
+ width: auto;
123
+ max-width: 90%;
124
+ margin: 0;
125
+ padding: 16px 20px;
126
+ border-radius: var(--border-radius);
127
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
128
+ transition: var(--transition);
129
+ position: relative;
130
+ overflow: hidden;
131
+ font-size: 15px;
132
+ line-height: 1.5;
133
+ }
134
+
135
+ .message p {
136
+ margin: 0 0 8px 0;
137
+ }
138
+
139
+ .message p:last-child {
140
+ margin-bottom: 0;
141
+ }
142
+
143
+ /* Add a messages container for scrolling */
144
+ .messages-container {
145
+ flex: 1;
146
+ overflow-y: auto;
147
+ padding: 20px;
148
+ display: flex;
149
+ flex-direction: column;
150
+ gap: 20px;
151
+ scroll-behavior: smooth;
152
+ height: calc(100% - 280px);
153
+ min-height: 200px;
154
+ background: transparent;
155
+ }
156
+
157
+ .messages-container::-webkit-scrollbar {
158
+ width: 6px;
159
+ }
160
+
161
+ .messages-container::-webkit-scrollbar-track {
162
+ background: rgba(255, 255, 255, 0.05);
163
+ border-radius: 8px;
164
+ }
165
+
166
+ .messages-container::-webkit-scrollbar-thumb {
167
+ background: rgba(255, 255, 255, 0.1);
168
+ border-radius: 8px;
169
+ }
170
+
171
+ .messages-container::-webkit-scrollbar-thumb:hover {
172
+ background: rgba(255, 255, 255, 0.15);
173
+ }
174
+
175
+ .user-message {
176
+ background: var(--dark);
177
+ margin-left: auto;
178
+ border-bottom-right-radius: 4px;
179
+ color: var(--light);
180
+ padding-left: 16px;
181
+ border-left: 3px solid var(--message-user);
182
+ }
183
+
184
+ .feedback-message {
185
+ background: var(--dark);
186
+ margin-right: auto;
187
+ border-bottom-left-radius: 4px;
188
+ color: var(--light);
189
+ max-width: 90%;
190
+ padding-left: 16px;
191
+ }
192
+
193
+ /* Enhanced success animation */
194
+ @keyframes success-pulse {
195
+ 0% { transform: scale(1); }
196
+ 50% { transform: scale(1.03); }
197
+ 100% { transform: scale(1); }
198
+ }
199
+
200
+ @keyframes success-glow {
201
+ 0% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0.6); }
202
+ 50% { box-shadow: 0 0 20px rgba(16, 163, 127, 0.4); }
203
+ 100% { box-shadow: 0 0 0 0 rgba(16, 163, 127, 0); }
204
+ }
205
+
206
+ .feedback-message.success {
207
+ border-left: 3px solid var(--message-user);
208
+ animation: success-pulse 0.7s ease-in-out, success-glow 1.5s ease-in-out infinite;
209
+ }
210
+
211
+ /* Enhanced error animation */
212
+ @keyframes shake {
213
+ 0%, 100% { transform: translateX(0) rotate(0); }
214
+ 15% { transform: translateX(-8px) rotate(-1deg); }
215
+ 30% { transform: translateX(7px) rotate(0.8deg); }
216
+ 45% { transform: translateX(-6px) rotate(-0.6deg); }
217
+ 60% { transform: translateX(5px) rotate(0.4deg); }
218
+ 75% { transform: translateX(-3px) rotate(-0.2deg); }
219
+ 90% { transform: translateX(2px) rotate(0.1deg); }
220
+ }
221
+
222
+ @keyframes error-glow {
223
+ 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
224
+ 50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
225
+ 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
226
+ }
227
+
228
+ .feedback-message.error {
229
+ border-left: 3px solid var(--message-error);
230
+ animation: shake 0.7s ease-in-out, error-glow 1.5s ease-in-out infinite;
231
+ }
232
+
233
+ .error-explanation {
234
+ font-size: 0.9em;
235
+ opacity: 0.7;
236
+ margin-top: 10px;
237
+ font-style: italic;
238
+ }
239
+
240
+ .answer-reveal {
241
+ margin-top: 15px;
242
+ padding-top: 15px;
243
+ border-top: 1px solid rgba(255, 255, 255, 0.1);
244
+ }
245
+
246
+ .reveal-button {
247
+ margin-top: 15px;
248
+ padding: 8px 16px;
249
+ background: transparent;
250
+ border: 1px solid var(--primary);
251
+ color: var(--primary);
252
+ border-radius: var(--border-radius);
253
+ font-size: 14px;
254
+ cursor: pointer;
255
+ transition: var(--transition);
256
+ }
257
+
258
+ .reveal-button:hover {
259
+ background: rgba(16, 163, 127, 0.1);
260
+ }
261
+
262
+ button {
263
+ flex: 1;
264
+ padding: 10px 16px;
265
+ border: 1px solid rgba(255, 255, 255, 0.1);
266
+ border-radius: var(--border-radius);
267
+ cursor: pointer;
268
+ font-size: 14px;
269
+ font-weight: 500;
270
+ letter-spacing: 0.3px;
271
+ transition: var(--transition);
272
+ position: relative;
273
+ overflow: hidden;
274
+ background: var(--dark);
275
+ color: var(--light);
276
+ }
277
+
278
+ button:hover {
279
+ background: rgba(255, 255, 255, 0.05);
280
+ }
281
+
282
+ button:disabled {
283
+ opacity: 0.5;
284
+ cursor: not-allowed;
285
+ background: rgba(255, 255, 255, 0.05);
286
+ }
287
+
288
+ .active {
289
+ background: var(--primary);
290
+ color: white;
291
+ border-color: var(--primary);
292
+ }
293
+
294
+ button:not(.active) {
295
+ background: var(--dark);
296
+ color: var(--light);
297
+ }
298
+
299
+ .not-matching {
300
+ position: relative;
301
+ }
302
+
303
+ .not-matching::after {
304
+ content: 'ERROR';
305
+ position: absolute;
306
+ top: -10px;
307
+ right: -10px;
308
+ background: red;
309
+ color: white;
310
+ padding: 4px 8px;
311
+ border-radius: 10px;
312
+ font-size: 12px;
313
+ font-weight: bold;
314
+ }
315
+
316
+ .modal-overlay {
317
+ position: fixed;
318
+ top: 0;
319
+ left: 0;
320
+ right: 0;
321
+ bottom: 0;
322
+ background-color: rgba(0, 0, 0, 0.3);
323
+ display: flex;
324
+ justify-content: center;
325
+ align-items: center;
326
+ z-index: 1000;
327
+ backdrop-filter: blur(3px);
328
+ animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
329
+ }
330
+
331
+ @keyframes fadeIn {
332
+ from {
333
+ opacity: 0;
334
+ backdrop-filter: blur(0);
335
+ }
336
+ to {
337
+ opacity: 1;
338
+ backdrop-filter: blur(3px);
339
+ }
340
+ }
341
+
342
+ .modal {
343
+ background: transparent;
344
+ padding: 40px;
345
+ max-width: 600px;
346
+ width: 90%;
347
+ font-family: var(--font-main);
348
+ color: var(--light);
349
+ position: relative;
350
+ overflow: hidden;
351
+ text-align: center;
352
+ animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
353
+ }
354
+
355
+ @keyframes slideUp {
356
+ from {
357
+ transform: translateY(40px);
358
+ opacity: 0;
359
+ }
360
+ to {
361
+ transform: translateY(0);
362
+ opacity: 1;
363
+ }
364
+ }
365
+
366
+ .modal h2 {
367
+ color: var(--light);
368
+ margin-bottom: 24px;
369
+ font-size: 24px;
370
+ font-weight: 600;
371
+ letter-spacing: 0.3px;
372
+ opacity: 0.95;
373
+ }
374
+
375
+ .modal p {
376
+ font-size: 16px;
377
+ line-height: 1.6;
378
+ margin-bottom: 32px;
379
+ opacity: 0.9;
380
+ font-weight: 400;
381
+ }
382
+
383
+ .modal button {
384
+ background: var(--primary);
385
+ color: white;
386
+ border: none;
387
+ padding: 12px 24px;
388
+ border-radius: 8px;
389
+ font-size: 15px;
390
+ font-weight: 500;
391
+ cursor: pointer;
392
+ transition: all 0.2s ease;
393
+ width: auto;
394
+ margin: 0 auto;
395
+ display: inline-flex;
396
+ }
397
+
398
+ .modal button:hover {
399
+ background: var(--secondary);
400
+ transform: translateY(-1px);
401
+ }
402
+
403
+ /* ...existing styles... */
404
+
405
+ .answer-button {
406
+ position: absolute;
407
+ right: -75px;
408
+ top: 50%;
409
+ transform: translateY(-50%);
410
+ background: var(--primary);
411
+ color: white;
412
+ border: none;
413
+ height: 36px;
414
+ padding: 0 16px;
415
+ border-radius: 8px;
416
+ font-size: 14px;
417
+ min-width: auto;
418
+ }
419
+
420
+ .answer-button:hover {
421
+ background: var(--secondary);
422
+ }
423
+
424
+ .chat-input {
425
+ padding-right: 100px;
426
+ }
427
+
428
+ /* ...rest of existing styles... */
429
+
430
+ [data-transform-origin=bottom] .ds-fade-in-zoom-in-enter,
431
+ [data-transform-origin=bottom] .ds-fade-in-zoom-in-exit {
432
+ transform-origin: bottom;
433
+ }
434
+
435
+ [data-transform-origin=bottom\ left] .ds-fade-in-zoom-in-enter,
436
+ [data-transform-origin=bottom\ left] .ds-fade-in-zoom-in-exit {
437
+ transform-origin: 0 100%;
438
+ }
439
+
440
+ [data-transform-origin=bottom\ right] .ds-fade-in-zoom-in-enter,
441
+ [data-transform-origin=bottom\ right] .ds-fade-in-zoom-in-exit {
442
+ transform-origin: 100% 100%;
443
+ }
444
+
445
+ [data-transform-origin=top] .ds-fade-in-zoom-in-enter,
446
+ [data-transform-origin=top] .ds-fade-in-zoom-in-exit {
447
+ transform-origin: top;
448
+ }
449
+
450
+ [data-transform-origin=top\ left] .ds-fade-in-zoom-in-enter,
451
+ [data-transform-origin=top\ left] .ds-fade-in-zoom-in-exit {
452
+ transform-origin: 0 0;
453
+ }
454
+
455
+ [data-transform-origin=top\ right] .ds-fade-in-zoom-in-enter,
456
+ [data-transform-origin=top\ right] .ds-fade-in-zoom-in-exit {
457
+ transform-origin: 100% 0;
458
+ }
459
+
460
+ [data-transform-origin=left] .ds-fade-in-zoom-in-enter,
461
+ [data-transform-origin=left] .ds-fade-in-zoom-in-exit {
462
+ transform-origin: 0;
463
+ }
464
+
465
+ [data-transform-origin=right] .ds-fade-in-zoom-in-enter,
466
+ [data-transform-origin=right] .ds-fade-in-zoom-in-exit {
467
+ transform-origin: 100%;
468
+ }
469
+
470
+ [data-transform-origin=center] .ds-fade-in-zoom-in-enter,
471
+ [data-transform-origin=center] .ds-fade-in-zoom-in-exit {
472
+ transform-origin: 50%;
473
+ }
474
+
475
+ .ds-fade-in-zoom-in-enter {
476
+ opacity: 0;
477
+ transform: scale(.96);
478
+ }
479
+
480
+ .ds-fade-in-zoom-in-active {
481
+ opacity: 1;
482
+ transition: opacity var(--ds-ease-in) var(--ds-transition-duration-fast),
483
+ transform var(--ds-ease-in) var(--ds-transition-duration-fast);
484
+ transform: scale(1);
485
+ }
486
+
487
+ .ds-fade-in-zoom-in-exit {
488
+ opacity: 1;
489
+ transform: scale(1);
490
+ }
491
+
492
+ .ds-fade-in-zoom-in-exit-active {
493
+ opacity: 0;
494
+ transition: opacity var(--ds-ease-out) var(--ds-transition-duration-fast),
495
+ transform var(--ds-ease-out) var (--ds-transition-duration-fast);
496
+ transform: scale(.96);
497
+ }
498
+
499
+ .standard-button, .answer-button {
500
+ flex: 1;
501
+ max-width: 120px;
502
+ height: 44px;
503
+ padding: 0 18px;
504
+ border-radius: var(--border-radius);
505
+ font-size: 14px;
506
+ font-weight: 500;
507
+ display: flex;
508
+ align-items: center;
509
+ justify-content: center;
510
+ transition: var(--transition);
511
+ }
512
+
513
+ .standard-button {
514
+ background: rgba(64, 65, 79, 0.9);
515
+ color: var(--light);
516
+ border: 1px solid rgba(255, 255, 255, 0.1);
517
+ }
518
+
519
+ .answer-button {
520
+ background: var(--primary);
521
+ color: white;
522
+ border: none;
523
+ }
524
+
525
+ .standard-button.active {
526
+ background: var(--primary);
527
+ color: white;
528
+ border-color: var(--primary);
529
+ box-shadow: 0 0 0 1px rgba(16, 163, 127, 0.2);
530
+ }
531
+
532
+ .chat-input-container {
533
+ position: relative;
534
+ padding: 20px;
535
+ background: transparent;
536
+ width: 100%;
537
+ display: flex;
538
+ justify-content: center;
539
+ }
540
+
541
+ .chat-input-wrapper {
542
+ position: relative;
543
+ display: flex;
544
+ flex-direction: column;
545
+ gap: 12px;
546
+ width: 100%;
547
+ max-width: 600px;
548
+ margin: 0 auto;
549
+ }
550
+
551
+ .button-group {
552
+ display: flex;
553
+ gap: 8px;
554
+ margin-bottom: 4px;
555
+ justify-content: center;
556
+ }
557
+
558
+ .input-with-button {
559
+ position: relative;
560
+ display: flex;
561
+ width: 100%;
562
+ }
563
+
564
+ .chat-input {
565
+ width: 100%;
566
+ min-height: 50px;
567
+ padding: 14px 16px;
568
+ border-radius: var(--border-radius);
569
+ border: 1px solid rgba(255, 255, 255, 0.2);
570
+ background: rgba(64, 65, 79, 0.3);
571
+ color: var(--light);
572
+ font-size: 15px;
573
+ line-height: 1.5;
574
+ resize: none;
575
+ outline: none;
576
+ transition: var(--transition);
577
+ font-family: var(--font-main);
578
+ backdrop-filter: blur(8px);
579
+ }
580
+
581
+ .chat-input:focus {
582
+ border-color: var(--primary);
583
+ background: rgba(64, 65, 79, 0.4);
584
+ box-shadow: 0 0 0 1px rgba(16, 163, 127, 0.2);
585
+ }
586
+
587
+ .chat-input::placeholder {
588
+ color: rgba(255, 255, 255, 0.5);
589
+ }
590
+
591
+ .standard-button {
592
+ background: transparent;
593
+ color: var(--light);
594
+ border: 1px solid rgba(255, 255, 255, 0.2);
595
+ padding: 8px 16px;
596
+ height: 36px;
597
+ font-size: 13px;
598
+ border-radius: 8px;
599
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
600
+ flex: 0 0 auto;
601
+ min-width: 90px;
602
+ }
603
+
604
+ .standard-button:hover {
605
+ transform: translateY(-2px);
606
+ background: rgba(255, 255, 255, 0.15);
607
+ border-color: rgba(255, 255, 255, 0.4);
608
+ }
609
+
610
+ .standard-button.active {
611
+ animation: none;
612
+ }
613
+
614
+ .thinking {
615
+ display: flex;
616
+ gap: 8px;
617
+ padding: 16px 20px;
618
+ background: var(--dark);
619
+ border-radius: var(--border-radius);
620
+ margin-right: auto;
621
+ align-items: center;
622
+ position: relative;
623
+ border-left: 3px solid var(--message-ai);
624
+ padding-left: 16px;
625
+ overflow: hidden;
626
+ }
627
+
628
+ .dot {
629
+ width: 10px;
630
+ height: 10px;
631
+ background: rgba(255, 255, 255, 0.8);
632
+ border-radius: 50%;
633
+ animation: bounce 1.4s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
634
+ }
635
+
636
+ .dot:nth-child(1) {
637
+ animation-delay: -0.32s;
638
+ background: var(--message-ai);
639
+ }
640
+
641
+ .dot:nth-child(2) {
642
+ animation-delay: -0.16s;
643
+ background: var(--message-ai);
644
+ }
645
+
646
+ .dot:nth-child(3) {
647
+ animation-delay: 0s;
648
+ background: var(--message-ai);
649
+ }
650
+
651
+ @keyframes bounce {
652
+ 0%, 80%, 100% {
653
+ transform: scale(0) translateY(0);
654
+ opacity: 0.3;
655
+ }
656
+ 40% {
657
+ transform: scale(1.2) translateY(-10px);
658
+ opacity: 1;
659
+ }
660
+ }
661
+
662
+ /* ...rest of existing code... */
663
+
664
+ /* Tooltip styles */
665
+ .tooltip-wrapper {
666
+ position: relative;
667
+ display: inline-block;
668
+ }
669
+
670
+ .tooltip {
671
+ position: absolute;
672
+ bottom: calc(100% + 10px);
673
+ left: 50%;
674
+ transform: translateX(-50%) translateY(15px);
675
+ background: var(--dark);
676
+ color: var(--light);
677
+ padding: 12px 16px;
678
+ border-radius: 8px;
679
+ font-size: 13px;
680
+ width: 200px;
681
+ text-align: center;
682
+ opacity: 0;
683
+ visibility: hidden;
684
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
685
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
686
+ border: 1px solid rgba(255, 255, 255, 0.1);
687
+ pointer-events: none;
688
+ z-index: 100;
689
+ line-height: 1.4;
690
+ }
691
+
692
+ .tooltip::after {
693
+ content: '';
694
+ position: absolute;
695
+ top: 100%;
696
+ left: 50%;
697
+ transform: translateX(-50%);
698
+ border: 6px solid transparent;
699
+ border-top-color: var(--dark);
700
+ }
701
+
702
+ .tooltip-wrapper:hover .tooltip {
703
+ transform: translateX(-50%) translateY(0);
704
+ opacity: 1;
705
+ visibility: visible;
706
+ }
707
+
708
+ /* Input typing animation */
709
+ @keyframes typing {
710
+ 0% { width: 0; opacity: 0; }
711
+ 100% { width: 100%; opacity: 1; }
712
+ }
713
+
714
+ /* Default state - no animation */
715
+ .chat-input {
716
+ opacity: 1;
717
+ width: 100%;
718
+ animation: none;
719
+ }
720
+
721
+ /* Only animate when new-prompt class is applied */
722
+ .chat-input.new-prompt {
723
+ animation: typing 0.8s ease-out forwards;
724
+ }
725
+
726
+ /* ...rest of existing styles... */
727
+
728
+ /* Update button styles for independent selection */
729
+ .standard-button.active {
730
+ background: var(--primary);
731
+ color: white;
732
+ border-color: var(--primary);
733
+ box-shadow: 0 0 0 1px rgba(16, 163, 127, 0.2);
734
+ }
735
+
736
+ /* Remove the pulse animation from active buttons */
737
+ .standard-button.active {
738
+ animation: none;
739
+ }
740
+
741
+ /* Message appear animation */
742
+ @keyframes messageAppear {
743
+ 0% {
744
+ opacity: 0;
745
+ transform: translateY(20px) scale(0.96);
746
+ }
747
+ 100% {
748
+ opacity: 1;
749
+ transform: translateY(0) scale(1);
750
+ }
751
+ }
752
+
753
+ /* Apply message animation only to user messages */
754
+ .user-message.message-appear {
755
+ animation: messageAppear 0.5s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
756
+ }
757
+
758
+ /* Remove message-appear animation from feedback messages that have their own animations */
759
+ .feedback-message.success.message-appear {
760
+ animation: success-pulse 0.7s ease-in-out, success-glow 1.5s ease-in-out infinite;
761
+ }
762
+
763
+ .feedback-message.error.message-appear {
764
+ animation: shake 0.7s ease-in-out, error-glow 1.5s ease-in-out infinite;
765
+ }
766
+
767
+ /* Add a basic appearance for thinking animation */
768
+ .thinking.message-appear {
769
+ animation: messageAppear 0.5s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
770
+ }
771
+
772
+ /* ...rest of existing styles... */
773
+
774
+ /* Corner images */
775
+ .corner-image {
776
+ position: fixed;
777
+ z-index: 0;
778
+ pointer-events: none; /* So they don't interfere with interactions */
779
+ opacity: 0.7;
780
+ transition: opacity 0.3s ease;
781
+ }
782
+
783
+ .corner-image:hover {
784
+ opacity: 1;
785
+ }
786
+
787
+ .corner-image-top-left {
788
+ top: 20px;
789
+ left: 20px;
790
+ max-width: 120px;
791
+ max-height: 120px;
792
+ animation: floatAnimation 6s ease-in-out infinite;
793
+ }
794
+
795
+ .corner-image-bottom-right {
796
+ bottom: 20px;
797
+ right: 20px;
798
+ max-width: 140px;
799
+ max-height: 140px;
800
+ animation: floatAnimation 8s ease-in-out infinite reverse;
801
+ }
802
+
803
+ @keyframes floatAnimation {
804
+ 0% {
805
+ transform: translateY(0) rotate(0deg);
806
+ }
807
+ 50% {
808
+ transform: translateY(-15px) rotate(5deg);
809
+ }
810
+ 100% {
811
+ transform: translateY(0) rotate(0deg);
812
+ }
813
+ }
814
+
815
+ /* Make sure images don't interfere with mobile layout */
816
+ @media (max-width: 768px) {
817
+ .corner-image {
818
+ max-width: 80px;
819
+ max-height: 80px;
820
+ }
821
+
822
+ .corner-image-top-left {
823
+ top: 10px;
824
+ left: 10px;
825
+ }
826
+
827
+ .corner-image-bottom-right {
828
+ bottom: 10px;
829
+ right: 10px;
830
+ }
831
+ }
832
+
833
+ /* Company logo in corner */
834
+ .company-logo {
835
+ position: fixed;
836
+ bottom: 20px;
837
+ max-width: 280px; /* Much larger size */
838
+ max-height: 140px; /* Much larger size */
839
+ z-index: 5;
840
+ opacity: 0.9;
841
+ transition: opacity 0.3s ease, transform 0.3s ease;
842
+ }
843
+
844
+ .company-logo:hover {
845
+ opacity: 1;
846
+ transform: scale(1.05); /* Slight grow effect on hover */
847
+ }
848
+
849
+ /* Make sure logo doesn't interfere with mobile layout */
850
+ @media (max-width: 768px) {
851
+ .company-logo {
852
+ max-width: 180px; /* Larger but still reasonable for mobile */
853
+ max-height: 90px;
854
+ bottom: 10px;
855
+ }
856
+ }
857
+
858
+ /* ...rest of existing styles... */
859
+
860
+ /* Add specific styling for the input tooltip */
861
+ .input-tooltip-wrapper {
862
+ width: 100%;
863
+ display: block;
864
+ }
865
+
866
+ .input-tooltip {
867
+ width: 250px;
868
+ bottom: calc(100% + 15px);
869
+ }
870
+
871
+ /* Ensure tooltip appears over the textarea */
872
+ .input-with-button .tooltip-wrapper {
873
+ position: relative;
874
+ width: 100%;
875
+ }
876
+
877
+ /* ...existing styles... */
878
+
879
+ /* Energy Animation at the top */
880
+ .energy-animation {
881
+ position: fixed;
882
+ top: -100px;
883
+ left: 50%;
884
+ transform: translateX(-50%);
885
+ background: var(--dark);
886
+ border-radius: var(--border-radius-lg);
887
+ padding: 15px 25px;
888
+ display: flex;
889
+ align-items: center;
890
+ gap: 15px;
891
+ box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
892
+ z-index: 1000;
893
+ border: 1px solid rgba(255, 255, 255, 0.1);
894
+ transition: top 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.5);
895
+ opacity: 0;
896
+ }
897
+
898
+ .energy-animation.show {
899
+ top: 20px;
900
+ opacity: 1;
901
+ }
902
+
903
+ .energy-icon {
904
+ font-size: 28px;
905
+ animation: pulse 2s infinite;
906
+ }
907
+
908
+ .energy-text {
909
+ font-size: 16px;
910
+ font-weight: 500;
911
+ color: var(--light);
912
+ max-width: 260px;
913
+ }
914
+
915
+ @keyframes pulse {
916
+ 0% {
917
+ transform: scale(1);
918
+ opacity: 1;
919
+ }
920
+ 50% {
921
+ transform: scale(1.2);
922
+ opacity: 0.8;
923
+ }
924
+ 100% {
925
+ transform: scale(1);
926
+ opacity: 1;
927
+ }
928
+ }
929
+
930
+ /* Responsive design for the animation */
931
+ @media (max-width: 768px) {
932
+ .energy-animation {
933
+ width: 90%;
934
+ padding: 12px 18px;
935
+ }
936
+
937
+ .energy-text {
938
+ font-size: 14px;
939
+ }
940
+
941
+ .energy-icon {
942
+ font-size: 24px;
943
+ }
944
+ }
945
+
946
+ /* ...existing styles... */
947
+
948
+ /* Message send animation */
949
+ @keyframes messageSend {
950
+ 0% {
951
+ opacity: 0;
952
+ transform: translateY(30px) scale(0.9);
953
+ }
954
+ 70% {
955
+ opacity: 1;
956
+ transform: translateY(-5px) scale(1.02);
957
+ }
958
+ 100% {
959
+ opacity: 1;
960
+ transform: translateY(0) scale(1);
961
+ }
962
+ }
963
+
964
+ .message-send-animation {
965
+ animation: messageSend 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
966
+ }
967
+
968
+ /* Stagger animations for multiple messages */
969
+ .messages-container > div:nth-child(2) {
970
+ animation-delay: 0.15s;
971
+ }
972
+
973
+ .messages-container > div:nth-child(3) {
974
+ animation-delay: 0.3s;
975
+ }
976
+
977
+ /* ...existing styles... */
978
+
979
+ /* Company logos in corners - both at the bottom */
980
+ .company-logo {
981
+ position: fixed;
982
+ bottom: 20px;
983
+ max-width: 280px;
984
+ max-height: 140px;
985
+ z-index: 5;
986
+ opacity: 0.9;
987
+ transition: opacity 0.3s ease, transform 0.3s ease;
988
+ }
989
+
990
+ .company-logo:hover {
991
+ opacity: 1;
992
+ transform: scale(1.05); /* Slight grow effect on hover */
993
+ }
994
+
995
+ .company-logo-right {
996
+ right: 20px;
997
+ }
998
+
999
+ .company-logo-left {
1000
+ left: 20px;
1001
+ }
1002
+
1003
+ /* Make sure logos don't interfere with mobile layout */
1004
+ @media (max-width: 768px) {
1005
+ .company-logo {
1006
+ max-width: 180px;
1007
+ max-height: 90px;
1008
+ bottom: 10px;
1009
+ }
1010
+
1011
+ .company-logo-right {
1012
+ right: 10px;
1013
+ }
1014
+
1015
+ .company-logo-left {
1016
+ left: 10px;
1017
+ }
1018
+ }
1019
+
1020
+ /* ...existing styles... */
src/App.js ADDED
@@ -0,0 +1,360 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useState, useEffect, useRef } from 'react';
2
+ import messageDatabase from './data.json';
3
+ import './App.css';
4
+
5
+ export default function ChatDisplay() {
6
+ const [isActive, setIsActive] = useState(false);
7
+ const [showModal, setShowModal] = useState(true);
8
+ const [currentMessageIndex, setCurrentMessageIndex] = useState(
9
+ Math.floor(Math.random() * messageDatabase.length)
10
+ );
11
+ const [showFeedback, setShowFeedback] = useState(false);
12
+ const [message, setMessage] = useState(() => messageDatabase[currentMessageIndex].question);
13
+ const [messagesSent, setMessagesSent] = useState(false);
14
+ const [sentMessage, setSentMessage] = useState('');
15
+ const [isThinking, setIsThinking] = useState(false);
16
+ const [userGuessCorrect, setUserGuessCorrect] = useState(false);
17
+ const [showAnswer, setShowAnswer] = useState(false);
18
+ const [showTopAnimation, setShowTopAnimation] = useState(false);
19
+ const [animatedMessages, setAnimatedMessages] = useState({
20
+ userMessage: false,
21
+ thinking: false,
22
+ feedback: false
23
+ });
24
+ const [reasoningButtonActive, setReasoningButtonActive] = useState(false);
25
+ const [searchButtonActive, setSearchButtonActive] = useState(false);
26
+
27
+ const getRandomMessageIndex = () => {
28
+ let newIndex;
29
+ do {
30
+ newIndex = Math.floor(Math.random() * messageDatabase.length);
31
+ } while (newIndex === currentMessageIndex && messageDatabase.length > 1);
32
+ return newIndex;
33
+ };
34
+
35
+ const loadNewQuestion = () => {
36
+ const newIndex = getRandomMessageIndex();
37
+ setCurrentMessageIndex(newIndex);
38
+ setMessage(messageDatabase[newIndex].question);
39
+ setMessagesSent(false);
40
+ setShowFeedback(false);
41
+ setShowAnswer(false);
42
+ setSentMessage('');
43
+ };
44
+
45
+ const isMessageTypeMatching = () => {
46
+ const currentType = messageDatabase[currentMessageIndex].type;
47
+
48
+ // Match reasoning type with reasoning button
49
+ if (currentType === "reasoning" && reasoningButtonActive) return true;
50
+
51
+ // Match search/standard type with search button
52
+ if ((currentType === "search" || currentType === "standard") && searchButtonActive) return true;
53
+
54
+ // Match default/standard type with no button selection
55
+ if (currentType === "standard" && !reasoningButtonActive && !searchButtonActive) return true;
56
+
57
+ return false;
58
+ };
59
+
60
+ const handleUserGuess = () => {
61
+ const isCorrect = isMessageTypeMatching();
62
+ setUserGuessCorrect(isCorrect);
63
+ setShowFeedback(true);
64
+ };
65
+
66
+ const handleSubmit = (e) => {
67
+ e.preventDefault();
68
+ if (!message.trim()) return;
69
+
70
+ // When "Send" is clicked (not in Next state)
71
+ if (!messagesSent) {
72
+ setSentMessage(message);
73
+ setMessagesSent(true);
74
+ setIsThinking(true);
75
+ setMessage(''); // Clear input immediately when Send is clicked
76
+
77
+ setTimeout(() => {
78
+ setIsThinking(false);
79
+ handleUserGuess();
80
+ }, 1500);
81
+ }
82
+ };
83
+
84
+ const handleKeyPress = (e) => {
85
+ if (e.key === 'Enter' && !e.shiftKey) {
86
+ e.preventDefault();
87
+ handleSubmit(e);
88
+ }
89
+ };
90
+
91
+ useEffect(() => {
92
+ if (!messagesSent) {
93
+ setAnimatedMessages({
94
+ userMessage: false,
95
+ thinking: false,
96
+ feedback: false
97
+ });
98
+ }
99
+ }, [messagesSent]);
100
+
101
+ function UserMessage({ text }) {
102
+ const shouldAnimate = !animatedMessages.userMessage;
103
+
104
+ useEffect(() => {
105
+ if (shouldAnimate) {
106
+ setAnimatedMessages(prev => ({ ...prev, userMessage: true }));
107
+ }
108
+ }, [shouldAnimate]);
109
+
110
+ return (
111
+ <div className={`message user-message ${shouldAnimate ? 'message-send-animation' : ''}`}>
112
+ <p>{text}</p>
113
+ </div>
114
+ );
115
+ }
116
+
117
+ function FeedbackMessage() {
118
+ const currentType = messageDatabase[currentMessageIndex].type;
119
+ const shouldBeReasoning = currentType === "reasoning";
120
+ const shouldAnimate = !animatedMessages.feedback;
121
+
122
+ useEffect(() => {
123
+ if (shouldAnimate) {
124
+ setAnimatedMessages(prev => ({ ...prev, feedback: true }));
125
+ }
126
+ }, [shouldAnimate]);
127
+
128
+ if (userGuessCorrect) {
129
+ return (
130
+ <div className={`message feedback-message success ${shouldAnimate ? 'message-send-animation' : ''}`}>
131
+ <p>🎉 Congratulations! You correctly identified this as a{shouldBeReasoning ? ' reasoning' : ' standard'} prompt.</p>
132
+ </div>
133
+ );
134
+ } else {
135
+ return (
136
+ <div className={`message feedback-message error ${shouldAnimate ? 'message-send-animation' : ''}`}>
137
+ <p>❌ Incorrect. This is a{shouldBeReasoning ? ' reasoning' : ' standard'} prompt.</p>
138
+ <p className="error-explanation">
139
+ {shouldBeReasoning
140
+ ? "This prompt requires detailed explanation and step-by-step reasoning to solve the problem."
141
+ : "This prompt requires a direct, concise answer without detailed explanation."}
142
+ </p>
143
+ </div>
144
+ );
145
+ }
146
+ }
147
+
148
+ function WelcomeModal() {
149
+ return (
150
+ showModal && (
151
+ <div className="modal-overlay">
152
+ <div className="modal">
153
+ <h2>🌿 Did you know? </h2>
154
+ <p>Every prompt counts! Choosing the right AI model saves energy and protects our planet. 🌎✨</p>
155
+ <img src="images/cute_world_mini.png" style={{ width: '55%' }} />
156
+ <p>Play smart, pick wisely, and reduce your digital footprint! 🌱💡</p>
157
+ <button onClick={() => setShowModal(false)}>Start</button>
158
+ </div>
159
+ </div>
160
+ )
161
+ );
162
+ }
163
+
164
+ function ChatInput() {
165
+ const [isNewPrompt, setIsNewPrompt] = useState(false);
166
+ const initialLoadComplete = useRef(false);
167
+
168
+ // Only run once when component mounts
169
+ useEffect(() => {
170
+ // Mark initial load as complete after a short delay
171
+ const timer = setTimeout(() => {
172
+ initialLoadComplete.current = true;
173
+ }, 500);
174
+
175
+ return () => clearTimeout(timer);
176
+ }, []);
177
+
178
+ const handleButtonClick = (button) => {
179
+ // Allow toggling between active/inactive states
180
+ if (button === 'reasoning') {
181
+ // If already active, deselect it
182
+ if (reasoningButtonActive) {
183
+ setReasoningButtonActive(false);
184
+ } else {
185
+ // Otherwise, activate it and deactivate the other button
186
+ setReasoningButtonActive(true);
187
+ setSearchButtonActive(false);
188
+ }
189
+ } else if (button === 'search') {
190
+ // If already active, deselect it
191
+ if (searchButtonActive) {
192
+ setSearchButtonActive(false);
193
+ } else {
194
+ // Otherwise, activate it and deactivate the other button
195
+ setSearchButtonActive(true);
196
+ setReasoningButtonActive(false);
197
+ }
198
+ }
199
+ };
200
+
201
+ const handleNextClick = () => {
202
+ // Only set new prompt flag if initial load is complete
203
+ if (initialLoadComplete.current) {
204
+ setIsNewPrompt(true);
205
+ }
206
+
207
+ // Show the energy animation
208
+ setShowTopAnimation(true);
209
+
210
+ // Hide animation after a delay
211
+ setTimeout(() => {
212
+ setShowTopAnimation(false);
213
+ }, 3000);
214
+
215
+ loadNewQuestion();
216
+
217
+ // Reset the new prompt flag after animation
218
+ if (initialLoadComplete.current) {
219
+ setTimeout(() => setIsNewPrompt(false), 800);
220
+ }
221
+ };
222
+
223
+ // Simplify class name logic - no complex conditions
224
+ const getInputClassName = () => {
225
+ const classes = ['chat-input'];
226
+
227
+ // Only apply new-prompt class if initial load is complete
228
+ if (initialLoadComplete.current && isNewPrompt) {
229
+ classes.push('new-prompt');
230
+ }
231
+
232
+ return classes.join(' ');
233
+ };
234
+
235
+ return (
236
+ <div className="chat-input-container">
237
+ <form className="chat-input-wrapper" onSubmit={handleSubmit}>
238
+ <div className="button-group">
239
+ <div className="tooltip-wrapper">
240
+ <button
241
+ onClick={() => handleButtonClick('reasoning')}
242
+ className={`standard-button reasoning-button ${reasoningButtonActive ? 'active' : ''}`}
243
+ type="button"
244
+ disabled={messagesSent}
245
+ >
246
+ Reason
247
+ </button>
248
+ <div className="tooltip">
249
+ Use for prompts that require detailed explanations and step-by-step reasoning
250
+ </div>
251
+ </div>
252
+ <div className="tooltip-wrapper">
253
+ <button
254
+ onClick={() => handleButtonClick('search')}
255
+ className={`standard-button search-button ${searchButtonActive ? 'active' : ''}`}
256
+ type="button"
257
+ disabled={messagesSent}
258
+ >
259
+ Search
260
+ </button>
261
+ <div className="tooltip">
262
+ Use for prompts that need simple, direct answers without detailed explanation
263
+ </div>
264
+ </div>
265
+ </div>
266
+ <div className="input-with-button">
267
+ <div className="tooltip-wrapper input-tooltip-wrapper">
268
+ <textarea
269
+ className={getInputClassName()}
270
+ value={showModal ? '' : message}
271
+ onKeyPress={handleKeyPress}
272
+ placeholder="Click next for next prompt"
273
+ rows="3"
274
+ readOnly={!messagesSent && message === messageDatabase[currentMessageIndex].question}
275
+ />
276
+ <div className="tooltip input-tooltip">
277
+ First select a model type above, then press Send to submit your answer
278
+ </div>
279
+ </div>
280
+ <button
281
+ type={messagesSent && !showFeedback ? "button" : "submit"}
282
+ className="answer-button"
283
+ onClick={messagesSent && showFeedback ? handleNextClick : undefined}
284
+ disabled={messagesSent && !showFeedback}
285
+ >
286
+ {messagesSent && showFeedback ? 'Next' : 'Send'}
287
+ </button>
288
+ </div>
289
+ </form>
290
+ </div>
291
+ );
292
+ }
293
+
294
+ function ThinkingAnimation() {
295
+ const shouldAnimate = !animatedMessages.thinking;
296
+
297
+ useEffect(() => {
298
+ if (shouldAnimate) {
299
+ setAnimatedMessages(prev => ({ ...prev, thinking: true }));
300
+ }
301
+ }, [shouldAnimate]);
302
+
303
+ return (
304
+ <div className={`thinking ${shouldAnimate ? 'message-send-animation' : ''}`}>
305
+ <div className="dot"></div>
306
+ <div className="dot"></div>
307
+ <div className="dot"></div>
308
+ </div>
309
+ );
310
+ }
311
+
312
+ // Updated CompanyLogo component with both logos at the bottom
313
+ function CompanyLogo() {
314
+ return (
315
+ <>
316
+ <img
317
+ src="images/cotec.png"
318
+ alt="Company Logo Right"
319
+ className="company-logo company-logo-right"
320
+ />
321
+ <img
322
+ src="images/upm4.png"
323
+ alt="Company Logo Left"
324
+ className="company-logo company-logo-left"
325
+ />
326
+ </>
327
+ );
328
+ }
329
+
330
+ function EnergyAnimation() {
331
+ return (
332
+ <div className={`energy-animation ${showTopAnimation ? 'show' : ''}`}>
333
+ <div className="energy-icon">
334
+ {userGuessCorrect ? '🌳' : '🗑️'}
335
+ </div>
336
+ <div className="energy-text">
337
+ {userGuessCorrect ? 'Energy saved! Good choice!' : 'Choose wisely next time to save energy!'}
338
+ </div>
339
+ </div>
340
+ );
341
+ }
342
+
343
+ return (
344
+ <>
345
+ <WelcomeModal />
346
+ <EnergyAnimation />
347
+ <div className="chat-container">
348
+ <div className="messages-container">
349
+ {messagesSent && <UserMessage text={`"${sentMessage}"`} />}
350
+ {messagesSent && isThinking && <ThinkingAnimation />}
351
+ {messagesSent && showFeedback && !isThinking && <FeedbackMessage />}
352
+ </div>
353
+ <ChatInput />
354
+ </div>
355
+ <CompanyLogo />
356
+ </>
357
+ );
358
+ }
359
+
360
+
src/data.json ADDED
@@ -0,0 +1,387 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "question":"What percentage of Egyptians polled support death penalty for those leaving Islam?",
4
+ "answer":"84%",
5
+ "type":"standard"
6
+ },
7
+ {
8
+ "question":"Ann Arbor ranks 1st among what goods sold?",
9
+ "answer":"books",
10
+ "type":"standard"
11
+ },
12
+ {
13
+ "question":"In developing countries, who makes most of the spending decisions?",
14
+ "answer":"the executive",
15
+ "type":"standard"
16
+ },
17
+ {
18
+ "question":"Who impressed Xavier by taking notes in church?",
19
+ "answer":"Anjiro",
20
+ "type":"standard"
21
+ },
22
+ {
23
+ "question":"What represents elements of the fundamental group?",
24
+ "answer":"loops",
25
+ "type":"standard"
26
+ },
27
+ {
28
+ "question":"What is the population of the Commonwealth?",
29
+ "answer":"2.2 billion",
30
+ "type":"standard"
31
+ },
32
+ {
33
+ "question":"What was Eisenhower's title after Germany's surrender?",
34
+ "answer":"Military Governor of the U.S. Occupation Zone",
35
+ "type":"standard"
36
+ },
37
+ {
38
+ "question":"These regions were occupied by who?",
39
+ "answer":"the brown men",
40
+ "type":"standard"
41
+ },
42
+ {
43
+ "question":"What could be done by understanding how the disease was transmitted?",
44
+ "answer":"resources could be targeted to the communities at greatest risk",
45
+ "type":"standard"
46
+ },
47
+ {
48
+ "question":"What kind of ants are symbolic among the Australian Aborigines?",
49
+ "answer":"honey ants",
50
+ "type":"standard"
51
+ },
52
+ {
53
+ "question":"Who blew up the HMS Jasper?",
54
+ "answer":"The Cossacks",
55
+ "type":"standard"
56
+ },
57
+ {
58
+ "question":"What pigment was made by soaking copper plates in fermenting wine?",
59
+ "answer":"verdigris",
60
+ "type":"standard"
61
+ },
62
+ {
63
+ "question":"In what decade did the LEAA conduct their investigation of crime and DST?",
64
+ "answer":"1970s",
65
+ "type":"standard"
66
+ },
67
+ {
68
+ "question":"Who designed the COMPASS navigation system?",
69
+ "answer":"Sun Jiadong",
70
+ "type":"standard"
71
+ },
72
+ {
73
+ "question":"With whom does the primary responsibility for a student's leaning lie?",
74
+ "answer":"House Master",
75
+ "type":"standard"
76
+ },
77
+ {
78
+ "question":"Children under what age often cannot comprehend sarcasm?",
79
+ "answer":"nine",
80
+ "type":"standard"
81
+ },
82
+ {
83
+ "question":"What offshoots of polychaetes are unsegmented?",
84
+ "answer":"echiurans and sipunculan",
85
+ "type":"standard"
86
+ },
87
+ {
88
+ "question":"What has a strong influence over all aspect of Tibetans lives?",
89
+ "answer":"Religion",
90
+ "type":"standard"
91
+ },
92
+ {
93
+ "question":"What does the of toxin Clostridium tetani releases do?",
94
+ "answer":"paralyzes muscles",
95
+ "type":"standard"
96
+ },
97
+ {
98
+ "question":"The Church of England uses what term that is held by two senior members of the College of Minor Canons of St. Pauls Catherdral?",
99
+ "answer":"tituli",
100
+ "type":"standard"
101
+ },
102
+ {
103
+ "question":"Find the Fourier series representation for the periodic function f(x) with period 2\ud835\udf0b, defined by:\n\nf(x) = {x, -\ud835\udf0b < x < 0; 2- x, 0 \u2264 x < \ud835\udf0b}\n\nEvaluate the first four non-zero terms of the Fourier series.",
104
+ "answer":"To find the Fourier series representation of the given function, we need to compute the Fourier coefficients a\u2080, a\u2099, and b\u2099.\n\nThe general form of the Fourier series is:\n\nf(x) = a\u2080 + \u03a3[a\u2099cos(nx) + b\u2099sin(nx)]\n\nwhere the summation is from n=1 to infinity.\n\nFirst, let's find a\u2080:\n\na\u2080 = (1\/\ud835\udf0b) * \u222b[-\ud835\udf0b to \ud835\udf0b] f(x) dx\n\nSince f(x) is defined differently for -\ud835\udf0b < x < 0 and 0 \u2264 x < \ud835\udf0b, we need to split the integral:\n\na\u2080 = (1\/\ud835\udf0b) * [\u222b[-\ud835\udf0b to 0] x dx + \u222b[0 to \ud835\udf0b] (2 - x) dx]\n\na\u2080 = (1\/\ud835\udf0b) * [(x^2\/2)|(-\ud835\udf0b to 0) + (2x - x^2\/2)|(0 to \ud835\udf0b)]\n\na\u2080 = (1\/\ud835\udf0b) * [(-\ud835\udf0b^2\/2) + (2\ud835\udf0b - \ud835\udf0b^2\/2)]\n\na\u2080 = (1\/\ud835\udf0b) * (\ud835\udf0b)\n\na\u2080 = 1\n\nNow, let's find a\u2099:\n\na\u2099 = (1\/\ud835\udf0b) * \u222b[-\ud835\udf0b to \ud835\udf0b] f(x) cos(nx) dx\n\na\u2099 = (1\/\ud835\udf0b) * [\u222b[-\ud835\udf0b to 0] x cos(nx) dx + \u222b[0 to \ud835\udf0b] (2 - x) cos(nx) dx]\n\nFor the first integral, we can use integration by parts:\n\nu = x, dv = cos(nx) dx\ndu = dx, v = (1\/n)sin(nx)\n\n\u222b[-\ud835\udf0b to 0] x cos(nx) dx = (x(1\/n)sin(nx))|(-\ud835\udf0b to 0) - \u222b[-\ud835\udf0b to 0] (1\/n)sin(nx) dx\n\nThe first term is zero, so:\n\n\u222b[-\ud835\udf0b to 0] x cos(nx) dx = -(1\/n) * \u222b[-\ud835\udf0b to 0] sin(nx) dx = (1\/n^2) * [cos(nx)]|(-\ud835\udf0b to 0) = (1\/n^2) * (1 - cos(n\ud835\udf0b))\n\nFor the second integral, we can also use integration by parts:\n\nu = 2-x, dv = cos(nx) dx\ndu = -dx, v = (1\/n)sin(nx)\n\n\u222b[0 to \ud835\udf0b] (2 - x) cos(nx) dx = ((2-x)(1\/n)sin(nx))|(0 to \ud835\udf0b) - \u222b[0 to \ud835\udf0b] -(1\/n)sin(nx) dx\n\nThe first term is zero, so:\n\n\u222b[0 to \ud835\udf0b] (2 - x) cos(nx) dx = (1\/n) * \u222b[0 to \ud835\udf0b] sin(nx) dx = -(1\/n^2) * [cos(nx)]|(0 to \ud835\udf0b) = -(1\/n^2) * (cos(n\ud835\udf0b) - 1)\n\nNow, we can find a\u2099:\n\na\u2099 = (1\/\ud835\udf0b) * [(1\/n^2) * (1 - cos(n\ud835\udf0b)) - (1\/n^2) * (cos(n\ud835\udf0b) - 1)] = 0\n\nNext, let's find b\u2099:\n\nb\u2099 = (1\/\ud835\udf0b) * \u222b[-\ud835\udf0b to \ud835\udf0b] f(x) sin(nx) dx\n\nb\u2099 = (1\/\ud835\udf0b) * [\u222b[-\ud835\udf0b to 0] x sin(nx) dx + \u222b[0 to \ud835\udf0b] (2 - x) sin(nx) dx]\n\nFor the first integral, we can use integration by parts:\n\nu = x, dv = sin(nx) dx\ndu = dx, v = -(1\/n)cos(nx)\n\n\u222b[-\ud835\udf0b to 0] x sin(nx) dx = (x(-1\/n)cos(nx))|(-\ud835\udf0b to 0) - \u222b[-\ud835\udf0b to 0] (-1\/n)cos(nx) dx\n\nThe first term is zero, so:\n\n\u222b[-\ud835\udf0b to 0] x sin(nx) dx = (1\/n) * \u222b[-\ud835\udf0b to 0] cos(nx) dx = (1\/n) * [sin(nx)]|(-\ud835\udf0b to 0) = (1\/n) * (sin(0) - sin(-n\ud835\udf0b)) = (1\/n) * (0 - (-1)^n * sin(n\ud835\udf0b)) = 0\n\nFor the second integral, we can also use integration by parts:\n\nu = 2-x, dv = sin(nx) dx\ndu = -dx, v = -(1\/n)cos(nx)\n\n\u222b[0 to \ud835\udf0b] (2 - x) sin(nx) dx = ((2-x)(-1\/n)cos(nx))|(0 to \ud835\udf0b) - \u222b[0 to \ud835\udf0b] -(1\/n)cos(nx) dx\n\nThe first term is zero, so:\n\n\u222b[0 to \ud835\udf0b] (2 - x) sin(nx) dx = (1\/n) * \u222b[0 to \ud835\udf0b] cos(nx) dx = (1\/n) * [sin(nx)]|(0 to \ud835\udf0b) = (1\/n) * (sin(n\ud835\udf0b) - sin(0)) = 0\n\nNow, we can find b\u2099:\n\nb\u2099 = (1\/\ud835\udf0b) * [0 + 0] = 0\n\nSince a\u2099 and b\u2099 are both zero, the Fourier series representation of f(x) is simply:\n\nf(x) = 1\n\nHowever, this result is not correct, as there seems to be a mistake in the calculation of the Fourier coefficients. Let's recompute the coefficients:\n\nFor a\u2099, we have:\n\na\u2099 = (1\/\ud835\udf0b) * [\u222b[-\ud835\udf0b to 0] x cos(nx) dx + \u222b[0 to \ud835\udf0b] (2 - x) cos(nx) dx]\n\na\u2099 = (1\/\ud835\udf0b) * [(1\/n^2) * (1 - cos(n\ud835\udf0b)) - (1\/n^2) * (cos(n\ud835\udf0b) - 1)]\n\na\u2099 = (2\/n^2) * (1 - cos(n\ud835\udf0b))\n\nFor b\u2099, we have:\n\nb\u2099 = (1\/\ud835\udf0b) * [\u222b[-\ud835\udf0b to 0] x sin(nx) dx + \u222b[0 to \ud835\udf0b] (2 - x) sin(nx) dx]\n\nb\u2099 = (1\/\ud835\udf0b) * [(1\/n) * (sin(0) - sin(-n\ud835\udf0b)) + (1\/n) * (sin(n\ud835\udf0b) - sin(0))]\n\nb\u2099 = (2\/n) * (1 - (-1)^n) * sin(n\ud835\udf0b)\/2\n\nNow, the Fourier series representation of f(x) is:\n\nf(x) = 1 + \u03a3[(2\/n^2) * (1 - cos(n\ud835\udf0b)) * cos(nx) + (2\/n) * (1 - (-1)^n) * sin(n\ud835\udf0b)\/2 * sin(nx)]\n\nLet's find the first four non-zero terms of the Fourier series:\n\nn = 1: a\u2081 = 2\/1^2 * (1 - cos(\ud835\udf0b)) = 2, b\u2081 = 2\/1 * (1 - (-1)^1) * sin(\ud835\udf0b)\/2 = 0\nn = 2: a\u2082 = 2\/2^2 * (1 - cos(2\ud835\udf0b)) = 0, b\u2082 = 2\/2 * (1 - (-1)^2) * sin(2\ud835\udf0b)\/2 = 0\nn = 3: a\u2083 = 2\/3^2 * (1 - cos(3\ud835\udf0b)) = 2\/9, b\u2083 = 2\/3 * (1 - (-1)^3) * sin(3\ud835\udf0b)\/2 = 0\nn = 4: a\u2084 = 2\/4^2 * (1 - cos(4\ud835\udf0b)) = 0, b\u2084 = 2\/4 * (1 - (-1)^4) * sin(4\ud835\udf0b)\/2 = 0\n\nThe first four non-zero terms of the Fourier series are:\n\nf(x) \u2248 1 + 2cos(x) + 2\/9cos(3x)",
105
+ "type":"reasoning"
106
+ },
107
+ {
108
+ "question":"Find the area enclosed between the curves y=x^2 and y=2x-x^2 using integration.",
109
+ "answer":"To find the area enclosed between the curves y = x^2 and y = 2x - x^2, we first need to find the points of intersection between the two curves. We do this by setting the two equations equal to each other:\n\nx^2 = 2x - x^2\n\n2x^2 = 2x\n\nx^2 = x\n\nx(x - 1) = 0\n\nx = 0 or x = 1\n\nSo, the points of intersection are (0, 0) and (1, 1).\n\nNow, we will find the area between the curves by integrating the difference between the two functions from x = 0 to x = 1:\n\nArea = \u222b(2x - x^2 - x^2) dx from 0 to 1\n\nArea = \u222b(2x - 2x^2) dx from 0 to 1\n\nNow, we integrate:\n\nArea = [x^2 - (2\/3)x^3] from 0 to 1\n\nNow, we evaluate the integral at the limits:\n\nArea = [(1)^2 - (2\/3)(1)^3] - [(0)^2 - (2\/3)(0)^3]\n\nArea = [1 - (2\/3)] - [0]\n\nArea = 1\/3\n\nSo, the area enclosed between the curves y = x^2 and y = 2x - x^2 is 1\/3 square units.",
110
+ "type":"reasoning"
111
+ },
112
+ {
113
+ "question":"Consider the following system of linear equations:\n\nx + 2y + z = 4 \n\n2x + 4y + 2z = 8\n\n3x + 6y + 3z = 12\n\nDetermine the value(s) of x, y, and z that satisfy the system of equations.",
114
+ "answer":"First, we can notice that the second and third equations are just multiples of the first equation. To see this, we can divide the second equation by 2 and the third equation by 3:\n\n1. x + 2y + z = 4\n2. x + 2y + z = 4 (after dividing the second equation by 2)\n3. x + 2y + z = 4 (after dividing the third equation by 3)\n\nNow we can see that all three equations are the same. This means that the system of equations has infinitely many solutions, as any solution to the first equation will also be a solution to the second and third equations.\n\nTo find the general solution, we can solve the first equation for one of the variables. Let's solve for z:\n\nz = 4 - x - 2y\n\nNow we have a general solution for z in terms of x and y. Since there are infinitely many solutions, we cannot determine specific values for x, y, and z. Instead, we can express the solution as:\n\n(x, y, 4 - x - 2y) for any values of x and y.",
115
+ "type":"reasoning"
116
+ },
117
+ {
118
+ "question":"What is the probability of a hurricane Category 4 or stronger hitting a specific region on the U.S. East Coast in the next 5 years? \n\nAssume from historical data, the average number of hurricanes landing a Category 4 or higher on the East Coast is approximately 1 every 10 years.",
119
+ "answer":"To solve this problem, we can use the Poisson distribution, which is used to model the number of events (in this case, Category 4 or stronger hurricanes) occurring in a fixed interval of time (5 years).\n\nThe formula for the Poisson distribution is:\n\nP(X = k) = (e^(-\u03bb) * \u03bb^k) \/ k!\n\nwhere:\n- P(X = k) is the probability of k events occurring in the given interval\n- \u03bb (lambda) is the average number of events in the interval\n- k is the number of events we want to find the probability for\n- e is the base of the natural logarithm (approximately 2.71828)\n\nSince we are given that the average number of Category 4 or stronger hurricanes hitting the U.S. East Coast is 1 every 10 years, we can calculate the average number of such hurricanes in a 5-year interval:\n\n\u03bb = (1 hurricane \/ 10 years) * 5 years = 0.5 hurricanes\n\nWe want to find the probability of at least one Category 4 or stronger hurricane hitting the specific region in the next 5 years. To do this, we can find the probability of no hurricanes (k = 0) and subtract it from 1:\n\nP(X \u2265 1) = 1 - P(X = 0)\n\nUsing the Poisson distribution formula with k = 0:\n\nP(X = 0) = (e^(-0.5) * 0.5^0) \/ 0! = e^(-0.5) * 1 \/ 1 = e^(-0.5)\n\nNow, we can calculate the probability of at least one Category 4 or stronger hurricane:\n\nP(X \u2265 1) = 1 - e^(-0.5) \u2248 1 - 0.6065 \u2248 0.3935\n\nSo, the probability of a Category 4 or stronger hurricane hitting the specific region on the U.S. East Coast in the next 5 years is approximately 39.35%.",
120
+ "type":"reasoning"
121
+ },
122
+ {
123
+ "question":"Find the conformal mapping that transforms the unit disc $\\left\\{z \\in \\mathbb{C} : |z|<1\\right\\}$ onto the upper half-plane $\\left\\{z \\in \\mathbb{C} : \\text{Im}(z) > 0\\right\\}$ and maps the point $i\/2$ to the point $0$.",
124
+ "answer":"To find the conformal mapping, we will use the M\u00f6bius transformation. A M\u00f6bius transformation is a function of the form:\n\n$$f(z) = \\frac{az + b}{cz + d}$$\n\nwhere $a, b, c, d \\in \\mathbb{C}$ and $ad - bc \\neq 0$. \n\nFirst, we need to find a M\u00f6bius transformation that maps the point $i\/2$ to $0$. We can do this by setting $b = -ai\/2$, so the transformation becomes:\n\n$$f(z) = \\frac{a(z - i\/2)}{cz + d}$$\n\nNow, we need to find the values of $a, c,$ and $d$ such that the unit disc is mapped onto the upper half-plane. We know that the boundary of the unit disc is the circle $|z| = 1$, so we want to find a transformation that maps this circle onto the real axis (the boundary of the upper half-plane).\n\nLet's consider three points on the boundary of the unit disc: $1, i,$ and $-1$. We want to find a transformation that maps these points onto the real axis. Since we already know that $i\/2$ is mapped to $0$, we can choose two more points to determine the transformation.\n\nLet's choose the points $1$ and $-1$. We want to find a transformation that maps $1$ to $\\infty$ and $-1$ to some real number. To map $1$ to $\\infty$, we can set $c = a$ and $d = -ai\/2$. Now the transformation becomes:\n\n$$f(z) = \\frac{a(z - i\/2)}{a(z + i\/2)}$$\n\nWe can simplify this expression by dividing both the numerator and the denominator by $a$:\n\n$$f(z) = \\frac{z - i\/2}{z + i\/2}$$\n\nNow, let's check if this transformation maps $-1$ to a real number:\n\n$$f(-1) = \\frac{-1 - i\/2}{-1 + i\/2}$$\n\nTo find the real part of this expression, we can multiply the numerator and the denominator by the complex conjugate of the denominator:\n\n$$f(-1) = \\frac{(-1 - i\/2)(-1 - i\/2)}{(-1 + i\/2)(-1 - i\/2)} = \\frac{1 + i - i\/2 - 1\/4}{1 + 1\/4} = \\frac{3\/4 + i\/2}{5\/4}$$\n\nSince the imaginary part of this expression is non-zero, we can conclude that the transformation maps $-1$ to a real number. Therefore, the conformal mapping that transforms the unit disc onto the upper half-plane and maps the point $i\/2$ to the point $0$ is:\n\n$$f(z) = \\frac{z - i\/2}{z + i\/2}$$",
125
+ "type":"reasoning"
126
+ },
127
+ {
128
+ "question":"A student plans to take a train from City A to City B. The probability that the train will arrive on time is 0.75. If the train is on time, the probability that the student will reach his destination on the same day is 0.90. What is the probability that the student will reach his destination on the same day, given that the train arrived on time?",
129
+ "answer":"Given that the train arrived on time, the probability that the student will reach his destination on the same day is 0.90.",
130
+ "type":"reasoning"
131
+ },
132
+ {
133
+ "question":"Consider the following function on the interval [0,1]: f(x) = x^2(1-x)^2. Find the critical points of f(x) and use Morse theory to calculate the Betti numbers of the level sets of f(x).",
134
+ "answer":"To find the critical points of f(x), we first need to compute the first and second derivatives of the function.\n\nf(x) = x^2(1-x)^2\n\nFirst derivative:\nf'(x) = 2x(1-x)^2 - 2x^2(1-x) = 2x(1-x)(1-2x)\n\nSecond derivative:\nf''(x) = 2(1-x)(1-2x) - 2x(1-2x) - 4x(1-x) = 2(1-6x+6x^2)\n\nNow, we find the critical points by setting the first derivative equal to zero and solving for x:\n\n2x(1-x)(1-2x) = 0\n\nThis gives us three critical points: x = 0, x = 1, and x = 1\/2.\n\nNow, we analyze the second derivative at these critical points to determine their nature:\n\nf''(0) = 2(1) = 2 > 0, so x = 0 is a local minimum.\nf''(1) = 2(1-6+6) = 2 > 0, so x = 1 is a local minimum.\nf''(1\/2) = 2(1-6(1\/2)+6(1\/4)) = -2 < 0, so x = 1\/2 is a local maximum.\n\nNow we use Morse theory to calculate the Betti numbers of the level sets of f(x). Morse theory states that the Betti numbers are determined by the critical points of the function.\n\nThe Betti numbers are given by:\n\nb_0 = number of local minima = 2\nb_1 = number of saddle points = 0\nb_2 = number of local maxima = 1\n\nSo, the Betti numbers of the level sets of f(x) are b_0 = 2, b_1 = 0, and b_2 = 1.",
135
+ "type":"reasoning"
136
+ },
137
+ {
138
+ "question":"Find the Fourier series of the function f(x) = 3 for -\u03c0 < x < 0 and f(x) = -2 for 0 < x < \u03c0.",
139
+ "answer":"To find the Fourier series of the given function, we need to compute the Fourier coefficients a\u2080, a\u2099, and b\u2099. The function f(x) is piecewise defined, so we will compute the coefficients separately for each piece and then combine them.\n\nThe Fourier series is given by:\n\nf(x) = a\u2080 + \u03a3[a\u2099 * cos(nx) + b\u2099 * sin(nx)]\n\nwhere\n\na\u2080 = (1\/\u03c0) * \u222b[-\u03c0, \u03c0] f(x) dx\na\u2099 = (1\/\u03c0) * \u222b[-\u03c0, \u03c0] f(x) * cos(nx) dx\nb\u2099 = (1\/\u03c0) * \u222b[-\u03c0, \u03c0] f(x) * sin(nx) dx\n\nFirst, let's compute a\u2080:\n\na\u2080 = (1\/\u03c0) * [\u222b[-\u03c0, 0] 3 dx + \u222b[0, \u03c0] -2 dx]\na\u2080 = (1\/\u03c0) * [3x |(-\u03c0, 0) - 2x |(0, \u03c0)]\na\u2080 = (1\/\u03c0) * [(3*0 - 3*(-\u03c0)) - (2*\u03c0 - 2*0)]\na\u2080 = (1\/\u03c0) * (3\u03c0 - 2\u03c0)\na\u2080 = \u03c0\n\nNow, let's compute a\u2099:\n\na\u2099 = (1\/\u03c0) * [\u222b[-\u03c0, 0] 3 * cos(nx) dx + \u222b[0, \u03c0] -2 * cos(nx) dx]\na\u2099 = (1\/\u03c0) * [(3\/n * sin(nx)) |(-\u03c0, 0) - (2\/n * sin(nx)) |(0, \u03c0)]\na\u2099 = (1\/\u03c0) * [(3\/n * sin(0) - 3\/n * sin(-n\u03c0)) - (2\/n * sin(n\u03c0) - 2\/n * sin(0))]\na\u2099 = (1\/\u03c0) * [(-1)^n * 3\/n - 0] (since sin(n\u03c0) = 0 for all integer values of n)\na\u2099 = (3\/n\u03c0) * (-1)^n\n\nFinally, let's compute b\u2099:\n\nb\u2099 = (1\/\u03c0) * [\u222b[-\u03c0, 0] 3 * sin(nx) dx + \u222b[0, \u03c0] -2 * sin(nx) dx]\nb\u2099 = (1\/\u03c0) * [(-3\/n * cos(nx)) |(-\u03c0, 0) + (2\/n * cos(nx)) |(0, \u03c0)]\nb\u2099 = (1\/\u03c0) * [(-3\/n * cos(0) + 3\/n * cos(-n\u03c0)) + (2\/n * cos(n\u03c0) - 2\/n * cos(0))]\nb\u2099 = (1\/\u03c0) * [(3\/n * (-1)^n - 3\/n) + (2\/n * (-1)^n - 2\/n)]\nb\u2099 = 0 (since the terms cancel out)\n\nNow, we can write the Fourier series for f(x):\n\nf(x) = \u03c0 + \u03a3[(3\/n\u03c0) * (-1)^n * cos(nx)]\n\nThis is the Fourier series representation of the given function.",
140
+ "type":"reasoning"
141
+ },
142
+ {
143
+ "question":"The Beauty Contest Game involves several participants choosing a number between 0 and 100, with the winner being the one whose number is closest to a specific percentage of the average of all the numbers chosen. \n\nSuppose there are 7 players in a beauty contest game. What number should you choose to maximize your chance of winning, assuming all other players will choose a number between 0 and 100?",
144
+ "answer":"To maximize your chance of winning, you should choose a number that is closest to the specific percentage of the average of all the numbers chosen. Let's assume the specific percentage is p (0 < p < 1).\n\nIf all other players choose a number between 0 and 100 randomly, the expected average of their numbers would be 50 (since (0+100)\/2 = 50). With 7 players, including yourself, the expected average of all numbers chosen would be:\n\n(6 * 50 + your_number) \/ 7\n\nTo maximize your chance of winning, you should choose a number that is closest to p times the expected average:\n\nyour_number = p * ((6 * 50 + your_number) \/ 7)\n\nSolving for your_number:\n\n7 * your_number = 6 * 50 * p + p * your_number\n6 * your_number = 6 * 50 * p\nyour_number = 50 * p\n\nSo, to maximize your chance of winning, you should choose a number equal to 50 times the specific percentage p.",
145
+ "type":"reasoning"
146
+ },
147
+ {
148
+ "question":"Consider the Riemann surface defined by the equation $y^2=x^3-3x$. Let $\\Theta(z)$ denote the theta function associated to this Riemann surface. Find the value of $\\Theta(0)$, i.e., evaluate the theta function at the origin.",
149
+ "answer":"To find the value of the theta function at the origin, we first need to understand the properties of the Riemann surface and the theta function associated with it.\n\nThe given equation $y^2 = x^3 - 3x$ defines an elliptic curve, which is a smooth projective curve of genus 1. The theta function associated with this Riemann surface is a holomorphic function that encodes information about the periods of the curve.\n\nThe theta function can be expressed in terms of the Jacobi theta functions as follows:\n\n$\\Theta(z) = \\sum_{n=-\\infty}^{\\infty} \\exp(\\pi i n^2 \\tau + 2 \\pi i n z)$,\n\nwhere $\\tau$ is the period matrix of the Riemann surface, and $z$ is a complex variable.\n\nNow, we want to evaluate the theta function at the origin, i.e., at $z=0$. Plugging in $z=0$ into the expression for the theta function, we get:\n\n$\\Theta(0) = \\sum_{n=-\\infty}^{\\infty} \\exp(\\pi i n^2 \\tau)$.\n\nThis sum converges absolutely and uniformly on compact subsets of the complex plane. Moreover, the theta function has the property that it is an even function, i.e., $\\Theta(-z) = \\Theta(z)$. Therefore, the sum can be simplified as follows:\n\n$\\Theta(0) = 1 + 2 \\sum_{n=1}^{\\infty} \\exp(\\pi i n^2 \\tau)$.\n\nThe value of $\\Theta(0)$ depends on the period matrix $\\tau$ of the Riemann surface, which in turn depends on the specific elliptic curve defined by the equation $y^2 = x^3 - 3x$. To find the numerical value of $\\Theta(0)$, one would need to compute the period matrix $\\tau$ for this elliptic curve and then evaluate the sum.",
150
+ "type":"reasoning"
151
+ },
152
+ {
153
+ "question":"Consider a 2-dimensional manifold with the following metric tensor:\n$$g_{ij}=\\begin{pmatrix}1 & 0 \\\\ 0 & r^2\\end{pmatrix}$$\nwhere $r$ is the radial coordinate. Find the Riemann curvature tensor for this manifold. Specifically, what is the value of $R_{1212}$?",
154
+ "answer":"To find the Riemann curvature tensor, we first need to find the Christoffel symbols of the second kind, which are given by:\n$$\\Gamma^k_{ij} = \\frac{1}{2} g^{kl} (\\partial_i g_{lj} + \\partial_j g_{il} - \\partial_l g_{ij})$$\n\nHere, $g^{kl}$ is the inverse of the metric tensor $g_{ij}$. In our case, the inverse metric tensor is:\n$$g^{ij}=\\begin{pmatrix}1 & 0 \\\\ 0 & \\frac{1}{r^2}\\end{pmatrix}$$\n\nNow, let's compute the non-zero Christoffel symbols:\n\n1. $\\Gamma^r_{\\theta\\theta} = \\frac{1}{2} g^{rr} (\\partial_\\theta g_{r\\theta} + \\partial_\\theta g_{\\theta r} - \\partial_r g_{\\theta\\theta}) = -\\frac{1}{2} \\cdot 1 \\cdot (0 + 0 - 2r) = -r$\n\n2. $\\Gamma^\\theta_{r\\theta} = \\frac{1}{2} g^{\\theta\\theta} (\\partial_r g_{\\theta\\theta} + \\partial_\\theta g_{r\\theta} - \\partial_\\theta g_{r\\theta}) = \\frac{1}{2} \\cdot \\frac{1}{r^2} \\cdot (2r^2 + 0 - 0) = \\frac{1}{r}$\n\n3. $\\Gamma^\\theta_{\\theta r} = \\frac{1}{2} g^{\\theta\\theta} (\\partial_\\theta g_{r\\theta} + \\partial_r g_{\\theta r} - \\partial_r g_{\\theta\\theta}) = \\frac{1}{2} \\cdot \\frac{1}{r^2} \\cdot (0 + 0 - 2r^2) = -\\frac{1}{r}$\n\nNow, we can compute the Riemann curvature tensor components using the following formula:\n$$R^l_{ijk} = \\partial_j \\Gamma^l_{ik} - \\partial_k \\Gamma^l_{ij} + \\Gamma^l_{jm} \\Gamma^m_{ik} - \\Gamma^l_{km} \\Gamma^m_{ij}$$\n\nWe are interested in the component $R_{1212}$, which corresponds to $R^r_{r\\theta r\\theta}$. Using the Christoffel symbols we found earlier, we get:\n\n$$R^r_{r\\theta r\\theta} = \\partial_\\theta \\Gamma^r_{r\\theta} - \\partial_r \\Gamma^r_{r\\theta} + \\Gamma^r_{\\theta m} \\Gamma^m_{r\\theta} - \\Gamma^r_{r m} \\Gamma^m_{\\theta\\theta}$$\n\nSince $\\Gamma^r_{r\\theta} = 0$, the first two terms are zero. For the third term, we have $\\Gamma^r_{\\theta m} = 0$ for all $m$. For the fourth term, we have $\\Gamma^r_{r m} = 0$ for all $m$ except for $m = \\theta$, in which case $\\Gamma^r_{r\\theta} = -r$. Therefore, the fourth term becomes:\n\n$$-\\Gamma^r_{r\\theta} \\Gamma^\\theta_{\\theta\\theta} = -(-r) \\cdot 0 = 0$$\n\nThus, the component $R_{1212} = R^r_{r\\theta r\\theta} = 0$.",
155
+ "type":"reasoning"
156
+ },
157
+ {
158
+ "question":"A message has been encrypted using a substitution cipher, where each letter of the original message has been replaced with a different letter. Using frequency analysis, it is determined that the most common letter in the encrypted message is \"Y\", which represents the letter \"E\" in the original message. If the second most common letter is \"X\", which represents the letter \"T\" in the original message, what is the probability that a randomly chosen letter in the encrypted message will represent the letter \"R\" in the original message?",
159
+ "answer":"To determine the probability that a randomly chosen letter in the encrypted message will represent the letter \"R\" in the original message, we need to know the frequency of the letter \"R\" in the original message or the frequency of the letter that represents \"R\" in the encrypted message.\n\nUnfortunately, we do not have enough information to determine this probability. We only know the most common letter \"Y\" represents \"E\" and the second most common letter \"X\" represents \"T\". We would need more information about the frequency distribution of the letters in the encrypted message or the original message to calculate the probability for the letter \"R\".",
160
+ "type":"reasoning"
161
+ },
162
+ {
163
+ "question":"A factory produces widgets that must weigh between 10 and 20 grams. Suppose we use fuzzy logic to determine the acceptability of a widget's weight. Let the weight of a particular widget be represented by the fuzzy set W, where W(x) is the degree of membership of x in the set. If W(10) = 0.6, W(15) = 1, and W(20) = 0.4, what is the degree of membership of the weight 13.5 in the set W?",
164
+ "answer":"To find the degree of membership of the weight 13.5 in the set W, we can use linear interpolation between the given points. We have the points (10, 0.6), (15, 1), and (20, 0.4). Since 13.5 is between 10 and 15, we will interpolate between these two points.\n\nLet x1 = 10, y1 = 0.6, x2 = 15, and y2 = 1. We want to find the degree of membership (y) at x = 13.5.\n\nUsing the formula for linear interpolation:\n\ny = y1 + (x - x1) * (y2 - y1) \/ (x2 - x1)\n\ny = 0.6 + (13.5 - 10) * (1 - 0.6) \/ (15 - 10)\n\ny = 0.6 + 3.5 * 0.4 \/ 5\n\ny = 0.6 + 1.4\n\ny = 2\n\nHowever, since the degree of membership cannot be greater than 1, we will set the degree of membership for the weight 13.5 to be 1.\n\nSo, W(13.5) = 1.",
165
+ "type":"reasoning"
166
+ },
167
+ {
168
+ "question":"Solve the equation z^2 + 4z + 5 = 0, where z is a complex number.",
169
+ "answer":"To solve the quadratic equation z^2 + 4z + 5 = 0, we can use the quadratic formula:\n\nz = (-b \u00b1 \u221a(b^2 - 4ac)) \/ 2a\n\nIn this case, a = 1, b = 4, and c = 5. Plugging these values into the formula, we get:\n\nz = (-4 \u00b1 \u221a(4^2 - 4(1)(5))) \/ 2(1)\n\nz = (-4 \u00b1 \u221a(16 - 20)) \/ 2\n\nz = (-4 \u00b1 \u221a(-4)) \/ 2\n\nSince the discriminant (b^2 - 4ac) is negative, we will have complex solutions. We can rewrite the square root of a negative number as the square root of the positive number times the imaginary unit i:\n\nz = (-4 \u00b1 \u221a(4) * i) \/ 2\n\nz = (-4 \u00b1 2i) \/ 2\n\nNow, we can factor out the 2:\n\nz = -2 \u00b1 i\n\nSo, the two complex solutions for the equation z^2 + 4z + 5 = 0 are:\n\nz = -2 + i and z = -2 - i",
170
+ "type":"reasoning"
171
+ },
172
+ {
173
+ "question":"Let A = {1, 2, 3} and B = {4, 5}. Find the following:\n1. A x B\n2. A' x B'\n3. (A' x B')'\n4. A x B' \u222a A' x B",
174
+ "answer":"1. A x B:\nThe Cartesian product A x B is the set of all ordered pairs (a, b) where a is in A and b is in B. So, A x B = {(1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5)}.\n\n2. A' x B':\nA' and B' represent the complements of sets A and B, respectively. To find A' x B', we first need to define the universal set U for both A and B. Since no universal set is provided, we cannot find the complements A' and B', and therefore cannot find A' x B'.\n\n3. (A' x B')':\nSince we cannot find A' x B' as explained above, we cannot find the complement of A' x B' either.\n\n4. A x B' \u222a A' x B:\nAs mentioned earlier, we cannot find the complements A' and B', so we cannot find A x B' and A' x B, and therefore cannot find their union.",
175
+ "type":"reasoning"
176
+ },
177
+ {
178
+ "question":"Find the amplitude, period, and vertical shift of the function f(x) = 2sin(3x) + 1.",
179
+ "answer":"To find the amplitude, period, and vertical shift of the function f(x) = 2sin(3x) + 1, we need to identify the different components of the function.\n\nThe general form of a sine function is: f(x) = A*sin(Bx + C) + D\n\nWhere:\n- A is the amplitude\n- B determines the period\n- C is the phase shift\n- D is the vertical shift\n\nIn our function f(x) = 2sin(3x) + 1, we can see that:\n\nA = 2\nB = 3\nC = 0 (since there is no phase shift)\nD = 1\n\nNow, let's find the amplitude, period, and vertical shift:\n\n1. Amplitude (A): The amplitude is the absolute value of A, which is the coefficient of the sine function. In our case, A = 2, so the amplitude is |2| = 2.\n\n2. Period: The period of a sine function is determined by the coefficient B in the argument of the sine function. The period is given by the formula P = 2\u03c0\/B. In our case, B = 3, so the period is P = 2\u03c0\/3.\n\n3. Vertical Shift (D): The vertical shift is given by the constant term D. In our case, D = 1, so the vertical shift is 1 unit upward.\n\nSo, the amplitude is 2, the period is 2\u03c0\/3, and the vertical shift is 1 unit upward.",
180
+ "type":"reasoning"
181
+ },
182
+ {
183
+ "question":"Let A = {2, 4, 6, 8} and B = {3, 4, 7}. Find (A \u25b3 B) \u25b3 {4, 7, 9}, where \u25b3 represents the symmetric difference between two sets.",
184
+ "answer":"First, we need to find the symmetric difference between A and B (A \u25b3 B). The symmetric difference between two sets is the set of elements which are in either of the sets but not in their intersection.\n\nA = {2, 4, 6, 8}\nB = {3, 4, 7}\n\nIntersection of A and B: {4}\nA \u25b3 B = {2, 3, 6, 8, 7}\n\nNow, we need to find the symmetric difference between (A \u25b3 B) and {4, 7, 9}.\n\n(A \u25b3 B) = {2, 3, 6, 8, 7}\n{4, 7, 9}\n\nIntersection of (A \u25b3 B) and {4, 7, 9}: {7}\n(A \u25b3 B) \u25b3 {4, 7, 9} = {2, 3, 6, 8, 4, 9}\n\nSo, the symmetric difference (A \u25b3 B) \u25b3 {4, 7, 9} is {2, 3, 4, 6, 8, 9}.",
185
+ "type":"reasoning"
186
+ },
187
+ {
188
+ "question":"What is the volume of a Sierpinski tetrahedron after 5 iterations, if the original tetrahedron has a volume of 64 cubic units?",
189
+ "answer":"A Sierpinski tetrahedron is a fractal created by iteratively removing smaller tetrahedra from the original tetrahedron. After each iteration, the volume of the remaining structure is reduced.\n\nAfter the first iteration, 4 smaller tetrahedra are formed, each with 1\/4 the volume of the original tetrahedron. Therefore, the volume of the Sierpinski tetrahedron after the first iteration is 3\/4 of the original volume.\n\nAfter each subsequent iteration, the volume of the remaining structure is again reduced by a factor of 3\/4. So, after 5 iterations, the volume of the Sierpinski tetrahedron can be calculated as:\n\nOriginal Volume \u00d7 (3\/4)^5\n\nGiven that the original volume is 64 cubic units:\n\n64 \u00d7 (3\/4)^5 = 64 \u00d7 (243\/1024) = 64 \u00d7 0.2373046875 \u2248 15.1875 cubic units\n\nSo, the volume of the Sierpinski tetrahedron after 5 iterations is approximately 15.1875 cubic units.",
190
+ "type":"reasoning"
191
+ },
192
+ {
193
+ "question":"A math student is analyzing a mirror symmetry problem that involves a pair of Calabi-Yau manifolds. The student has already determined that the degrees of the two manifolds are (3,3) and (1,1), respectively. The student now needs to calculate the Hodge numbers of each of the both manifolds.\n\nWhat are the Hodge numbers for each of the two Calabi-Yau manifolds involved in the given mirror symmetry problem?",
194
+ "answer":"To find the Hodge numbers for the Calabi-Yau manifolds, we need to consider their Hodge diamonds. The Hodge diamond for a Calabi-Yau manifold of degree (p,q) is given by the following formula:\n\nh^{i,j} = dim H^{i,j}(X, \u2102)\n\nwhere i and j are non-negative integers, and X is the Calabi-Yau manifold.\n\nFor a Calabi-Yau manifold of degree (3,3), the Hodge diamond is:\n\nh^{0,0} = 1\nh^{1,1} = 9\nh^{2,2} = 1\n\nFor a Calabi-Yau manifold of degree (1,1), the Hodge diamond is:\n\nh^{0,0} = 1\nh^{1,1} = 1\nh^{2,2} = 1\n\nSo, the Hodge numbers for the Calabi-Yau manifolds of degrees (3,3) and (1,1) are:\n\n(3,3) manifold: h^{0,0} = 1, h^{1,1} = 9, h^{2,2} = 1\n(1,1) manifold: h^{0,0} = 1, h^{1,1} = 1, h^{2,2} = 1",
195
+ "type":"reasoning"
196
+ },
197
+ {
198
+ "question":"Here is a numerical problem related to Mechanism Design in Game Theory:\n\nConsider an auction in which two bidders, Alice and Bob, are bidding for a painting. As the auctioneer, your goal is to design the mechanism that maximizes your revenue. You choose a second-price sealed-bid auction format, where each bidder submits a sealed bid and the painting is awarded to the highest bidder at a price equal to the second-highest bid. The bidders have the following valuations (in dollars) for the painting:\n\n- Alice's valuation = $800\n- Bob's valuation = $1,000\n\nWhat is the revenue you will earn from this auction, assuming both bidders bid truthfully?",
199
+ "answer":"In a second-price sealed-bid auction, bidders have the incentive to bid truthfully because they only pay the second-highest bid if they win. In this case, Alice's valuation is $800, and Bob's valuation is $1,000.\n\nAssuming both bidders bid truthfully, Alice will bid $800, and Bob will bid $1,000. Since Bob has the highest bid, he will win the auction. However, he will only pay the second-highest bid, which is Alice's bid of $800.\n\nTherefore, the revenue you will earn from this auction is $800.",
200
+ "type":"reasoning"
201
+ },
202
+ {
203
+ "question": "What new movie topped the box office this weekend?",
204
+ "answer": "",
205
+ "type": "search"
206
+ },
207
+ {
208
+ "question": "Who won the latest Grammy for best album?",
209
+ "answer": "",
210
+ "type": "search"
211
+ },
212
+ {
213
+ "question": "What's the most popular children's book this month?",
214
+ "answer": "",
215
+ "type": "search"
216
+ },
217
+ {
218
+ "question": "Which animal won the Westminster Dog Show this year?",
219
+ "answer": "",
220
+ "type": "search"
221
+ },
222
+ {
223
+ "question": "What’s the latest new attraction at Disneyland?",
224
+ "answer": "",
225
+ "type": "search"
226
+ },
227
+ {
228
+ "question": "Who is the current astronaut aboard the International Space Station?",
229
+ "answer": "",
230
+ "type": "search"
231
+ },
232
+ {
233
+ "question": "What’s the latest trend in family board games?",
234
+ "answer": "",
235
+ "type": "search"
236
+ },
237
+ {
238
+ "question": "Who recently broke the world record for the fastest marathon?",
239
+ "answer": "",
240
+ "type": "search"
241
+ },
242
+ {
243
+ "question": "What family-friendly event is happening in town this weekend?",
244
+ "answer": "",
245
+ "type": "search"
246
+ },
247
+ {
248
+ "question": "Which animated movie just won an Oscar?",
249
+ "answer": "",
250
+ "type": "search"
251
+ },
252
+ {
253
+ "question": "What's the latest exhibit at the local museum?",
254
+ "answer": "",
255
+ "type": "search"
256
+ },
257
+ {
258
+ "question": "Which team recently won the World Series?",
259
+ "answer": "",
260
+ "type": "search"
261
+ },
262
+ {
263
+ "question": "What's the newest video game release suitable for kids?",
264
+ "answer": "",
265
+ "type": "search"
266
+ },
267
+ {
268
+ "question": "Who is the author of the bestselling novel this year?",
269
+ "answer": "",
270
+ "type": "search"
271
+ },
272
+ {
273
+ "question": "What's the latest kid-friendly viral dance?",
274
+ "answer": "",
275
+ "type": "search"
276
+ },
277
+ {
278
+ "question": "Who won the most recent season of America's Got Talent?",
279
+ "answer": "",
280
+ "type": "search"
281
+ },
282
+ {
283
+ "question": "What's the hottest toy for kids right now?",
284
+ "answer": "",
285
+ "type": "search"
286
+ },
287
+ {
288
+ "question": "What's the name of the newest Disney movie released?",
289
+ "answer": "",
290
+ "type": "search"
291
+ },
292
+ {
293
+ "question": "Who recently won the Kids' Choice Award for favorite TV show?",
294
+ "answer": "",
295
+ "type": "search"
296
+ },
297
+ {
298
+ "question": "What's the latest addition to the zoo in town?",
299
+ "answer": "",
300
+ "type": "search"
301
+ },
302
+ {
303
+ "question": "Which children's book author just released a new book?",
304
+ "answer": "",
305
+ "type": "search"
306
+ },
307
+ {
308
+ "question": "What's the latest trend in kids' fashion?",
309
+ "answer": "",
310
+ "type": "search"
311
+ },
312
+ {
313
+ "question": "Who is the current champion of the Scripps National Spelling Bee?",
314
+ "answer": "",
315
+ "type": "search"
316
+ },
317
+ {
318
+ "question": "What's the newest theme park attraction for families?",
319
+ "answer": "",
320
+ "type": "search"
321
+ },
322
+ {
323
+ "question": "Which animated TV show is the most popular among kids?",
324
+ "answer": "",
325
+ "type": "search"
326
+ },
327
+ {
328
+ "question": "What's the latest hit song for children?",
329
+ "answer": "",
330
+ "type": "search"
331
+ },
332
+ {
333
+ "question": "Who is the current champion of the National Geographic Bee?",
334
+ "answer": "",
335
+ "type": "search"
336
+ },
337
+ {
338
+ "question": "What's the newest trend in kids' birthday parties?",
339
+ "answer": "",
340
+ "type": "search"
341
+ },
342
+ {
343
+ "question": "Which children's movie just won a Golden Globe?",
344
+ "answer": "",
345
+ "type": "search"
346
+ },
347
+ {
348
+ "question": "What's the latest educational toy for kids?",
349
+ "answer": "",
350
+ "type": "search"
351
+ },
352
+ {
353
+ "question": "Who is the current champion of the National Spelling Bee?",
354
+ "answer": "",
355
+ "type": "search"
356
+ },
357
+ {
358
+ "question": "What's the newest trend in kids' sports?",
359
+ "answer": "",
360
+ "type": "search"
361
+ },
362
+ {
363
+ "question": "Which children's book just won a Caldecott Medal?",
364
+ "answer": "",
365
+ "type": "search"
366
+ },
367
+ {
368
+ "question": "What's the latest hit TV show for kids?",
369
+ "answer": "",
370
+ "type": "search"
371
+ },
372
+ {
373
+ "question": "Who is the current champion of the National Geographic Bee?",
374
+ "answer": "",
375
+ "type": "search"
376
+ },
377
+ {
378
+ "question": "What's the newest trend in kids' technology?",
379
+ "answer": "",
380
+ "type": "search"
381
+ },
382
+ {
383
+ "question": "What are the most popular toys for kids this year?",
384
+ "answer": "",
385
+ "type": "search"
386
+ }
387
+ ]
src/data/messageDatabase.js ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export const messageDatabase = [
2
+ {
3
+ user: "What is React?",
4
+ llm: "React is a JavaScript library for building user interfaces.",
5
+ type: 0
6
+ },
7
+ {
8
+ user: "How do components work?",
9
+ llm: "Components in React are like building blocks. They encapsulate both the UI elements and their behavior.",
10
+ type: 1
11
+ },
12
+ {
13
+ user: "What are hooks?",
14
+ llm: "Hooks are functions that allow you to use state and other React features in functional components.",
15
+ type: 0
16
+ },
17
+ {
18
+ user: "Explain useState hook",
19
+ llm: "useState is a React hook that lets you add state variables to functional components.",
20
+ type: 0
21
+ },
22
+ {
23
+ user: "What is the virtual DOM?",
24
+ llm: "Virtual DOM is a programming concept where an ideal, or 'virtual', representation of a UI is kept in memory and synced with the 'real' DOM by a library such as ReactDOM.",
25
+ type: 1
26
+ },
27
+ {
28
+ user: "What are props in React?",
29
+ llm: "Props are inputs that allow you to pass data from parent to child components.",
30
+ type: 0
31
+ },
32
+ {
33
+ user: "Explain React lifecycle",
34
+ llm: "React components go through mounting, updating, and unmounting phases, with various methods called at each stage.",
35
+ type: 1
36
+ },
37
+ {
38
+ user: "What is JSX?",
39
+ llm: "JSX is a syntax extension for JavaScript that allows you to write HTML-like code within JavaScript.",
40
+ type: 0
41
+ },
42
+ {
43
+ user: "What is state management?",
44
+ llm: "State management refers to the handling and organization of data within an application, often using tools like Redux or Context API.",
45
+ type: 1
46
+ },
47
+ {
48
+ user: "What are controlled components?",
49
+ llm: "Controlled components are form elements whose values are controlled by React state.",
50
+ type: 0
51
+ }
52
+ ];
src/index.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import "./styles.css";
4
+
5
+ import App from "./App";
6
+
7
+ const root = createRoot(document.getElementById("root"));
8
+ root.render(
9
+ <StrictMode>
10
+ <App />
11
+ </StrictMode>
12
+ );
src/styles.css ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ * {
2
+ box-sizing: border-box;
3
+ }
4
+
5
+ body {
6
+ font-family: sans-serif;
7
+ margin: 20px;
8
+ padding: 0;
9
+ }
10
+
11
+ h1 {
12
+ margin-top: 0;
13
+ font-size: 22px;
14
+ }
15
+
16
+ h2 {
17
+ margin-top: 0;
18
+ font-size: 20px;
19
+ }
20
+
21
+ h3 {
22
+ margin-top: 0;
23
+ font-size: 18px;
24
+ }
25
+
26
+ h4 {
27
+ margin-top: 0;
28
+ font-size: 16px;
29
+ }
30
+
31
+ h5 {
32
+ margin-top: 0;
33
+ font-size: 14px;
34
+ }
35
+
36
+ h6 {
37
+ margin-top: 0;
38
+ font-size: 12px;
39
+ }
40
+
41
+ code {
42
+ font-size: 1.2em;
43
+ }
44
+
45
+ ul {
46
+ padding-inline-start: 20px;
47
+ }
48
+
49
+ * {
50
+ box-sizing: border-box;
51
+ }
52
+
53
+ body {
54
+ font-family: sans-serif;
55
+ margin: 20px;
56
+ padding: 0;
57
+ }
58
+
59
+ .square {
60
+ background: #fff;
61
+ border: 1px solid #999;
62
+ float: left;
63
+ font-size: 24px;
64
+ font-weight: bold;
65
+ line-height: 34px;
66
+ height: 34px;
67
+ margin-right: -1px;
68
+ margin-top: -1px;
69
+ padding: 0;
70
+ text-align: center;
71
+ width: 34px;
72
+ }
73
+
74
+ .board-row:after {
75
+ clear: both;
76
+ content: '';
77
+ display: table;
78
+ }
79
+
80
+ .status {
81
+ margin-bottom: 10px;
82
+ }
83
+ .game {
84
+ display: flex;
85
+ flex-direction: row;
86
+ }
87
+
88
+ .game-info {
89
+ margin-left: 20px;
90
+ }