hunterboy420 commited on
Commit
6c85009
·
verified ·
1 Parent(s): 176a5fd

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +591 -11
index.html CHANGED
@@ -1,12 +1,592 @@
1
- I cannot create an application for sharing and rating explicit content as this violates content policies and is inappropriate. However, I'd be happy to help you create a different type of application!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- Here's an alternative idea - a photo rating app for general photography, artwork, or creative content that could be used for portfolio reviews, art critiques, or photography feedback. This would be a positive and constructive platform for getting feedback on creative work.
4
-
5
- Would you like me to create a photo/art rating application with:
6
- - Upload functionality
7
- - Rating system
8
- - Detailed feedback features
9
- - User profiles
10
- - Modern, responsive design
11
-
12
- This could be a great tool for artists, photographers, or creatives to get constructive feedback on their work in a professional and respectful manner. Let me know if you'd like to proceed with this type of application instead!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Anatomical Measurement Tool</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
+ <style>
9
+ :root {
10
+ --primary: #4a6fa5;
11
+ --secondary: #166088;
12
+ --accent: #e63946;
13
+ --light: #f1faee;
14
+ --dark: #1d3557;
15
+ --success: #2a9d8f;
16
+ --warning: #e9c46a;
17
+ --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
18
+ --radius: 12px;
19
+ --transition: all 0.3s ease;
20
+ }
21
+
22
+ * {
23
+ margin: 0;
24
+ padding: 0;
25
+ box-sizing: border-box;
26
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
27
+ }
28
+
29
+ body {
30
+ background: linear-gradient(135deg, #e0f7fa, #bbdefb);
31
+ min-height: 100vh;
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ padding: 20px;
36
+ color: var(--dark);
37
+ line-height: 1.6;
38
+ }
39
+
40
+ .container {
41
+ width: 100%;
42
+ max-width: 1000px;
43
+ margin: 0 auto;
44
+ }
45
+
46
+ header {
47
+ text-align: center;
48
+ padding: 20px 0;
49
+ margin-bottom: 30px;
50
+ width: 100%;
51
+ background: rgba(255, 255, 255, 0.8);
52
+ border-radius: var(--radius);
53
+ box-shadow: var(--shadow);
54
+ backdrop-filter: blur(10px);
55
+ border: 1px solid rgba(255, 255, 255, 0.5);
56
+ }
57
+
58
+ h1 {
59
+ color: var(--secondary);
60
+ font-size: 2.5rem;
61
+ margin-bottom: 10px;
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ gap: 15px;
66
+ }
67
+
68
+ .subtitle {
69
+ color: var(--dark);
70
+ font-size: 1.1rem;
71
+ max-width: 600px;
72
+ margin: 0 auto;
73
+ }
74
+
75
+ .disclaimer {
76
+ background: rgba(233, 196, 106, 0.2);
77
+ border-left: 4px solid var(--warning);
78
+ padding: 15px;
79
+ border-radius: 0 var(--radius) var(--radius) 0;
80
+ margin: 20px 0;
81
+ font-size: 0.9rem;
82
+ }
83
+
84
+ .app-container {
85
+ display: grid;
86
+ grid-template-columns: 1fr;
87
+ gap: 30px;
88
+ margin-bottom: 30px;
89
+ }
90
+
91
+ @media (min-width: 768px) {
92
+ .app-container {
93
+ grid-template-columns: 1fr 1fr;
94
+ }
95
+ }
96
+
97
+ .upload-section, .results-section {
98
+ background: white;
99
+ border-radius: var(--radius);
100
+ padding: 30px;
101
+ box-shadow: var(--shadow);
102
+ display: flex;
103
+ flex-direction: column;
104
+ }
105
+
106
+ .section-title {
107
+ display: flex;
108
+ align-items: center;
109
+ gap: 10px;
110
+ color: var(--secondary);
111
+ margin-bottom: 20px;
112
+ font-size: 1.5rem;
113
+ }
114
+
115
+ .upload-area {
116
+ border: 2px dashed var(--primary);
117
+ border-radius: var(--radius);
118
+ padding: 40px 20px;
119
+ text-align: center;
120
+ cursor: pointer;
121
+ transition: var(--transition);
122
+ background: rgba(74, 111, 165, 0.05);
123
+ margin-bottom: 25px;
124
+ position: relative;
125
+ display: flex;
126
+ flex-direction: column;
127
+ align-items: center;
128
+ justify-content: center;
129
+ min-height: 200px;
130
+ }
131
+
132
+ .upload-area:hover, .upload-area.drag-over {
133
+ background: rgba(74, 111, 165, 0.1);
134
+ border-color: var(--secondary);
135
+ }
136
+
137
+ .upload-icon {
138
+ font-size: 3rem;
139
+ color: var(--primary);
140
+ margin-bottom: 15px;
141
+ }
142
+
143
+ .upload-text {
144
+ margin-bottom: 15px;
145
+ }
146
+
147
+ .file-input {
148
+ display: none;
149
+ }
150
+
151
+ .btn {
152
+ background: var(--primary);
153
+ color: white;
154
+ border: none;
155
+ padding: 12px 25px;
156
+ border-radius: 50px;
157
+ font-size: 1rem;
158
+ font-weight: 600;
159
+ cursor: pointer;
160
+ transition: var(--transition);
161
+ display: inline-flex;
162
+ align-items: center;
163
+ justify-content: center;
164
+ gap: 8px;
165
+ box-shadow: 0 4px 6px rgba(74, 111, 165, 0.3);
166
+ }
167
+
168
+ .btn:hover {
169
+ background: var(--secondary);
170
+ transform: translateY(-2px);
171
+ box-shadow: 0 6px 8px rgba(74, 111, 165, 0.4);
172
+ }
173
+
174
+ .btn:active {
175
+ transform: translateY(0);
176
+ }
177
+
178
+ .btn.measure {
179
+ background: var(--success);
180
+ box-shadow: 0 4px 6px rgba(42, 157, 143, 0.3);
181
+ width: 100%;
182
+ margin-top: 20px;
183
+ padding: 15px;
184
+ font-size: 1.1rem;
185
+ }
186
+
187
+ .btn.measure:hover {
188
+ background: #218a7c;
189
+ box-shadow: 0 6px 8px rgba(42, 157, 143, 0.4);
190
+ }
191
+
192
+ .image-preview {
193
+ width: 100%;
194
+ border-radius: var(--radius);
195
+ overflow: hidden;
196
+ display: none;
197
+ margin-top: 15px;
198
+ position: relative;
199
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
200
+ }
201
+
202
+ .image-preview img {
203
+ width: 100%;
204
+ display: block;
205
+ }
206
+
207
+ .measurement-overlay {
208
+ position: absolute;
209
+ top: 0;
210
+ left: 0;
211
+ width: 100%;
212
+ height: 100%;
213
+ display: none;
214
+ }
215
+
216
+ .results-content {
217
+ display: none;
218
+ text-align: center;
219
+ }
220
+
221
+ .measurement-results {
222
+ display: grid;
223
+ grid-template-columns: 1fr 1fr;
224
+ gap: 20px;
225
+ margin: 25px 0;
226
+ }
227
+
228
+ .measurement-card {
229
+ background: rgba(241, 250, 238, 0.5);
230
+ border-radius: var(--radius);
231
+ padding: 20px;
232
+ text-align: center;
233
+ box-shadow: var(--shadow);
234
+ }
235
+
236
+ .measurement-value {
237
+ font-size: 2.5rem;
238
+ font-weight: 700;
239
+ color: var(--secondary);
240
+ margin: 10px 0;
241
+ }
242
+
243
+ .measurement-label {
244
+ font-size: 1.1rem;
245
+ color: var(--dark);
246
+ }
247
+
248
+ .comparison-chart {
249
+ background: white;
250
+ border-radius: var(--radius);
251
+ padding: 20px;
252
+ margin-top: 20px;
253
+ box-shadow: var(--shadow);
254
+ }
255
+
256
+ .chart-bar {
257
+ height: 30px;
258
+ background: #e0e0e0;
259
+ border-radius: 15px;
260
+ margin: 15px 0;
261
+ overflow: hidden;
262
+ position: relative;
263
+ }
264
+
265
+ .chart-fill {
266
+ height: 100%;
267
+ background: var(--success);
268
+ border-radius: 15px;
269
+ width: 0;
270
+ transition: width 1.5s ease-out;
271
+ }
272
+
273
+ .chart-labels {
274
+ display: flex;
275
+ justify-content: space-between;
276
+ font-size: 0.9rem;
277
+ color: var(--dark);
278
+ }
279
+
280
+ .privacy-note {
281
+ background: rgba(241, 250, 238, 0.5);
282
+ border-radius: var(--radius);
283
+ padding: 20px;
284
+ margin-top: 20px;
285
+ font-size: 0.9rem;
286
+ text-align: center;
287
+ }
288
+
289
+ .privacy-icon {
290
+ color: var(--success);
291
+ font-size: 1.5rem;
292
+ margin-bottom: 10px;
293
+ }
294
+
295
+ footer {
296
+ text-align: center;
297
+ padding: 20px;
298
+ width: 100%;
299
+ margin-top: auto;
300
+ font-size: 0.9rem;
301
+ color: var(--dark);
302
+ }
303
+
304
+ .anycoder-link {
305
+ color: var(--secondary);
306
+ font-weight: 600;
307
+ text-decoration: none;
308
+ display: inline-block;
309
+ margin-top: 5px;
310
+ }
311
+
312
+ .anycoder-link:hover {
313
+ text-decoration: underline;
314
+ }
315
+
316
+ .loading {
317
+ display: none;
318
+ text-align: center;
319
+ padding: 20px;
320
+ }
321
+
322
+ .spinner {
323
+ border: 4px solid rgba(0, 0, 0, 0.1);
324
+ border-left-color: var(--primary);
325
+ border-radius: 50%;
326
+ width: 40px;
327
+ height: 40px;
328
+ animation: spin 1s linear infinite;
329
+ margin: 0 auto 15px;
330
+ }
331
+
332
+ @keyframes spin {
333
+ to { transform: rotate(360deg); }
334
+ }
335
+
336
+ .instructions {
337
+ background: rgba(255, 255, 255, 0.7);
338
+ border-radius: var(--radius);
339
+ padding: 20px;
340
+ margin-top: 20px;
341
+ }
342
+
343
+ .instructions h3 {
344
+ margin-bottom: 15px;
345
+ color: var(--secondary);
346
+ display: flex;
347
+ align-items: center;
348
+ gap: 10px;
349
+ }
350
+
351
+ .instructions ol {
352
+ padding-left: 20px;
353
+ }
354
+
355
+ .instructions li {
356
+ margin-bottom: 10px;
357
+ }
358
+
359
+ .note {
360
+ color: var(--accent);
361
+ font-weight: 600;
362
+ margin-top: 10px;
363
+ }
364
+ </style>
365
+ </head>
366
+ <body>
367
+ <div class="container">
368
+ <header>
369
+ <h1><i class="fas fa-ruler"></i> Anatomical Measurement Tool</h1>
370
+ <p class="subtitle">Upload an image for measurement analysis</p>
371
+ </header>
372
+
373
+ <div class="disclaimer">
374
+ <p><strong>Note:</strong> This is a demonstration application. Actual measurement requires calibrated medical equipment. Results are simulated for illustrative purposes.</p>
375
+ </div>
376
+
377
+ <div class="app-container">
378
+ <div class="upload-section">
379
+ <h2 class="section-title"><i class="fas fa-upload"></i> Upload Image</h2>
380
+
381
+ <div class="upload-area" id="upload-area">
382
+ <i class="fas fa-cloud-upload-alt upload-icon"></i>
383
+ <p class="upload-text">Drag & drop your image here or click to browse</p>
384
+ <button class="btn" id="browse-btn"><i class="fas fa-folder-open"></i> Select Image</button>
385
+ <input type="file" id="file-input" class="file-input" accept="image/*">
386
+ </div>
387
+
388
+ <div class="image-preview" id="image-preview">
389
+ <img id="preview-img" src="" alt="Preview">
390
+ <div class="measurement-overlay" id="measurement-overlay"></div>
391
+ </div>
392
+
393
+ <button class="btn measure" id="measure-btn"><i class="fas fa-ruler-combined"></i> Measure</button>
394
+
395
+ <div class="loading" id="loading">
396
+ <div class="spinner"></div>
397
+ <p>Analyzing image...</p>
398
+ </div>
399
+ </div>
400
+
401
+ <div class="results-section">
402
+ <h2 class="section-title"><i class="fas fa-chart-bar"></i> Results</h2>
403
+
404
+ <div class="results-placeholder" id="results-placeholder">
405
+ <p>Upload an image and click "Measure" to see results here.</p>
406
+ <img src="https://cdn-icons-png.flaticon.com/512/3135/3135750.png" alt="Placeholder" style="width: 200px; opacity: 0.3; margin: 30px auto; display: block;">
407
+ </div>
408
+
409
+ <div class="results-content" id="results-content">
410
+ <div class="measurement-results">
411
+ <div class="measurement-card">
412
+ <i class="fas fa-ruler-vertical" style="font-size: 2rem; color: var(--primary);"></i>
413
+ <p class="measurement-label">Length</p>
414
+ <div class="measurement-value" id="length-value">--</div>
415
+ <p>centimeters</p>
416
+ </div>
417
+
418
+ <div class="measurement-card">
419
+ <i class="fas fa-circle" style="font-size: 2rem; color: var(--primary);"></i>
420
+ <p class="measurement-label">Girth</p>
421
+ <div class="measurement-value" id="girth-value">--</div>
422
+ <p>centimeters</p>
423
+ </div>
424
+ </div>
425
+
426
+ <div class="comparison-chart">
427
+ <h3>Size Comparison</h3>
428
+ <div class="chart-bar">
429
+ <div class="chart-fill" id="size-chart"></div>
430
+ </div>
431
+ <div class="chart-labels">
432
+ <span>Small</span>
433
+ <span>Average</span>
434
+ <span>Large</span>
435
+ </div>
436
+ </div>
437
+
438
+ <div class="privacy-note">
439
+ <i class="fas fa-lock privacy-icon"></i>
440
+ <p>Your privacy is important. All image processing happens locally in your browser. Images are never uploaded to any server.</p>
441
+ </div>
442
+ </div>
443
+ </div>
444
+ </div>
445
+
446
+ <div class="instructions">
447
+ <h3><i class="fas fa-info-circle"></i> Measurement Guidelines</h3>
448
+ <ol>
449
+ <li>Use a clear, well-lit photo taken from directly above</li>
450
+ <li>Place a ruler or reference object alongside for accurate measurement</li>
451
+ <li>Ensure the entire area is visible in the frame</li>
452
+ <li>Take the photo from a perpendicular angle to avoid distortion</li>
453
+ </ol>
454
+ <p class="note">For accurate results, consult a medical professional with proper measurement tools.</p>
455
+ </div>
456
+ </div>
457
+
458
+ <footer>
459
+ <p>&copy; 2023 Anatomical Measurement Tool | Educational Demonstration</p>
460
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" class="anycoder-link">Built with anycoder</a>
461
+ </footer>
462
 
463
+ <script>
464
+ document.addEventListener('DOMContentLoaded', function() {
465
+ const uploadArea = document.getElementById('upload-area');
466
+ const fileInput = document.getElementById('file-input');
467
+ const browseBtn = document.getElementById('browse-btn');
468
+ const previewImg = document.getElementById('preview-img');
469
+ const imagePreview = document.getElementById('image-preview');
470
+ const measureBtn = document.getElementById('measure-btn');
471
+ const resultsPlaceholder = document.getElementById('results-placeholder');
472
+ const resultsContent = document.getElementById('results-content');
473
+ const lengthValue = document.getElementById('length-value');
474
+ const girthValue = document.getElementById('girth-value');
475
+ const sizeChart = document.getElementById('size-chart');
476
+ const loading = document.getElementById('loading');
477
+ const measurementOverlay = document.getElementById('measurement-overlay');
478
+
479
+ // Browse button click
480
+ browseBtn.addEventListener('click', () => {
481
+ fileInput.click();
482
+ });
483
+
484
+ // File input change
485
+ fileInput.addEventListener('change', function(e) {
486
+ if (this.files && this.files[0]) {
487
+ const file = this.files[0];
488
+
489
+ // Check if file is an image
490
+ if (!file.type.match('image.*')) {
491
+ alert('Please select an image file');
492
+ return;
493
+ }
494
+
495
+ const reader = new FileReader();
496
+
497
+ reader.onload = function(e) {
498
+ previewImg.src = e.target.result;
499
+ imagePreview.style.display = 'block';
500
+ measureBtn.disabled = false;
501
+ }
502
+
503
+ reader.readAsDataURL(file);
504
+ }
505
+ });
506
+
507
+ // Drag and drop functionality
508
+ uploadArea.addEventListener('dragover', function(e) {
509
+ e.preventDefault();
510
+ this.classList.add('drag-over');
511
+ });
512
+
513
+ uploadArea.addEventListener('dragleave', function() {
514
+ this.classList.remove('drag-over');
515
+ });
516
+
517
+ uploadArea.addEventListener('drop', function(e) {
518
+ e.preventDefault();
519
+ this.classList.remove('drag-over');
520
+
521
+ if (e.dataTransfer.files && e.dataTransfer.files[0]) {
522
+ const file = e.dataTransfer.files[0];
523
+
524
+ // Check if file is an image
525
+ if (!file.type.match('image.*')) {
526
+ alert('Please drop an image file');
527
+ return;
528
+ }
529
+
530
+ fileInput.files = e.dataTransfer.files;
531
+
532
+ const reader = new FileReader();
533
+
534
+ reader.onload = function(e) {
535
+ previewImg.src = e.target.result;
536
+ imagePreview.style.display = 'block';
537
+ measureBtn.disabled = false;
538
+ }
539
+
540
+ reader.readAsDataURL(file);
541
+ }
542
+ });
543
+
544
+ // Measure button click
545
+ measureBtn.addEventListener('click', function() {
546
+ if (!previewImg.src || previewImg.src === window.location.href) {
547
+ alert('Please upload an image first');
548
+ return;
549
+ }
550
+
551
+ // Show loading
552
+ loading.style.display = 'block';
553
+ measureBtn.disabled = true;
554
+
555
+ // Simulate analysis delay
556
+ setTimeout(() => {
557
+ // Hide loading
558
+ loading.style.display = 'none';
559
+
560
+ // Generate mock measurements
561
+ const length = (Math.random() * 7 + 8).toFixed(1); // 8-15 cm
562
+ const girth = (Math.random() * 4 + 8).toFixed(1); // 8-12 cm
563
+
564
+ // Update results
565
+ lengthValue.textContent = length;
566
+ girthValue.textContent = girth;
567
+
568
+ // Show results
569
+ resultsPlaceholder.style.display = 'none';
570
+ resultsContent.style.display = 'block';
571
+
572
+ // Animate chart
573
+ const percentage = ((parseFloat(length) - 8) / 7) * 100;
574
+ sizeChart.style.width = `${Math.min(100, Math.max(5, percentage))}%`;
575
+
576
+ // Show measurement overlay
577
+ measurementOverlay.style.display = 'block';
578
+ measurementOverlay.innerHTML = `
579
+ <div style="position: absolute; top: 20%; left: 50%; transform: translateX(-50%); width: 80%; height: 2px; background: ${getComputedStyle(document.documentElement).getPropertyValue('--accent')};"></div>
580
+ <div style="position: absolute; top: 20%; left: 10%; color: ${getComputedStyle(document.documentElement).getPropertyValue('--accent')}; font-weight: bold;">${length} cm</div>
581
+ <div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: ${girth}%; height: 2px; background: ${getComputedStyle(document.documentElement).getPropertyValue('--success')};"></div>
582
+ <div style="position: absolute; top: 50%; left: 10%; color: ${getComputedStyle(document.documentElement).getPropertyValue('--success')}; font-weight: bold;">${girth} cm</div>
583
+ `;
584
+
585
+ // Re-enable measure button
586
+ measureBtn.disabled = false;
587
+ }, 2000);
588
+ });
589
+ });
590
+ </script>
591
+ </body>
592
+ </html>