dasda2 commited on
Commit
4af2345
·
verified ·
1 Parent(s): 251d4f2

Upload index.html

Browse files
Files changed (1) hide show
  1. index.html +620 -19
index.html CHANGED
@@ -1,19 +1,620 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Children's Drawing Emotion Analyzer</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ min-height: 100vh;
18
+ padding: 20px;
19
+ }
20
+
21
+ .container {
22
+ max-width: 1200px;
23
+ margin: 0 auto;
24
+ background: white;
25
+ border-radius: 20px;
26
+ box-shadow: 0 20px 40px rgba(0,0,0,0.1);
27
+ overflow: hidden;
28
+ }
29
+
30
+ .header {
31
+ background: linear-gradient(45deg, #4CAF50, #45a049);
32
+ color: white;
33
+ padding: 30px;
34
+ text-align: center;
35
+ }
36
+
37
+ .header h1 {
38
+ font-size: 2.5em;
39
+ margin-bottom: 10px;
40
+ }
41
+
42
+ .header p {
43
+ font-size: 1.2em;
44
+ opacity: 0.9;
45
+ }
46
+
47
+ .main-content {
48
+ padding: 40px;
49
+ }
50
+
51
+ .upload-section {
52
+ border: 3px dashed #ddd;
53
+ border-radius: 15px;
54
+ padding: 40px;
55
+ text-align: center;
56
+ margin-bottom: 30px;
57
+ transition: all 0.3s ease;
58
+ }
59
+
60
+ .upload-section:hover {
61
+ border-color: #4CAF50;
62
+ background-color: #f9f9f9;
63
+ }
64
+
65
+ .upload-section.dragover {
66
+ border-color: #4CAF50;
67
+ background-color: #e8f5e8;
68
+ }
69
+
70
+ #fileInput {
71
+ display: none;
72
+ }
73
+
74
+ .upload-btn {
75
+ background: linear-gradient(45deg, #4CAF50, #45a049);
76
+ color: white;
77
+ padding: 15px 30px;
78
+ border: none;
79
+ border-radius: 25px;
80
+ font-size: 1.1em;
81
+ cursor: pointer;
82
+ transition: transform 0.3s ease;
83
+ }
84
+
85
+ .upload-btn:hover {
86
+ transform: translateY(-2px);
87
+ }
88
+
89
+ .canvas-container {
90
+ display: flex;
91
+ gap: 20px;
92
+ margin: 30px 0;
93
+ flex-wrap: wrap;
94
+ }
95
+
96
+ .canvas-wrapper {
97
+ flex: 1;
98
+ min-width: 300px;
99
+ }
100
+
101
+ .canvas-wrapper h3 {
102
+ margin-bottom: 10px;
103
+ color: #333;
104
+ }
105
+
106
+ canvas {
107
+ border: 2px solid #ddd;
108
+ border-radius: 10px;
109
+ max-width: 100%;
110
+ height: auto;
111
+ }
112
+
113
+ .analysis-section {
114
+ margin-top: 30px;
115
+ padding: 25px;
116
+ background: #f8f9fa;
117
+ border-radius: 15px;
118
+ }
119
+
120
+ .color-stats {
121
+ display: grid;
122
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
123
+ gap: 20px;
124
+ margin: 20px 0;
125
+ }
126
+
127
+ .color-card {
128
+ background: white;
129
+ padding: 20px;
130
+ border-radius: 10px;
131
+ box-shadow: 0 5px 15px rgba(0,0,0,0.1);
132
+ text-align: center;
133
+ }
134
+
135
+ .color-bar {
136
+ height: 10px;
137
+ border-radius: 5px;
138
+ margin: 10px 0;
139
+ }
140
+
141
+ .red-bar { background: #ff4757; }
142
+ .green-bar { background: #2ed573; }
143
+ .blue-bar { background: #3742fa; }
144
+
145
+ .emotion-result {
146
+ background: white;
147
+ padding: 25px;
148
+ border-radius: 15px;
149
+ margin-top: 20px;
150
+ border-left: 5px solid #4CAF50;
151
+ }
152
+
153
+ .emotion-indicators {
154
+ display: grid;
155
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
156
+ gap: 15px;
157
+ margin-top: 20px;
158
+ }
159
+
160
+ .emotion-card {
161
+ padding: 15px;
162
+ border-radius: 10px;
163
+ border-left: 4px solid;
164
+ }
165
+
166
+ .positive { border-color: #4CAF50; background: #e8f5e8; }
167
+ .warning { border-color: #ff9800; background: #fff3e0; }
168
+ .alert { border-color: #f44336; background: #ffebee; }
169
+
170
+ .loading {
171
+ display: none;
172
+ text-align: center;
173
+ padding: 20px;
174
+ }
175
+
176
+ .spinner {
177
+ border: 4px solid #f3f3f3;
178
+ border-top: 4px solid #4CAF50;
179
+ border-radius: 50%;
180
+ width: 40px;
181
+ height: 40px;
182
+ animation: spin 1s linear infinite;
183
+ margin: 0 auto 10px;
184
+ }
185
+
186
+ @keyframes spin {
187
+ 0% { transform: rotate(0deg); }
188
+ 100% { transform: rotate(360deg); }
189
+ }
190
+
191
+ .info-box {
192
+ background: #e3f2fd;
193
+ border: 1px solid #2196f3;
194
+ border-radius: 10px;
195
+ padding: 20px;
196
+ margin-bottom: 20px;
197
+ }
198
+
199
+ .info-box h3 {
200
+ color: #1565c0;
201
+ margin-bottom: 10px;
202
+ }
203
+ </style>
204
+ </head>
205
+ <body>
206
+ <div class="container">
207
+ <div class="header">
208
+ <h1>🎨 Children's Drawing Emotion Analyzer</h1>
209
+ <p>Early Detection Tool for Emotional Well-being in Children</p>
210
+ </div>
211
+
212
+ <div class="main-content">
213
+ <div class="info-box">
214
+ <h3>How it works:</h3>
215
+ <p>Upload a drawing image, and our algorithm will analyze the color usage to provide insights into the child's emotional state. This tool is designed to assist educators and counselors in early detection of emotional patterns.</p>
216
+ </div>
217
+
218
+ <div class="upload-section" id="uploadSection">
219
+ <h2>📁 Upload Drawing Image</h2>
220
+ <p>Drag and drop an image here or click to select</p>
221
+ <br>
222
+ <button class="upload-btn" onclick="document.getElementById('fileInput').click()">
223
+ Choose Image
224
+ </button>
225
+ <input type="file" id="fileInput" accept="image/*">
226
+ </div>
227
+
228
+ <div class="loading" id="loadingDiv">
229
+ <div class="spinner"></div>
230
+ <p>Analyzing drawing...</p>
231
+ </div>
232
+
233
+ <div class="canvas-container" id="canvasContainer" style="display: none;">
234
+ <div class="canvas-wrapper">
235
+ <h3>Original Image</h3>
236
+ <canvas id="originalCanvas"></canvas>
237
+ </div>
238
+ <div class="canvas-wrapper">
239
+ <h3>White Balance Corrected</h3>
240
+ <canvas id="correctedCanvas"></canvas>
241
+ </div>
242
+ </div>
243
+
244
+ <div class="analysis-section" id="analysisSection" style="display: none;">
245
+ <h2>🔍 Color Analysis Results</h2>
246
+
247
+ <div class="color-stats" id="colorStats">
248
+ <!-- Color statistics will be populated here -->
249
+ </div>
250
+
251
+ <div class="emotion-result" id="emotionResult">
252
+ <!-- Emotion analysis will be populated here -->
253
+ </div>
254
+ </div>
255
+ </div>
256
+ </div>
257
+
258
+ <script>
259
+ class DrawingAnalyzer {
260
+ constructor() {
261
+ this.setupEventListeners();
262
+ this.originalCanvas = document.getElementById('originalCanvas');
263
+ this.correctedCanvas = document.getElementById('correctedCanvas');
264
+ this.originalCtx = this.originalCanvas.getContext('2d');
265
+ this.correctedCtx = this.correctedCanvas.getContext('2d');
266
+ }
267
+
268
+ setupEventListeners() {
269
+ const fileInput = document.getElementById('fileInput');
270
+ const uploadSection = document.getElementById('uploadSection');
271
+
272
+ fileInput.addEventListener('change', (e) => this.handleImageUpload(e));
273
+
274
+ // Drag and drop functionality
275
+ uploadSection.addEventListener('dragover', (e) => {
276
+ e.preventDefault();
277
+ uploadSection.classList.add('dragover');
278
+ });
279
+
280
+ uploadSection.addEventListener('dragleave', () => {
281
+ uploadSection.classList.remove('dragover');
282
+ });
283
+
284
+ uploadSection.addEventListener('drop', (e) => {
285
+ e.preventDefault();
286
+ uploadSection.classList.remove('dragover');
287
+ const files = e.dataTransfer.files;
288
+ if (files.length > 0) {
289
+ this.processImage(files[0]);
290
+ }
291
+ });
292
+ }
293
+
294
+ handleImageUpload(event) {
295
+ const file = event.target.files[0];
296
+ if (file) {
297
+ this.processImage(file);
298
+ }
299
+ }
300
+
301
+ processImage(file) {
302
+ document.getElementById('loadingDiv').style.display = 'block';
303
+ document.getElementById('canvasContainer').style.display = 'none';
304
+ document.getElementById('analysisSection').style.display = 'none';
305
+
306
+ const reader = new FileReader();
307
+ reader.onload = (e) => {
308
+ const img = new Image();
309
+ img.onload = () => {
310
+ setTimeout(() => {
311
+ this.analyzeImage(img);
312
+ }, 500);
313
+ };
314
+ img.src = e.target.result;
315
+ };
316
+ reader.readAsDataURL(file);
317
+ }
318
+
319
+ analyzeImage(img) {
320
+ // Set canvas dimensions
321
+ const maxWidth = 400;
322
+ const maxHeight = 300;
323
+ let width = img.width;
324
+ let height = img.height;
325
+
326
+ if (width > maxWidth) {
327
+ height = (height * maxWidth) / width;
328
+ width = maxWidth;
329
+ }
330
+ if (height > maxHeight) {
331
+ width = (width * maxHeight) / height;
332
+ height = maxHeight;
333
+ }
334
+
335
+ this.originalCanvas.width = width;
336
+ this.originalCanvas.height = height;
337
+ this.correctedCanvas.width = width;
338
+ this.correctedCanvas.height = height;
339
+
340
+ // Draw original image
341
+ this.originalCtx.drawImage(img, 0, 0, width, height);
342
+
343
+ // Get image data for processing
344
+ const imageData = this.originalCtx.getImageData(0, 0, width, height);
345
+ const correctedImageData = imageData;
346
+
347
+ // Draw corrected image
348
+ this.correctedCtx.putImageData(correctedImageData, 0, 0);
349
+
350
+ // Analyze colors
351
+ const colorAnalysis = this.analyzeColors(correctedImageData);
352
+ const emotionAnalysis = this.analyzeEmotions(colorAnalysis);
353
+
354
+ // Display results
355
+ this.displayResults(colorAnalysis, emotionAnalysis);
356
+
357
+ document.getElementById('loadingDiv').style.display = 'none';
358
+ document.getElementById('canvasContainer').style.display = 'flex';
359
+ document.getElementById('analysisSection').style.display = 'block';
360
+ }
361
+
362
+ whiteBalanceCorrection(imageData) {
363
+ const data = new Uint8ClampedArray(imageData.data);
364
+ let rSum = 0, gSum = 0, bSum = 0;
365
+ let pixelCount = 0;
366
+
367
+ // Calculate average RGB values
368
+ for (let i = 0; i < data.length; i += 4) {
369
+ const r = data[i];
370
+ const g = data[i + 1];
371
+ const b = data[i + 2];
372
+
373
+ // Skip very dark pixels (likely not white areas)
374
+ if (r + g + b > 150) {
375
+ rSum += r;
376
+ gSum += g;
377
+ bSum += b;
378
+ pixelCount++;
379
+ }
380
+ }
381
+
382
+ if (pixelCount === 0) return new ImageData(data, imageData.width, imageData.height);
383
+
384
+ const rAvg = rSum / pixelCount;
385
+ const gAvg = gSum / pixelCount;
386
+ const bAvg = bSum / pixelCount;
387
+
388
+ // Calculate correction factors
389
+ const grayTarget = 128;
390
+ const rFactor = grayTarget / rAvg || 1;
391
+ const gFactor = grayTarget / gAvg || 1;
392
+ const bFactor = grayTarget / bAvg || 1;
393
+
394
+ // Apply correction
395
+ for (let i = 0; i < data.length; i += 4) {
396
+
397
+ data[i] = Math.min(255, data[i] * rFactor);
398
+ data[i + 1] = Math.min(255, data[i + 1] * gFactor);
399
+ data[i + 2] = Math.min(255, data[i + 2] * bFactor);
400
+ }
401
+
402
+ return new ImageData(data, imageData.width, imageData.height);
403
+ }
404
+
405
+ analyzeColors(imageData) {
406
+ const data = imageData.data;
407
+ let totalPixels = 0;
408
+ let redTotal = 0, greenTotal = 0, blueTotal = 0;
409
+ let colorPixels = 0;
410
+
411
+ for (let i = 0; i < data.length; i += 4) {
412
+ const r = data[i];
413
+ const g = data[i + 1];
414
+ const b = data[i + 2];
415
+ const alpha = data[i + 3];
416
+
417
+ if (alpha > 128) { // Skip transparent pixels
418
+ totalPixels++;
419
+
420
+ // Skip white/near-white pixels (paper background)
421
+ if (r + g + b < 700) {
422
+ colorPixels++;
423
+ redTotal += r;
424
+ greenTotal += g;
425
+ blueTotal += b;
426
+ }
427
+ }
428
+ }
429
+
430
+ const redPercentage = colorPixels > 0 ? (redTotal / (colorPixels * 255)) * 100 : 0;
431
+ const greenPercentage = colorPixels > 0 ? (greenTotal / (colorPixels * 255)) * 100 : 0;
432
+ const bluePercentage = colorPixels > 0 ? (blueTotal / (colorPixels * 255)) * 100 : 0;
433
+
434
+ return {
435
+ red: Math.round(redPercentage * 10) / 10,
436
+ green: Math.round(greenPercentage * 10) / 10,
437
+ blue: Math.round(bluePercentage * 10) / 10,
438
+ totalColorPixels: colorPixels,
439
+ totalPixels: totalPixels
440
+ };
441
+ }
442
+
443
+ analyzeEmotions(colorAnalysis) {
444
+ const { red, green, blue } = colorAnalysis;
445
+
446
+ // Emotional indicators based on color psychology research
447
+ const indicators = [];
448
+ let anxietyScore = 0;
449
+ let overallMood = 'neutral';
450
+
451
+ // Red analysis (Energy, Anger, Excitement, Aggression)
452
+ if (red > 25) {
453
+ indicators.push({
454
+ type: 'warning',
455
+ emotion: 'High Energy/Potential Aggression',
456
+ description: `High red usage (${red}%) may indicate strong emotions, excitement, or potential aggression.`,
457
+ recommendation: 'Monitor for signs of frustration or overstimulation.'
458
+ });
459
+ anxietyScore += 1;
460
+ } else if (red > 15) {
461
+ indicators.push({
462
+ type: 'positive',
463
+ emotion: 'Healthy Energy',
464
+ description: `Moderate red usage (${red}%) suggests healthy energy and enthusiasm.`,
465
+ recommendation: 'Positive indicator of normal emotional expression.'
466
+ });
467
+ } else if (red < 5) {
468
+ indicators.push({
469
+ type: 'warning',
470
+ emotion: 'Low Energy',
471
+ description: `Very low red usage (${red}%) might indicate low energy or withdrawal.`,
472
+ recommendation: 'Consider encouraging more active engagement.'
473
+ });
474
+ anxietyScore += 0.5;
475
+ }
476
+
477
+ // Blue analysis (Calm, Sadness, Introversion, Peace)
478
+ if (blue > 30) {
479
+ indicators.push({
480
+ type: 'alert',
481
+ emotion: 'Possible Sadness/Withdrawal',
482
+ description: `Very high blue usage (${blue}%) may indicate sadness or excessive introversion.`,
483
+ recommendation: 'Consider gentle inquiry about emotional state.'
484
+ });
485
+ anxietyScore += 2;
486
+ } else if (blue > 20) {
487
+ indicators.push({
488
+ type: 'warning',
489
+ emotion: 'Reflective/Calm Nature',
490
+ description: `High blue usage (${blue}%) suggests a calm, reflective personality.`,
491
+ recommendation: 'Monitor for balance with other emotions.'
492
+ });
493
+ anxietyScore += 0.5;
494
+ } else if (blue > 10) {
495
+ indicators.push({
496
+ type: 'positive',
497
+ emotion: 'Balanced Calmness',
498
+ description: `Moderate blue usage (${blue}%) indicates healthy emotional balance.`,
499
+ recommendation: 'Good sign of emotional stability.'
500
+ });
501
+ }
502
+
503
+ // Green analysis (Growth, Harmony, Nature, Balance)
504
+ if (green > 25) {
505
+ indicators.push({
506
+ type: 'positive',
507
+ emotion: 'Harmony & Growth',
508
+ description: `High green usage (${green}%) indicates strong connection to nature and balanced emotions.`,
509
+ recommendation: 'Excellent sign of emotional health and growth mindset.'
510
+ });
511
+ anxietyScore -= 1; // Green reduces anxiety score
512
+ } else if (green > 15) {
513
+ indicators.push({
514
+ type: 'positive',
515
+ emotion: 'Natural Balance',
516
+ description: `Good green usage (${green}%) suggests emotional balance and stability.`,
517
+ recommendation: 'Positive indicator of healthy emotional development.'
518
+ });
519
+ } else if (green < 5) {
520
+ indicators.push({
521
+ type: 'warning',
522
+ emotion: 'Potential Imbalance',
523
+ description: `Very low green usage (${green}%) might indicate lack of emotional balance.`,
524
+ recommendation: 'Consider activities that promote harmony and balance.'
525
+ });
526
+ anxietyScore += 0.5;
527
+ }
528
+
529
+ // Overall anxiety assessment
530
+ let anxietyLevel = 'Low';
531
+ let anxietyDescription = 'The drawing shows healthy emotional expression with no significant anxiety indicators.';
532
+
533
+ if (anxietyScore >= 2.5) {
534
+ anxietyLevel = 'High';
535
+ anxietyDescription = 'Multiple indicators suggest possible anxiety or emotional distress. Professional consultation recommended.';
536
+ } else if (anxietyScore >= 1.5) {
537
+ anxietyLevel = 'Moderate';
538
+ anxietyDescription = 'Some indicators suggest mild anxiety or emotional sensitivity. Continue monitoring.';
539
+ } else if (anxietyScore >= 0.5) {
540
+ anxietyLevel = 'Mild';
541
+ anxietyDescription = 'Minor indicators present but generally within normal range.';
542
+ }
543
+
544
+ // Determine overall mood
545
+ if (green > red && green > blue) {
546
+ overallMood = 'Balanced and Harmonious';
547
+ } else if (red > blue && red > green) {
548
+ overallMood = 'Energetic and Active';
549
+ } else if (blue > red && blue > green) {
550
+ overallMood = 'Calm and Reflective';
551
+ } else {
552
+ overallMood = 'Mixed Emotions';
553
+ }
554
+
555
+ return {
556
+ indicators,
557
+ anxietyLevel,
558
+ anxietyDescription,
559
+ anxietyScore: Math.max(0, anxietyScore),
560
+ overallMood
561
+ };
562
+ }
563
+
564
+ displayResults(colorAnalysis, emotionAnalysis) {
565
+ // Display color statistics
566
+ const colorStatsDiv = document.getElementById('colorStats');
567
+ colorStatsDiv.innerHTML = `
568
+ <div class="color-card">
569
+ <h3 style="color: #ff4757;">Red Usage</h3>
570
+ <div class="color-bar red-bar" style="width: ${Math.min(colorAnalysis.red * 2, 100)}%;"></div>
571
+ <p><strong>${colorAnalysis.red}%</strong></p>
572
+ <small>Energy, Excitement, Aggression</small>
573
+ </div>
574
+ <div class="color-card">
575
+ <h3 style="color: #2ed573;">Green Usage</h3>
576
+ <div class="color-bar green-bar" style="width: ${Math.min(colorAnalysis.green * 2, 100)}%;"></div>
577
+ <p><strong>${colorAnalysis.green}%</strong></p>
578
+ <small>Harmony, Growth, Balance</small>
579
+ </div>
580
+ <div class="color-card">
581
+ <h3 style="color: #3742fa;">Blue Usage</h3>
582
+ <div class="color-bar blue-bar" style="width: ${Math.min(colorAnalysis.blue * 2, 100)}%;"></div>
583
+ <p><strong>${colorAnalysis.blue}%</strong></p>
584
+ <small>Calm, Reflection, Sadness</small>
585
+ </div>
586
+ `;
587
+
588
+ // Display emotion analysis
589
+ const emotionResultDiv = document.getElementById('emotionResult');
590
+ emotionResultDiv.innerHTML = `
591
+ <h3>🧠 Emotional Analysis Summary</h3>
592
+ <p><strong>Overall Mood:</strong> ${emotionAnalysis.overallMood}</p>
593
+ <p><strong>Anxiety Level:</strong> <span style="color: ${emotionAnalysis.anxietyLevel === 'High' ? '#f44336' : emotionAnalysis.anxietyLevel === 'Moderate' ? '#ff9800' : '#4CAF50'};">${emotionAnalysis.anxietyLevel}</span></p>
594
+ <p><strong>Assessment:</strong> ${emotionAnalysis.anxietyDescription}</p>
595
+
596
+ <div class="emotion-indicators">
597
+ ${emotionAnalysis.indicators.map(indicator => `
598
+ <div class="emotion-card ${indicator.type}">
599
+ <h4>${indicator.emotion}</h4>
600
+ <p>${indicator.description}</p>
601
+ <small><strong>Recommendation:</strong> ${indicator.recommendation}</small>
602
+ </div>
603
+ `).join('')}
604
+ </div>
605
+
606
+ <div style="margin-top: 20px; padding: 15px; background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 8px;">
607
+ <h4>⚠️ Important Note</h4>
608
+ <p>This analysis is a screening tool only and should not replace professional psychological assessment. Use results as a starting point for further observation and professional consultation when needed.</p>
609
+ </div>
610
+ `;
611
+ }
612
+ }
613
+
614
+ // Initialize the application
615
+ document.addEventListener('DOMContentLoaded', () => {
616
+ new DrawingAnalyzer();
617
+ });
618
+ </script>
619
+ </body>
620
+ </html>