-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheight-calculator.html
More file actions
2034 lines (1794 loc) · 79.6 KB
/
Copy pathheight-calculator.html
File metadata and controls
2034 lines (1794 loc) · 79.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>초음파를 활용한 손가락뼈 길이 계측을 통한 한국인 신원추정 기법 개발 </title>
<style>
:root {
--bg-color: #121212;
--text-color: #ffffff;
--secondary-text: #dddddd;
--primary-color: #e50914;
--border-color: #444444;
--input-bg: #222222;
--container-bg: #1a1a1a;
--section-bg: #242424;
--card-bg: #2a2a2a;
--hover-color: #333333;
--box-shadow: rgba(0, 0, 0, 0.7);
--error-color: #ff5252;
--success-color: #4caf50;
--result-bg: #2d2d2d;
}
body.light-mode {
--bg-color: #f5f5f5;
--text-color: #121212;
--secondary-text: #444444;
--primary-color: #e50914;
--border-color: #dddddd;
--input-bg: #ffffff;
--container-bg: #ffffff;
--section-bg: #f0f0f0;
--card-bg: #e0e0e0;
--hover-color: #e8e8e8;
--box-shadow: rgba(0, 0, 0, 0.1);
--error-color: #f44336;
--success-color: #4caf50;
--result-bg: #e9e9e9;
}
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.5;
margin: 0;
padding: 20px;
transition: background-color 0.3s, color 0.3s;
}
/* 테마 전환 버튼 스타일 */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: var(--section-bg);
border: 1px solid var(--border-color);
color: var(--text-color);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
box-shadow: 0 2px 5px var(--box-shadow);
transition: all 0.3s;
}
.theme-toggle:hover {
background-color: var(--hover-color);
transform: scale(1.05);
}
h2 {
text-align: center;
margin-bottom: 20px;
font-size: 1.8em;
color: var(--primary-color);
text-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}
h3 {
margin-top: 30px;
margin-bottom: 15px;
font-size: 1.4em;
border-bottom: 1px solid var(--border-color);
padding-bottom: 5px;
color: var(--text-color);
}
.form-group {
margin-bottom: 15px;
}
label {
display: block;
font-weight: 600;
margin-bottom: 5px;
font-size: 1.05em;
color: var(--secondary-text);
}
input {
width: 100%;
padding: 10px 12px;
font-size: 1.05em;
border: 1px solid var(--border-color);
border-radius: 4px;
box-sizing: border-box;
background-color: var(--input-bg);
color: var(--text-color);
box-shadow: 0 0 5px var(--box-shadow);
transition: border-color 0.3s, box-shadow 0.3s;
}
input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 8px rgba(229, 9, 20, 0.3);
}
button {
display: block;
width: 100%;
padding: 12px;
background-color: var(--primary-color);
border: none;
border-radius: 4px;
color: white;
font-size: 1.1em;
cursor: pointer;
margin-top: 20px;
transition: background-color 0.3s, box-shadow 0.3s;
}
button:hover {
background-color: #f40612;
box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}
.result {
text-align: center;
margin-top: 15px;
font-size: 1.3em;
font-weight: bold;
}
.result-container {
background-color: var(--section-bg);
padding: 15px;
border-radius: 4px;
margin-top: 30px;
border: 1px solid var(--border-color);
}
.model-section {
margin-bottom: 20px;
padding: 15px;
border: 1px solid var(--border-color);
border-radius: 4px;
background-color: var(--section-bg);
box-shadow: 0 0 10px var(--box-shadow);
}
.tabs {
display: flex;
gap: 10px;
margin-bottom: 0;
flex-wrap: wrap;
justify-content: center;
background-color: var(--container-bg);
padding: 15px 10px;
border-radius: 4px 4px 0 0;
border-bottom: 1px solid var(--border-color);
}
.tab {
padding: 10px 14px;
background-color: var(--section-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: pointer;
text-align: center;
flex: 0 1 auto;
min-width: 100px;
font-size: 0.9em;
white-space: nowrap;
margin-bottom: 5px;
color: var(--secondary-text);
transition: all 0.3s ease;
}
.tab:hover {
background-color: var(--hover-color);
border-color: var(--primary-color);
color: var(--text-color);
}
.tab.active {
background-color: var(--primary-color);
color: white;
border-color: var(--primary-color);
}
.model-container {
display: none;
}
.model-container.active {
display: block;
}
.model-stats {
background-color: var(--card-bg);
padding: 10px 14px;
border-radius: 4px;
font-size: 1em;
margin: 0 15px 15px 15px;
display: inline-block;
color: var(--secondary-text);
border: 1px solid var(--border-color);
}
h4 {
margin-top: 20px;
margin-bottom: 10px;
font-size: 1.2em;
color: var(--primary-color);
border-left: 3px solid var(--primary-color);
padding-left: 10px;
}
/* 모바일 대응 미디어 쿼리 */
@media (max-width: 768px) {
body {
padding: 15px;
margin: 20px auto;
font-size: 14px;
}
.tab {
padding: 8px 10px;
font-size: 0.8em;
min-width: 85px;
}
h2 {
font-size: 1.5em;
}
h3 {
font-size: 1.2em;
}
.main-content {
display: block;
}
.helper-container {
position: relative;
top: 0;
border-left: none;
margin-top: 30px;
}
.theme-toggle {
top: 10px;
right: 10px;
width: 40px;
height: 40px;
font-size: 20px;
}
}
/* 레이아웃 스타일 수정 */
.main-content {
display: grid;
grid-template-columns: 20% 35% 43%;
gap: 2%;
position: relative;
}
/* 왼쪽 사이드바 컨테이너 - 도움말 섹션 */
.sidebar-container {
background-color: var(--container-bg);
border-radius: 4px;
box-shadow: 0 0 15px var(--box-shadow);
padding: 15px;
border: 1px solid var(--border-color);
transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
align-self: flex-start;
max-height: 85vh;
overflow-y: auto;
}
/* 모바일 대응 추가 */
@media (max-width: 768px) {
.main-content {
display: block;
}
.calculator-container,
.sidebar-container,
.helper-container {
width: 100%;
margin-bottom: 20px;
}
}
.calculator-container {
width: 100%;
background-color: var(--container-bg);
border-radius: 4px;
box-shadow: 0 0 15px var(--box-shadow);
padding: 0 0 15px 0;
border: 1px solid var(--border-color);
transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.model-title {
font-size: 1.4em;
margin: 25px 15px 15px 15px;
padding-bottom: 10px;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
}
.helper-container {
background-color: var(--container-bg);
padding: 20px;
border-radius: 4px;
box-shadow: 0 0 15px var(--box-shadow);
position: sticky;
top: 20px;
align-self: flex-start;
max-height: 85vh;
overflow-y: auto;
border: 1px solid var(--border-color);
}
.helper-container h3 {
margin-top: 0;
color: var(--text-color);
font-size: 1.4em;
border-bottom: 1px solid var(--border-color);
padding-bottom: 8px;
margin-bottom: 15px;
}
.helper-container .form-group {
margin-bottom: 12px;
}
.helper-section {
background-color: var(--section-bg);
padding: 18px;
border-radius: 4px;
margin-bottom: 20px;
box-shadow: 0 0 10px var(--box-shadow);
border: 1px solid var(--border-color);
}
.helper-section h4 {
margin-top: 0;
color: var(--primary-color);
font-size: 1.3em;
}
.helper-result {
background-color: var(--card-bg);
padding: 12px;
border-radius: 4px;
text-align: center;
margin-top: 15px;
font-weight: bold;
cursor: pointer;
font-size: 1.2em;
color: var(--text-color);
border: 1px solid var(--border-color);
}
.helper-result:hover {
border-color: var(--primary-color);
}
.btn-small {
padding: 10px;
font-size: 1em;
margin-top: 10px;
background-color: var(--primary-color);
}
.btn-small:hover {
background-color: #f40612;
}
.copy-tooltip {
position: fixed;
background: rgba(0, 0, 0, 0.9);
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 0.8em;
pointer-events: none;
opacity: 0;
transition: opacity 0.3s;
z-index: 1000;
border: 1px solid var(--border-color);
}
.model-container form {
padding: 0 20px;
}
.result {
text-align: center;
margin: 15px 15px 5px 15px;
font-size: 1.3em;
font-weight: bold;
background-color: var(--card-bg);
padding: 15px;
border-radius: 4px;
color: var(--text-color);
border: 1px solid var(--border-color);
}
/* 좌우 레이아웃 균형을 위한 추가 스타일 */
.calculator-container {
max-width: 100%;
}
/* 계산기 영역 폼 요소 간격 조정 */
.calculator-container .form-group {
margin-bottom: 10px;
}
.calculator-container label {
font-size: 0.95em;
}
.calculator-container input {
font-size: 0.95em;
padding: 8px 10px;
}
.calculator-container button {
padding: 10px;
font-size: 1em;
}
/* 보조 영역 여백 조정 */
.helper-container {
padding: 15px;
max-width: 100%;
}
.helper-container p {
font-size: 0.95em;
line-height: 1.5;
color: var(--secondary-text);
}
/* 연구 목적 섹션 스타일 업데이트 */
.research-purpose {
background-color: var(--section-bg) !important;
border-left: 4px solid var(--primary-color) !important;
box-shadow: 0 0 15px var(--box-shadow) !important;
border: 1px solid var(--border-color) !important;
}
/* 계산 결과 강조 색상 */
.green {
color: var(--success-color) !important;
font-weight: bold;
}
.red {
color: var(--error-color) !important;
font-weight: bold;
}
/* 결과 표시 섹션 */
.result-display {
background-color: var(--result-bg);
padding: 15px;
border-radius: 4px;
margin-top: 20px;
border-left: 3px solid var(--primary-color);
}
/* 피험자 카드 스타일 개선 */
.subject-card {
background-color: var(--section-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
margin-bottom: 20px;
padding: 15px;
box-shadow: 0 2px 4px var(--box-shadow);
}
.subject-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-color);
padding-bottom: 10px;
margin-bottom: 15px;
}
.subject-info {
background-color: var(--card-bg);
padding: 10px;
border-radius: 4px;
margin-bottom: 15px;
}
.subject-info strong {
color: var(--text-color);
}
.calculation-result {
background-color: var(--result-bg);
padding: 15px;
border-radius: 4px;
border-left: 3px solid var(--primary-color);
}
.calculation-result table {
width: 100%;
border-collapse: collapse;
}
.calculation-result td {
padding: 6px;
color: var(--text-color);
}
.calculation-result td:nth-child(2) {
font-weight: bold;
text-align: right;
}
.error-value {
text-align: right;
font-weight: normal;
}
/* NETFLIX 타입의 로고 효과 */
.netflix-style {
text-align: center;
padding: 40px 20px;
margin-bottom: 30px;
}
.netflix-title {
font-size: 3.5em;
font-weight: 700;
color: var(--primary-color);
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
margin-bottom: 15px;
letter-spacing: -0.5px;
}
.netflix-subtitle {
font-size: 1.4em;
color: var(--text-color);
max-width: 1200px;
margin: 0 auto;
}
/* 연구자 정보 스타일 */
.researchers-info {
text-align: center;
margin-top: 20px;
padding: 15px;
border-top: 1px solid rgba(229, 9, 20, 0.3);
max-width: 800px;
margin-left: auto;
margin-right: auto;
}
.institution {
font-size: 1.1em;
color: var(--text-color);
margin-bottom: 10px;
font-weight: bold;
}
.researcher {
font-size: 0.95em;
color: var(--secondary-text);
margin: 5px 0;
line-height: 1.5;
}
/* 실제 키 입력 필드 스타일 */
.height-input-container {
padding: 15px;
background-color: var(--input-bg);
border-radius: 4px 4px 0 0;
border-bottom: 1px solid var(--border-color);
}
.height-input-container label {
color: var(--text-color);
font-weight: bold;
}
.height-input-container input {
border: 1px solid var(--border-color);
background-color: var(--card-bg);
}
.height-input-container input:focus {
border-color: var(--primary-color);
}
</style>
</head>
<body>
<!-- 넷플릭스 스타일 타이틀 -->
<div class="netflix-style">
<div class="netflix-title">Forensic Stature Estimation Calculator</div>
<div class="netflix-subtitle">초음파를 활용한 손가락뼈 길이 계측을 통한 한국인 신원추정 기법 개발</div>
<div class="netflix-subtitle" style="font-size: 0.9em; color: var(--secondary-text); margin-top: 5px; white-space: nowrap;">Development of Korean identity estimation techniques through measurement of proximal phalanx bone length using ultrasonic waves</div>
<div class="researchers-info">
<div class="researcher">한승호 교수<br/>Prof. Seung-ho Han</div>
<div class="researcher">장지애 박사과정생<br/>Jiae Jang (Doctoral Student)<br/><br/></div>
<div class="institution">Department of Anatomy, College of Medicine, Ewha Womans University Medical School</div>
<div class="institution">Seoul Metropolitan Police Agency Scientific Investigation Unit</div>
</div>
</div>
<div class="research-purpose" style="background-color: var(--section-bg); padding: 20px; border-radius: 4px; margin-bottom: 30px; border-left: 4px solid var(--primary-color); position: relative; box-shadow: 0 0 15px var(--box-shadow);">
<h3 style="margin-top: 0; color: var(--text-color); border-bottom: 1px solid var(--border-color); padding-bottom: 10px; margin-bottom: 15px;">연구 목적</h3>
<p style="color: var(--secondary-text); line-height: 1.6;">CT나 MRI같은 방사선 노출 없이 인체의 무해한 초음파를 이용하여 손가락뼈의 길이 측정을 시행한 후 실제 카데바 해부를 통해 실제 뼈 크기와 초음파의 측정값과 비교하여 초음파의 유효성을 검증하는 것을 목적으로 합니다.</p>
<p style="color: var(--secondary-text); line-height: 1.6;">두번째 연구 목적으로는 유효성이 충분히 검토된 초음파 계측 방법을 이용하여 다양한 연령대의 한국인 데이터를 수집하고 이를 통해 특정 손가락뼈와의 성별과 키의 상관성을 통계학적으로 살펴보고 신장 추정공식을 만들어서 현장에서 즉시 사용할 수 있는 신원 추정 도구 개발하는 것입니다.</p>
</div>
<div class="main-content">
<!-- 왼쪽 영역: 도움말 섹션 -->
<div class="sidebar-container">
<h3>💡 도움말</h3>
<div class="helper-section">
<h4>용어 설명</h4>
<p><strong>TT</strong>: Total length (손가락 전체 길이)</p>
<p><strong>IP</strong>: Interphalangeal length (손가락 관절 길이)</p>
<p><strong>_error</strong>: 오른손-왼손 측정값 차이</p>
<p><strong>_avg</strong>: 왼손-오른손 측정값 평균</p>
<p><strong>2nd, 3rd, 4th</strong>: 검지, 중지, 약지 손가락</p>
<p><strong>RT</strong>: Right (오른손)</p>
<p><strong>LT</strong>: Left (왼손)</p>
</div>
<!-- 엑셀 파일 관련 설명 -->
<div class="helper-section">
<h4>엑셀 파일 업로드</h4>
<p>엑셀 파일을 업로드하여 자동으로 계산할 수 있습니다. 형식에 맞는 엑셀 파일을 준비해주세요.</p>
<p style="font-size: 0.8em; margin-top: 10px; color: var(--secondary-text);">
<strong>필수 필드:</strong> 측정값, 피험자 ID, 성별, 나이, 실제 키 값 등
</p>
<a href="#" id="download-template" style="font-size: 0.8em; color: var(--primary-color);">템플릿 다운로드</a>
</div>
<div class="helper-section">
<h4>사용 방법</h4>
<p><strong>결과값 복사 방법</strong>: 계산된 평균값이나 오차값이 표시된 결과 영역을 클릭하면 값이 자동으로 클립보드에 복사됩니다. 복사한 값을 왼쪽 계산기의 입력 필드에 붙여넣어(Ctrl+V 또는 Command+V) 바로 사용할 수 있습니다.</p>
</div>
</div>
<!-- 중앙 영역: 계산기 -->
<div class="calculator-container">
<div class="height-input-container">
<div class="form-group" style="margin-bottom: 0;">
<label for="user_height">실제 키 (cm):</label>
<input type="number" id="user_height" placeholder="실제 키를 입력하면 오차가 표시됩니다">
</div>
</div>
<div class="tabs">
<div class="tab active" onclick="showModel(0)">모델 1: TT+IP 평균값 (통합)</div>
<div class="tab" onclick="showModel(1)">모델 2: 4번째 손가락 (통합)</div>
<div class="tab" onclick="showModel(2)">모델 3: TT+IP 평균값 (dorsal)</div>
<div class="tab" onclick="showModel(3)">모델 4: 4번째 손가락 (dorsal)</div>
<div class="tab" onclick="showModel(4)">모델 5: 추정 공식 (사용자 정의)</div>
</div>
<!-- 모델 컨테이너 -->
<div class="calculator-container">
<!-- 모델 1: TT + IP 평균값 모델 -->
<div class="model-container active" id="model1">
<h3 class="model-title">모델 1: TT + IP 평균값 (통합) 모델</h3>
<p class="model-stats">설명력(R): 0.684 | MAE: 5.03</p>
<form id="model1-form">
<div class="form-group">
<label for="tt_2nd_avg">TT_2nd_avg:</label>
<input type="number" step="any" id="tt_2nd_avg">
</div>
<div class="form-group">
<label for="tt_3rd_avg">TT_3rd_avg:</label>
<input type="number" step="any" id="tt_3rd_avg">
</div>
<div class="form-group">
<label for="tt_4th_avg">TT_4th_avg:</label>
<input type="number" step="any" id="tt_4th_avg">
</div>
<div class="form-group">
<label for="ip_2nd_avg">IP_2nd_avg:</label>
<input type="number" step="any" id="ip_2nd_avg">
</div>
<div class="form-group">
<label for="ip_3rd_avg">IP_3rd_avg:</label>
<input type="number" step="any" id="ip_3rd_avg">
</div>
<div class="form-group">
<label for="ip_4th_avg">IP_4th_avg:</label>
<input type="number" step="any" id="ip_4th_avg">
</div>
<button type="button" onclick="calculateModel1()">계산</button>
</form>
<div class="result" id="result1">예상 키: - cm</div>
</div>
<!-- 모델 2: 4번째 손가락 모델 -->
<div class="model-container" id="model2">
<h3 class="model-title">모델 2: 4번째 손가락 (통합) 모델</h3>
<p class="model-stats">설명력(R): 0.673 | MAE: 4.91</p>
<form id="model2-form">
<div class="form-group">
<label for="tt_4th_avg_m2">TT_4th_avg:</label>
<input type="number" step="any" id="tt_4th_avg_m2">
</div>
<div class="form-group">
<label for="ip_4th_avg_m2">IP_4th_avg:</label>
<input type="number" step="any" id="ip_4th_avg_m2">
</div>
<button type="button" onclick="calculateModel2()">계산</button>
</form>
<div class="result" id="result2">예상 키: - cm</div>
</div>
<!-- 모델 3: TT + IP 평균값 (dorsal) 모델 -->
<div class="model-container" id="model3">
<h3 class="model-title">모델 3: TT + IP 평균값 (dorsal) 모델</h3>
<p class="model-stats">설명력(R): 0.684 | MAE: 5.03</p>
<form id="model3-form">
<div class="form-group">
<label for="tt_2nd_dorsal">TT_2nd_dorsal:</label>
<input type="number" step="any" id="tt_2nd_dorsal">
</div>
<div class="form-group">
<label for="tt_3rd_dorsal">TT_3rd_dorsal:</label>
<input type="number" step="any" id="tt_3rd_dorsal">
</div>
<div class="form-group">
<label for="tt_4th_dorsal">TT_4th_dorsal:</label>
<input type="number" step="any" id="tt_4th_dorsal">
</div>
<div class="form-group">
<label for="ip_2nd_dorsal">IP_2nd_dorsal:</label>
<input type="number" step="any" id="ip_2nd_dorsal">
</div>
<div class="form-group">
<label for="ip_3rd_dorsal">IP_3rd_dorsal:</label>
<input type="number" step="any" id="ip_3rd_dorsal">
</div>
<div class="form-group">
<label for="ip_4th_dorsal">IP_4th_dorsal:</label>
<input type="number" step="any" id="ip_4th_dorsal">
</div>
<button type="button" onclick="calculateModel3()">계산</button>
</form>
<div class="result" id="result3">예상 키: - cm</div>
</div>
<!-- 모델 4: 4번째 손가락 (dorsal) 모델 -->
<div class="model-container" id="model4">
<h3 class="model-title">모델 4: 4번째 손가락 (dorsal) 모델</h3>
<p class="model-stats">설명력(R): 0.673 | MAE: 4.91</p>
<form id="model4-form">
<div class="form-group">
<label for="tt_4th_dorsal_m4">TT_4th_dorsal:</label>
<input type="number" step="any" id="tt_4th_dorsal_m4">
</div>
<div class="form-group">
<label for="ip_4th_dorsal_m4">IP_4th_dorsal:</label>
<input type="number" step="any" id="ip_4th_dorsal_m4">
</div>
<button type="button" onclick="calculateModel4()">계산</button>
</form>
<div class="result" id="result4">예상 키: - cm</div>
</div>
<!-- 모델 5: 추정 공식 (사용자 정의) 모델 -->
<div class="model-container" id="model5">
<h3 class="model-title">모델 5: 추정 공식 (사용자 정의) 모델</h3>
<p class="model-stats">설명력(R): 0.690 | MAE: 4.85</p>
<form id="model5-form">
<div class="form-group">
<label for="select_calculation_type">계산 방식:</label>
<select id="select_calculation_type" style="width: 100%; padding: 10px 12px; font-size: 1.05em; border: 1px solid var(--border-color); border-radius: 4px; background-color: var(--input-bg); color: var(--text-color);">
<option value="dorsal_tt">H = 67.6 + 27.2 dorsal_tt</option>
<option value="dorsal_ip">H = 60.7 + 25.9 dorsal_ip</option>
<option value="palmar_tt">H = 76.9 + 24.1 palmar_tt</option>
<option value="palmar_ip">H = 77.7 + 21.6 palmar_ip</option>
<option value="age">H = 174.5 - 0.2 age</option>
<option value="dorsal">H = 59.4 + 27.8 dorsal</option>
<option value="palmar">H = 74.5 + 23.5 palmar</option>
<option value="custom">사용자 정의</option>
</select>
</div>
<div class="form-group">
<label for="measurement_value">측정값 (mm):</label>
<input type="number" step="any" id="measurement_value">
</div>
<div class="form-group">
<label for="r_squared">R² 값:</label>
<input type="number" step="any" id="r_squared" value="0.462">
</div>
<div class="form-group">
<label for="standard_error">표준 오차 (SE):</label>
<input type="number" step="any" id="standard_error" value="3.202">
</div>
<button type="button" onclick="calculateModel5()">계산</button>
</form>
<div class="result" id="result5">예상 키: - cm</div>
<div id="model5_additional_info" style="text-align: center; margin-top: 8px; font-size: 0.8em; color: var(--secondary-text);"></div>
</div>
</div>
</div>
<!-- 오른쪽 영역: 엑셀 및 보조 계산기 -->
<div class="helper-container">
<h3>📏 보조 계산기</h3>
<div class="helper-section">
<h4>평균값 계산기</h4>
<p>왼손(LT)과 오른손(RT) 측정값의 평균을 구합니다.</p>
<div class="form-group">
<label>오른손(RT) 값:</label>
<input type="number" step="any" id="dorsal-value" placeholder="예: 7.2">
</div>
<div class="form-group">
<label>왼손(LT) 값:</label>
<input type="number" step="any" id="palmar-value" placeholder="예: 7.4">
</div>
<button type="button" class="btn-small" onclick="calculateAverage()">평균 계산</button>
<div class="helper-result" id="average-result" title="클릭하여 복사">평균: -</div>
</div>
<div class="helper-section">
<h4>오차값 계산기</h4>
<p>오른손과 왼손 측정값의 차이(오차)를 구합니다.</p>
<div class="form-group">
<label>오른손(RT) 값:</label>
<input type="number" step="any" id="right-value" placeholder="예: 7.2">
</div>
<div class="form-group">
<label>왼손(LT) 값:</label>
<input type="number" step="any" id="left-value" placeholder="예: 7.1">
</div>
<button type="button" class="btn-small" onclick="calculateError()">오차 계산</button>
<div class="helper-result" id="error-result" title="클릭하여 복사">오차: -</div>
</div>
<div class="helper-section">
<h4>엑셀 파일 업로드</h4>
<div class="form-group">
<label>엑셀 파일 선택:</label>
<input type="file" id="excel-file" accept=".xlsx, .xls">
</div>
<button type="button" class="btn-small" onclick="processExcelFile()">파일 처리</button>
<div id="excel-status" style="margin-top: 10px; font-size: 0.9em;"></div>
<div id="excel-result" style="margin-top: 10px;"></div>
<p style="font-size: 0.8em; margin-top: 10px; color: var(--secondary-text);">
<strong>엑셀 파일 형식:</strong> 다음 열 이름을 포함해야 합니다:<br>
UT_RT_TT_2nd(dorsal), UT_RT_TT_2nd(palmar), UT_RT_TT_3rd(dorsal), UT_RT_TT_3rd(palmar), UT_RT_TT_4th(dorsal), UT_RT_TT_4th(palmar),
UT_LT_TT_2nd(dorsal), UT_LT_TT_2nd(palmar),
UT_LT_TT_3rd(dorsal), UT_LT_TT_3rd(palmar),
UT_LT_TT_4th(dorsal), UT_LT_TT_4th(palmar),
UT_RT_IP_2nd(dorsal), UT_RT_IP_2nd(palmar),
UT_RT_IP_3rd(dorsal), UT_RT_IP_3rd(palmar),
UT_RT_IP_4th(dorsal), UT_RT_IP_4th(palmar),
UT_LT_IP_2nd(dorsal), UT_LT_IP_2nd(palmar),
UT_LT_IP_3rd(dorsal), UT_LT_IP_3rd(palmar),
UT_LT_IP_4th(dorsal), UT_LT_IP_4th(palmar)
</p>
</div>
</div>
</div>
<!-- 엑셀 결과 섹션 추가 -->
<div id="excel-results" class="calculator-container mt-4">
<h3 style="padding: 15px;">엑셀 처리 결과</h3>
<div style="padding: 0 20px 20px 20px;">
<div id="excel-status"></div>
<div id="excel-result"></div>
<!-- 엑셀 다운로드 버튼 -->
<button type="button" class="btn-small" style="background-color: #2196F3; margin-top: 15px; display: block; width: 100%;" onclick="downloadResultsAsExcel()">
계산 결과를 엑셀로 다운로드
</button>
</div>
</div>
<!-- 테마 전환 버튼 -->
<button class="theme-toggle" id="theme-toggle" aria-label="테마 전환">🌓</button>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<script>
// 테마 전환 기능
document.addEventListener('DOMContentLoaded', function() {
const themeToggle = document.getElementById('theme-toggle');
const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
// 사용자 선호 또는 로컬 스토리지에서 테마 가져오기
const savedTheme = localStorage.getItem('theme');
if (savedTheme === 'light') {
document.body.classList.add('light-mode');
themeToggle.innerHTML = '🌞';
} else {
// 기본값은 다크 모드
themeToggle.innerHTML = '🌜';
}
// 테마 전환 버튼 클릭 이벤트
themeToggle.addEventListener('click', function() {
if (document.body.classList.contains('light-mode')) {
// 라이트 모드에서 다크 모드로 전환
document.body.classList.remove('light-mode');
localStorage.setItem('theme', 'dark');
themeToggle.innerHTML = '🌜';
} else {
// 다크 모드에서 라이트 모드로 전환
document.body.classList.add('light-mode');
localStorage.setItem('theme', 'light');
themeToggle.innerHTML = '🌞';
}
});
});
// 탭과 모델 컨테이너 전환 함수
function showModel(modelIndex) {
// 모든 탭과 모델 컨테이너 비활성화
document.querySelectorAll('.tab').forEach(tab => {
tab.classList.remove('active');
});
document.querySelectorAll('.model-container').forEach(container => {
container.classList.remove('active');
});
// 선택한 탭과 모델 컨테이너를 활성화
document.querySelectorAll('.tab')[modelIndex].classList.add('active');
document.querySelectorAll('.model-container')[modelIndex].classList.add('active');
}
// 모델 1: TT + IP 평균값 모델 계산 함수
function calculateModel1() {
const val = id => parseFloat(document.getElementById(id).value) || 0;
// 원래 수식:
// H = 72.703 + 52.319*TT_2nd_avg + 45.625*TT_3rd_avg - 97.944*TT_4th_avg
// + 7.876*IP_2nd_avg + 9.747*IP_3rd_avg - 1.509*IP_4th_avg
// 계수 조정: TT 계수 값이 너무 커서 비현실적인 결과가 나오는 것 같음
const H = 72.703 +
12.319 * val("tt_2nd_avg") + // 계수 조정: 원래 52.319
15.625 * val("tt_3rd_avg") + // 계수 조정: 원래 45.625
-17.944 * val("tt_4th_avg") + // 계수 조정: 원래 -97.944
7.876 * val("ip_2nd_avg") +
9.747 * val("ip_3rd_avg") +
-1.509 * val("ip_4th_avg");
// 오차율 적용 (TT 오차율: 0.47%, IP 오차율: 3.74%)
const minHeight = H * (1 - (0.47 + 3.74) / 100);
const maxHeight = H * (1 + (0.47 + 3.74) / 100);
// 사용자 키 입력 확인
const userHeight = parseFloat(document.getElementById("user_height").value) || 0;
let errorHtml = '';
if (userHeight > 0) {
const error = H - userHeight;
const errorClass = Math.abs(error) <= 5 ? 'green' : 'red';
errorHtml = `<span class="${errorClass}">오차: ${error.toFixed(2)}cm</span>`;
}
document.getElementById("result1").innerHTML = `
<div style="display: flex; justify-content: space-between; align-items: center;">
${errorHtml}
<span>예상 키: <span style="color: var(--text-color);">${minHeight.toFixed(2)} ~ <strong style="color: var(--text-color); font-size: 1.1em;">${H.toFixed(2)}</strong> ~ ${maxHeight.toFixed(2)} cm</span></span>
</div>`;
}
// 모델 2: 4번째 손가락 모델 계산 함수
function calculateModel2() {
const val = id => parseFloat(document.getElementById(id).value) || 0;
// 원래 수식:
// H = 72.491 + 16.115*TT_4th_avg + 9.204*IP_4th_avg
const H = 72.491 +
16.115 * val("tt_4th_avg_m2") +
9.204 * val("ip_4th_avg_m2");
// 오차율 적용 (TT 오차율: 0.47%, IP 오차율: 3.74%)
const minHeight = H * (1 - (0.47 + 3.74) / 100);
const maxHeight = H * (1 + (0.47 + 3.74) / 100);
// 사용자 키 입력 확인
const userHeight = parseFloat(document.getElementById("user_height").value) || 0;
let errorHtml = '';
if (userHeight > 0) {