-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
4111 lines (3939 loc) · 210 KB
/
Copy pathindex.html
File metadata and controls
4111 lines (3939 loc) · 210 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" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Robotic Head · SIM mv-p3.5</title>
<script type="importmap">
{
"imports": {
"three": "./assets/vendor/three/three.module.js",
"three/addons/": "./assets/vendor/three/addons/"
}
}
</script>
<!-- [R4 수정] three.js r160 로컬 벤더링 — 오프라인 ESP32 SoftAP 서빙에서도 3D 트윈·게이지 동작 -->
<style>
:root {
--bg: #0b0f14;
--panel: #121821;
--panel-2: #18202b;
--line: #243140;
--grid: #1b2531;
--grid-major: #2b3a4d;
--grid-zero: #5a7da0;
--text: #d7e0ea;
--text-dim: #8a97a6;
--accent: #38bdf8;
--pan: #38bdf8;
--tilt: #f5a524;
--zoom: #a78bfa;
--focus: #4ade80;
--flt: #ec4899;
--danger: #f87171;
--ok: #22c55e;
}
* {
box-sizing: border-box; min-width: 0;
-webkit-user-select: none; user-select: none;
}
html, body {
height: 100%; margin: 0;
-webkit-user-select: none; user-select: none;
-webkit-touch-callout: none;
overscroll-behavior: none;
}
body {
background: var(--bg);
color: var(--text);
font-family: "Segoe UI", system-ui, -apple-system, "Malgun Gothic", sans-serif;
font-size: 13px;
display: flex;
flex-direction: column;
overflow: hidden;
padding: 14px;
}
.frame {
position: relative;
flex: 1; display: flex; flex-direction: column; min-height: 0;
border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
header {
display: flex; align-items: center; gap: 14px;
padding: 10px 18px;
background: linear-gradient(180deg,#141c26,#0d141c);
border-bottom: 1px solid var(--line);
}
/* mv3.3: 로고 삭제 — 가로 태블릿 헤더 공간 확보 */
header .sub { color: var(--text-dim); font-size: 12px; }
header .badge {
margin-left: auto; font-size: 11px; color: var(--text-dim);
border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px;
}
.stage-tag { color: var(--accent); font-weight: 600; }
.hlegend { display: flex; gap: 13px; font-size: 11.5px; color: var(--text-dim); align-items: center; }
.hlegend span { display: inline-flex; align-items: center; }
.hlegend i { display: inline-block; width: 15px; height: 3px; margin-right: 6px; border-radius: 2px; }
main { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.center-col { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.graph-wrap { flex: 1; position: relative; min-width: 0; min-height: 0; background: #0a0e13; }
canvas { display: block; width: 100%; height: 100%; cursor: crosshair; touch-action:none; }
.graph-wrap.speed-view canvas { cursor: default; }
.graph-tabs {
display: flex; align-self: stretch; align-items: stretch; gap: 0; margin: -10px 0;
border-left: 1px solid var(--line); border-right: 1px solid var(--line);
background: rgba(10,14,19,.42);
}
.graph-tab {
position: relative; min-width: 96px; padding: 10px 15px 9px;
border: 0; border-right: 1px solid rgba(36,49,64,.7); border-radius: 0;
background: transparent; color: var(--text-dim); font-size: 12px; font-weight: 700;
cursor: pointer; touch-action: manipulation; transition: color .16s, background .16s;
}
.graph-tab:first-child { border-left: 1px solid rgba(36,49,64,.7); }
.graph-tab:hover { color: var(--text); background: rgba(56,189,248,.05); }
.graph-tab.active { color: var(--accent); background: linear-gradient(180deg,rgba(56,189,248,.02),rgba(56,189,248,.12)); }
.graph-tab.active::after {
content:""; position:absolute; left:0; right:0; bottom:0; height:3px; background:var(--accent);
box-shadow:0 -2px 10px rgba(56,189,248,.42);
}
.time-zoom-controls {
display:flex; align-items:center; gap:4px; margin-left:8px; padding:5px 7px;
border-left:1px solid var(--line);
}
.time-zoom-btn {
width:30px; min-width:30px; height:30px; padding:0; border:1px solid var(--line); border-radius:7px;
background:#0d141c; color:var(--text); font-size:17px; font-weight:800; cursor:pointer;
touch-action:manipulation;
}
.time-zoom-btn:hover { color:var(--accent); border-color:var(--accent); }
.time-zoom-btn:disabled { opacity:.28; cursor:not-allowed; color:var(--text-dim); border-color:var(--line); }
.time-zoom-btn.fps-pre { width:auto; min-width:34px; padding:0 8px; font-size:12px; }
.time-zoom-btn.fps-pre.on { background:rgba(56,189,248,.16); border-color:var(--accent); color:var(--accent); }
.time-zoom-readout,
.y-range-readout {
display:inline-flex; align-items:center; justify-content:center; height:30px;
border:1px solid var(--line); border-radius:7px; background:#0d141c;
color:var(--accent); text-align:center; font-size:12px; font-weight:800;
font-variant-numeric:tabular-nums;
}
.time-zoom-readout { min-width:46px; }
.y-range-controls {
display:flex; align-items:center; gap:6px; margin-left:6px; padding:5px 7px;
border-left:1px solid var(--line);
}
.time-zoom-controls > label,
.y-range-controls > label { font-size:12.5px; font-weight:800; color:var(--text-dim); letter-spacing:.3px; }
.y-range-readout { min-width:66px; }
.hint {
flex: none; margin: 6px 14px 10px;
color: var(--text-dim); font-size: 11px;
background: rgba(10,14,19,.55); padding: 5px 10px; border-radius: 6px;
border: 1px solid var(--line); width: fit-content; max-width: calc(100% - 28px);
}
.toast {
position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
background: var(--panel-2); border: 1px solid var(--accent); color: var(--text);
padding: 8px 14px; border-radius: 8px; font-size: 12px; opacity: 0;
transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }
/* [클린업] 구 모터 다이얼 패널 CSS(.motor-*) 제거 — 대상 DOM 부재 데드코드 */
aside {
width: var(--aside-w, 308px); flex: none; background: var(--panel);
display: flex; flex-direction: column; overflow: hidden;
border-left: 1px solid var(--line);
}
aside.viewer-locked { opacity: .38; filter: grayscale(.32); pointer-events: none; }
.aside-top { flex: 0.4 1 0; min-height: 0; overflow-y: auto; padding: 12px 12px 2px; background: var(--panel); }
.aside-top::-webkit-scrollbar { width: 9px; }
.aside-top::-webkit-scrollbar-thumb { background: #263344; border-radius: 8px; }
/* 우측 메뉴 분할선(고정/스크롤 비율 조절) — 저작/트윈 vsplit과 동일 패턴 (mv3.3) */
.menu-split {
flex: none; height: 11px; cursor: row-resize; touch-action: none;
display: flex; align-items: center; justify-content: center;
background: linear-gradient(180deg,#101823,#0d141c);
border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.menu-split:hover .vsplit-grip { background: var(--accent); }
/* 우측 메뉴 가로폭 분할선 (mv3.3) — 중앙 영역 ↔ 메뉴바 폭 조절 */
.hsplit {
flex: none; width: 11px; cursor: col-resize; touch-action: none;
display: flex; align-items: center; justify-content: center;
background: linear-gradient(90deg,#0c121a,#0a0e13);
border-left: 1px solid var(--line); border-right: 1px solid var(--line);
}
.hsplit:hover .hsplit-grip { background: var(--accent); }
.hsplit-grip { width: 4px; height: 48px; border-radius: 3px; background: #34465a; transition: background .15s; }
.aside-top .group { margin-bottom: 10px; }
.aside-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.aside-scroll::-webkit-scrollbar { width: 9px; }
.aside-scroll::-webkit-scrollbar-thumb { background: #263344; border-radius: 8px; }
.group { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.group h3 {
margin: 0 0 11px; padding: 0 0 8px; font-size: 14px; color: #5b6675;
font-weight: 800; letter-spacing: .2px;
border-bottom: 1px solid var(--line);
}
.subh { font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: .3px; margin: 12px 0 5px; }
.dimmed { opacity: .42; pointer-events: none; }
input[type=range]:disabled { opacity: .4; cursor: not-allowed; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 9px 0; min-width: 0; }
.row label { color: var(--text); font-size: 12.5px; flex: 0 0 auto; }
.row .val { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 12px; min-width: 56px; text-align: right; flex: 0 0 auto; }
input[type=range] {
-webkit-appearance: none; appearance: none;
width: clamp(96px, 45%, 170px); max-width: 100%; height: 24px;
background: transparent; outline: none; touch-action: pan-y;
}
input[type=range]::-webkit-slider-runnable-track { height: 6px; background: #2a3848; border-radius: 999px; }
input[type=range]::-moz-range-track { height: 6px; background: #2a3848; border-radius: 999px; }
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px;
border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid #0b0f14;
box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
input[type=range]::-moz-range-thumb {
width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
cursor: pointer; border: 2px solid #0b0f14; box-shadow: 0 0 0 4px rgba(56,189,248,.12);
}
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.pan-dot { color: var(--pan); } .tilt-dot { color: var(--tilt); }
.zoom-dot { color: var(--zoom); } .focus-dot { color: var(--focus); }
.move-row input[type=range] { flex: 1 1 150px; }
.tbtn {
border: 1px solid var(--line); background: #0d141c; color: var(--text-dim);
border-radius: 7px; padding: 6px 10px; font-size: 12px; cursor: pointer; transition: all .15s;
min-width: 0;
}
.tbtn:hover { border-color: var(--accent); color: var(--text); }
.tbtn.on { background: rgba(56,189,248,.15); border-color: var(--accent); color: var(--accent); }
/* 라운드 슬라이드 스위치 (ON/OFF) */
.sw {
position: relative; width: 44px; height: 23px; flex: none; padding: 0;
border: 1px solid var(--line); background: #0d141c; border-radius: 999px;
cursor: pointer; transition: background .15s, border-color .15s;
}
.sw::after {
content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
border-radius: 50%; background: var(--text-dim); transition: transform .18s, background .18s;
}
.sw:hover { border-color: var(--accent); }
.sw.on { background: rgba(56,189,248,.28); border-color: var(--accent); }
.sw.on::after { transform: translateX(21px); background: var(--accent); }
.sw.disabled { opacity: .4; cursor: not-allowed; }
.sw.disabled:hover { border-color: var(--line); }
/* 완화/승인은 PTZF 축 선택 버튼 수준의 컴팩트 크기 — 미리보기 스위치를 같은 행 왼쪽에 배치 */
.actions { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.preview-inline { display: inline-flex; align-items: center; gap: 7px; margin-right: auto; }
.preview-inline label { font-size: 12.5px; color: var(--text); }
.btn {
flex: 0 0 auto; padding: 6px 13px; border-radius: 7px; border: none; cursor: pointer;
font-size: 12px; font-weight: 700; letter-spacing: .3px; transition: filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn-main { background: var(--flt); color: #04150e; }
.btn-main.edit { background: var(--tilt); color: #1a1000; }
.btn-confirm { background: var(--accent); color: #041420; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(44px, 1fr)); gap: 7px; width: 100%; }
.preset {
min-height: 34px; aspect-ratio: 1.4; border: 1px solid var(--line); background: #0d141c; color: var(--text-dim);
border-radius: 8px; font-size: 12px; cursor: default; display: flex; align-items: center; justify-content: center;
position: relative; transition: all .2s;
}
.preset.lit { background: rgba(34,197,94,.16); border-color: var(--ok); color: var(--ok); box-shadow: 0 0 10px rgba(34,197,94,.35); cursor: pointer; }
.preset.lit:hover { filter: brightness(1.2); }
.preset.loaded { background: rgba(236,72,153,.22); border: 2px solid #f472b6; color: #f9a8d4; font-weight: 700; box-shadow: 0 0 16px rgba(236,72,153,.7); }
.presets.delmode .preset.lit { border-color: var(--danger); color: var(--danger); background: rgba(248,113,113,.14); box-shadow: 0 0 10px rgba(248,113,113,.35); }
.presets.delmode .preset.lit:hover { background: rgba(248,113,113,.3); }
.pbtn {
width: 32px; height: 28px; border: 1px solid var(--line); background: #0d141c;
color: var(--text); border-radius: 7px; cursor: pointer; font-size: 12px; line-height: 1;
display: flex; align-items: center; justify-content: center;
}
.pbtn:hover { border-color: var(--accent); color: var(--accent); }
.pbtn.on { background: rgba(56,189,248,.16); border-color: var(--accent); color: var(--accent); }
.pbtn.disabled { opacity: .35; cursor: not-allowed; }
.ptrack { flex: 1; height: 6px; background: #243140; border-radius: 6px; position: relative; cursor: pointer; }
.pfill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 6px; }
.ptime { color: var(--text-dim); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.mini { display: flex; gap: 6px; min-width: 0; }
.mini .tbtn { flex: 1; text-align: center; }
.point-count-control { display:flex; align-items:center; gap:6px; margin-left:auto; flex:1 1 auto; min-width:0; }
.point-count-slider {
--point-color:var(--accent); flex:1 1 72px; width:auto !important; min-width:54px; max-width:104px;
}
.point-count-control[data-axis="pan"] .point-count-slider { --point-color:var(--pan); }
.point-count-control[data-axis="tilt"] .point-count-slider { --point-color:var(--tilt); }
.point-count-control[data-axis="zoom"] .point-count-slider { --point-color:var(--zoom); }
.point-count-control[data-axis="focus"] .point-count-slider { --point-color:var(--focus); }
.point-count-slider::-webkit-slider-thumb { background:var(--point-color); }
.point-count-slider::-moz-range-thumb { background:var(--point-color); }
.point-count-value {
min-width:48px; height:30px; display:inline-flex; align-items:center; justify-content:center;
border:1px solid var(--line); border-radius:7px; background:#0d141c; color:var(--accent);
font-size:14px; font-weight:800; font-variant-numeric:tabular-nums;
}
.stepper { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.stepbtn {
width: 30px; height: 30px; padding: 0; border-radius: 8px;
display: inline-flex; align-items: center; justify-content: center;
font-size: 18px; line-height: 1; font-weight: 700;
touch-action: manipulation; user-select: none;
}
.stepbtn:disabled { opacity:.28; cursor:not-allowed; border-color:var(--line); }
.jogset { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.jogset input[type=range] { width: 78px; }
.jogset .val { min-width: 30px; font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
/* 완화 강도 슬라이더 — 편집 포인트 수 컨트롤과 동일한 GUI (슬라이더 + −/값/+ ) */
.strength-control[data-strength="flt"] .point-count-slider { --point-color:#38bdf8; }
.strength-control[data-strength="scv"] .point-count-slider { --point-color:#34d399; }
.strength-control .point-count-value { min-width:52px; }
/* 미리보기 토글은 SUPER SMOOTH와 동일한 .sw 스위치 스타일을 사용 */
/* FLT 전환(완화 미적용) — 아웃라인 스타일로 솔리드 완화 버튼과 구분 */
.btn-fltjump { background: transparent; border: 1.5px solid var(--flt); color: var(--flt); }
.btn-fltjump:hover { background: rgba(236,72,153,.10); filter: none; }
.btn-fltjump.dimmed { opacity: .32; pointer-events: none; }
/* 포인트·마커 도구 — 마커 플래그 아이콘 버튼 */
.pnt-mrk-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.mtool {
width: 30px; height: 27px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(11,16,23,.62);
cursor: pointer; transition: all .15s; touch-action: manipulation;
}
.mtool svg { display: block; }
.mtool-pnt { color: var(--accent); }
.mtool-mrk { color: var(--flt); }
.mtool-del { color: var(--danger); }
.mtool:hover { border-color: currentColor; background: rgba(13,20,28,.9); box-shadow: 0 0 9px color-mix(in srgb, currentColor 45%, transparent); }
.mtool.on { background: color-mix(in srgb, currentColor 20%, #0d141c); border-color: currentColor; box-shadow: 0 0 11px color-mix(in srgb, currentColor 60%, transparent); }
/* 잠금 시각 강조 — 작은 네온 아이콘은 .dimmed 기본(42%)으로는 비활성이 잘 안 읽힌다 (FLT/FLT 전환에서 ±PNT 잠금) */
.mtool.dimmed { opacity: .22; filter: grayscale(.6); }
/* FPS 프리셋은 최상단 헤더(.time-zoom-btn.fps-pre)로 이동 */
/* 시간·프레임 리드아웃 — 프레임 숫자 강조 */
.slim-playbar .ptime {
display: inline-flex; align-items: baseline; gap: 6px; min-width: 176px; justify-content: flex-end;
background: rgba(10,14,19,.6); border: 1px solid rgba(36,49,64,.6); border-radius: 8px; padding: 3px 10px;
}
.ptime .pf { font-size: 16px; font-weight: 850; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.ptime .pft { font-style: normal; color: var(--text-dim); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.ptime .pt { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.ptime .pfps { font-style: normal; color: var(--text-dim); font-size: 10px; font-weight: 700; }
@media (max-width: 900px) {
html, body { height:auto; min-height:100%; }
body { overflow:auto; overflow-x:hidden; padding:8px; }
.frame { min-height:calc(100vh - 16px); overflow:hidden; }
header { flex-wrap:wrap; gap:8px 12px; padding:9px 12px; }
header .badge { margin-left:0; }
.hlegend { order:3; width:100%; flex-wrap:wrap; }
.graph-tabs { order:4; align-self:auto; height:38px; margin:0; }
main { flex-direction:column; overflow:visible; width:100%; }
.center-col { order:1; width:100%; flex:none; }
.graph-wrap { flex:none; width:100%; min-height:520px; height:62vh; }
aside { width:100%; border-left:0; border-top:1px solid var(--line); overflow:visible; order:3; }
.aside-scroll { overflow:visible; padding:10px; }
.menu-split { display:none; }
.hsplit { display:none; }
.aside-top, .aside-scroll { flex:none !important; overflow:visible; }
.aside-top { padding-bottom:8px; }
.ptrack { min-width:120px; }
.hint { max-width:calc(100% - 28px); }
.presets { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; }
.preset { aspect-ratio: auto; min-height: 38px; }
input[type=range] { width: clamp(150px, 58vw, 520px); flex: 1 1 150px; }
.jogset input[type=range] { width: 100px; flex: 0 0 100px; }
}
@media (max-width: 520px) {
body { padding:0; }
.frame { border-radius:0; border-left:0; border-right:0; }
header h1 { width:100%; font-size:14px; }
.graph-wrap { min-height:480px; height:58vh; }
.jogset { display:none; }
.ptime { min-width:68px; }
.row { gap: 8px; }
.row label { max-width: 34%; white-space: normal; }
.density-row { gap: 6px; }
.density-row label { flex: 0 0 58px; max-width: none; }
.stepbtn { width: 28px; height: 28px; }
input[type=range] { width: clamp(120px, 48vw, 240px); flex-basis: 120px; }
.presets { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.graph-tab { min-width: 82px; padding-inline: 10px; }
}
/* ============ RoboticsHead_RT — 3D Twin 통합 레이아웃 ============ */
.h1-rt { color: var(--accent); }
header h1 { white-space: nowrap; }
.hdr-controls { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.hdr-controls .time-zoom-controls,
.hdr-controls .y-range-controls { margin-left: 0; }
.time-zoom-controls > label, .y-range-controls > label { white-space: nowrap; }
.hlegend { min-width: 0; flex: 0 1 auto; overflow: hidden; flex-wrap: nowrap; }
/* 좌측 컬럼: 2D(상) · 분할선 · 3D(하) */
.center-col { gap: 0; }
.graph-wrap { flex: 0.58 1 0; }
.vsplit {
flex: none; height: 13px; cursor: row-resize; touch-action: none;
display: flex; align-items: center; justify-content: center;
background: linear-gradient(180deg,#0c121a,#0a0e13);
border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.vsplit:hover { background: #10202c; }
.vsplit-grip { width: 48px; height: 4px; border-radius: 3px; background: #34465a; transition: background .15s; }
.vsplit:hover .vsplit-grip { background: var(--accent); }
.twin-wrap {
position: relative; flex: 0.42 1 0; min-height: 0; overflow: hidden;
background: #0a0e13;
}
.twin-canvas {
position: absolute; inset: 0; overflow: hidden;
background: linear-gradient(to top, #0a0e13 0%, #0d1d33 54%, #17446f 100%);
}
.twin-canvas canvas.gl { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; }
.twin-stage { position: absolute; inset: 0; overflow: hidden; transition: opacity .25s; }
.twin-stage.hidden { opacity: 0; pointer-events: none; }
.twin-floor {
position: absolute; left: 50%; bottom: -42%; width: 170%; height: 130%;
transform: translateX(-50%) perspective(640px) rotateX(71deg);
background-image: linear-gradient(rgba(56,189,248,.10) 1px, transparent 1px),
linear-gradient(90deg, rgba(56,189,248,.10) 1px, transparent 1px);
background-size: 44px 44px;
-webkit-mask-image: radial-gradient(58% 60% at 50% 28%, #000 0%, transparent 76%);
mask-image: radial-gradient(58% 60% at 50% 28%, #000 0%, transparent 76%);
}
.twin-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; pointer-events: none; }
.twin-ph-title { font-size: 17px; font-weight: 800; letter-spacing: 1.2px; color: #3c5269; }
.twin-ph small { font-size: 11px; color: #314457; letter-spacing: .3px; }
.twin-toolbar {
position: absolute; z-index: 4; display: flex; align-items: center; gap: 5px;
background: rgba(10,15,21,.6); border: 1px solid var(--line); border-radius: 10px;
padding: 5px; backdrop-filter: blur(6px);
}
.twin-views { top: auto; bottom: 10px; left: 10px; }
.twin-follow { top: 10px; left: 10px; right: auto; gap: 4px; }
.twin-follow-label { font-size: 10px; font-weight: 800; color: var(--text-dim); letter-spacing: .4px; padding: 0 3px 0 4px; }
.twin-axis-gauges {
position: absolute; z-index: 4; top: 3px; right: 4px; width: 290px;
display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0;
background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none;
pointer-events: none; font-variant-numeric: tabular-nums;
}
.twin-axis-gauge { display: block; width: 100%; height: 86px; overflow: visible; }
.twin-axis-gauge.big .axis-gauge-title { font-size: 16.5px; }
.twin-axis-gauge.big .axis-gauge-value { font-size: 26px; }
.twin-axis-gauge.big .axis-gauge-meta { font-size: 12.5px; }
.twin-axis-gauge.big .axis-gauge-direction { font-size: 20px; }
.axis-gauge-bg { fill: none; stroke: rgba(141,166,191,.27); }
.axis-gauge-history { fill: none; opacity: .82; }
.axis-gauge-arc { fill: none; stroke-linecap: butt; } /* 직각 끝 — 게이지 바늘과 정렬 */
.axis-gauge-needle {
stroke: currentColor; stroke-width: 1.25; stroke-linecap: round;
filter: drop-shadow(0 0 2.4px currentColor);
}
.axis-gauge-title { fill: currentColor; font-size: 13.8px; font-weight: 800; letter-spacing: .22px; }
.axis-gauge-value { fill: currentColor; font-size: 20.4px; font-weight: 850; }
.axis-gauge-meta { fill: currentColor; opacity: .76; font-size: 10.9px; font-weight: 650; }
.axis-gauge-direction { fill: currentColor; font-size: 16.8px; font-weight: 900; text-anchor: end; }
.twin-btn, .twin-seg {
border: 1px solid var(--line); background: #0d141c; color: var(--text-dim);
border-radius: 7px; padding: 5px 12px; font-size: 11.5px; font-weight: 700;
cursor: pointer; transition: all .15s; touch-action: manipulation;
}
.twin-btn:hover, .twin-seg:hover { border-color: var(--accent); color: var(--text); }
.twin-btn.active, .twin-seg.active { background: rgba(56,189,248,.16); border-color: var(--accent); color: var(--accent); }
/* 슬림 진행바 — 감싸는 박스 없이 그룹별 클러스터만 배치 (X축 라벨은 플롯 하단 여백에 노출) */
.slim-playbar {
position: absolute; left: 14px; right: 14px; bottom: 6px; z-index: 3;
display: flex; align-items: center; gap: 9px;
background: transparent; border: 0; padding: 0 2px;
}
.slim-playbar .ptrack { flex: 1; min-width: 60px; height: 4px; }
.graph-wrap.speed-view .slim-playbar { display: none; }
/* 트랜스포트 클러스터 — 진행 바와 같은 청색 외곽광으로 하드웨어 명령 영역 구분 */
.transport {
display: flex; align-items: center; gap: 5px; flex: none;
border: 0; border-radius: 8px; padding: 4px 6px;
background: rgba(10,30,44,.88);
box-shadow: 0 0 0 1px rgba(56,189,248,.42), 0 0 13px rgba(56,189,248,.32);
}
.transport .pbtn { width: 30px; height: 26px; flex: none; font-size: 12px; }
.transport .sync-btn { width: auto; padding: 0 9px; font-size: 11px; font-weight: 800; letter-spacing: .4px; }
.transport .play-emph {
width: 34px; background: linear-gradient(180deg,#34d399,#10b981); border-color: #0ea372;
color: #04150e; font-size: 14px; font-weight: 800; box-shadow: 0 1px 6px rgba(16,185,129,.3);
}
.transport .play-emph:hover { filter: brightness(1.1); color: #04150e; border-color: #0ea372; }
.transport .play-emph.on { background: linear-gradient(180deg,#34d399,#10b981); color: #04150e; }
.transport .play-emph.disabled { background: #15241d; border-color: #1f3a2e; color: #3f6b56; box-shadow: none; filter: none; }
.transport.disabled-block { opacity: .4; pointer-events: none; }
.path-axis-filter {
display:flex; align-items:center; gap:3px; flex:none; height:28px;
padding:2px 4px; border:1px solid rgba(36,49,64,.6); border-radius:8px;
background:rgba(10,14,19,.6);
}
.path-axis-btn {
width:22px; height:22px; padding:0; border:1px solid var(--line); border-radius:5px;
background:#0d141c; color:#526171; font-size:10px; font-weight:900; line-height:1;
cursor:pointer; transition:all .14s;
}
.path-axis-btn[aria-pressed="true"] { background:color-mix(in srgb,currentColor 14%,#0d141c); border-color:currentColor; }
.path-axis-btn[data-path-axis="pan"] { color:var(--pan); }
.path-axis-btn[data-path-axis="tilt"] { color:var(--tilt); }
.path-axis-btn[data-path-axis="zoom"] { color:var(--zoom); }
.path-axis-btn[data-path-axis="focus"] { color:var(--focus); }
.path-axis-btn[aria-pressed="false"] { color:#526171; border-color:#243140; background:#0d141c; opacity:.58; }
/* 가림 토글 — 라운드 솔리드로 축 버튼과 차별화 */
.path-axis-btn.hide-toggle {
width:auto; padding:0 9px; border:0; border-radius:999px;
background:#2a3848; color:var(--text-dim); font-size:10px; opacity:1;
}
.path-axis-btn.hide-toggle[aria-pressed="true"] {
background:var(--accent); color:#041420; font-weight:900;
box-shadow:0 0 8px rgba(56,189,248,.45);
}
.strength-control[data-strength="density"] .point-count-slider { --point-color:#e2e8f0; }
.point-count-value.pending { color:#f5a524; border-color:#f5a524; } /* 밀도 미적용(재생성 대기) */
/* 헤더 우측 현재 상태 텍스트(구 배지 자리) */
.hdr-status { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden;
text-overflow: ellipsis; max-width: 230px; padding-left: 8px; }
/* 우측 패널 상단 고정(탭) */
.rt-head { flex: none; padding: 10px 10px 2px; background: var(--panel); border-bottom: 1px solid var(--line); }
.panel-tabs { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; margin-bottom: 10px; background: rgba(10,14,19,.4); }
.panel-tabs .graph-tab { flex: 1; min-width: 0; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 9px 0; text-align: center; }
.panel-tabs .graph-tab:last-child { border-right: 0; }
.panel-tabs .graph-tab.active::after { height: 2px; }
/* 패널 본문(편집 영역) — speed view에서만 잠금 */
.panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel-body.viewer-locked { opacity: .38; filter: grayscale(.32); pointer-events: none; }
/* 상단 메뉴 접기 토글 (세로 공간 확보) */
.frame-toggle, .panel-toggle {
position:absolute; top:8px; z-index:30; width:34px; height:28px; padding:0;
border:1px solid transparent; background:transparent; color:var(--text-dim); border-radius:7px;
cursor:pointer; line-height:1;
display:flex; align-items:center; justify-content:center;
transition:color .15s, background .15s, transform .18s, border-color .15s; touch-action:manipulation;
}
.frame-toggle svg, .panel-toggle svg { width:16px; height:16px; display:block; }
.frame-toggle { left:8px; }
.panel-toggle { right:10px; }
.frame-toggle:hover, .panel-toggle:hover { color:var(--accent); background:rgba(56,189,248,.09); }
.frame-toggle.on, .panel-toggle.on { color:var(--accent); transform:rotate(180deg); }
header { padding-left:50px; padding-right:50px; }
main { position: relative; }
.frame.panel-lowered .center-col { flex: 1 1 100%; }
.frame.panel-lowered .twin-wrap { width: calc(100% - var(--aside-w, 308px)); align-self: flex-start; }
.frame.panel-lowered #controlPanel {
position: absolute; z-index: 18; right: 0; top: var(--panel-lower-top, 50%); bottom: 0; height: auto;
box-shadow: -10px 0 28px rgba(0,0,0,.32); border-top: 1px solid var(--line);
}
header { padding-right: 92px; }
.frame.header-collapsed header { display: none; }
/* 가로 태블릿(iPad Pro 11 논리 높이 834px 등): 메뉴 수직 밀도 압축 (mv3.3) */
@media (max-height: 900px) {
header { padding-top: 6px; padding-bottom: 6px; }
.group { padding: 9px 10px; margin-bottom: 9px; }
.group h3 { margin: 0 0 8px; padding: 0 0 6px; font-size: 13px; }
.row { margin: 7px 0; }
.aside-top { padding: 9px 10px 2px; }
.aside-scroll { padding: 9px 10px; }
.rt-head { padding: 8px 10px 2px; }
.panel-tabs { margin-bottom: 8px; }
}
@media (max-width: 1180px) { .hlegend { display: none; } }
@media (max-width: 900px) {
.panel-toggle { display: none; }
.frame.panel-lowered #controlPanel { position: static; width: 100%; height: auto; box-shadow: none; }
.hdr-controls { order: 5; width: 100%; margin-left: 0; flex-wrap: wrap; gap: 6px; }
.hdr-status { display: none; }
.graph-wrap { flex: none !important; height: 48vh; min-height: 340px; }
.twin-wrap { flex: none !important; height: 40vh; min-height: 280px; }
.vsplit { display: none; }
}
</style>
</head>
<body>
<div class="frame">
<button class="frame-toggle" id="headerToggle" title="상단 메뉴 숨기기 / 보이기" aria-label="상단 메뉴 토글">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 6l4.5 4.5L12.5 6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<button class="panel-toggle" id="panelToggle" title="우측 메뉴를 트윈 영역으로 내리기 / 복원" aria-label="우측 메뉴 위치 토글" aria-pressed="false">
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 6l4.5 4.5L12.5 6" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>
</button>
<header>
<span class="hlegend">
<span><i style="background:var(--pan)"></i>Pan</span>
<span><i style="background:var(--tilt)"></i>Tilt</span>
<span><i style="background:var(--zoom)"></i>Zoom</span>
<span><i style="background:var(--focus)"></i>Focus</span>
<span><i style="background:var(--flt)"></i>FLT 곡선</span>
</span>
<div class="hdr-controls">
<span class="time-zoom-controls" aria-label="시간축 확대 축소">
<label>t스케일</label>
<button class="time-zoom-btn" id="timeZoomOut" aria-label="시간축 축소" title="플레이헤드 중심 시간축 축소">−</button>
<output class="time-zoom-readout" id="timeZoomValue">1×</output>
<button class="time-zoom-btn" id="timeZoomIn" aria-label="시간축 확대" title="플레이헤드 중심 시간축 확대">+</button>
</span>
<span class="y-range-controls" aria-label="축범위 조정">
<label>축범위</label>
<button class="time-zoom-btn" id="yRangeOut" aria-label="축범위 축소" title="축범위 15° 축소">−</button>
<output class="y-range-readout" id="yRangeValue">±180°</output>
<button class="time-zoom-btn" id="yRangeIn" aria-label="축범위 확대" title="축범위 15° 확대">+</button>
</span>
<span class="y-range-controls" aria-label="프레임 레이트 선택">
<label>FPS</label>
<button class="time-zoom-btn fps-pre" data-fps="24" title="24fps 키프레임">24</button>
<button class="time-zoom-btn fps-pre" data-fps="30" title="30fps 키프레임">30</button>
<button class="time-zoom-btn fps-pre" data-fps="60" title="60fps 키프레임">60</button>
</span>
</div>
<span class="hdr-status" id="hint" title="현재 단계 안내"></span>
</header>
<main>
<div class="center-col" id="centerCol">
<div class="graph-wrap" id="graphWrap">
<canvas id="cv"></canvas>
<div class="slim-playbar" id="slimPlaybar" aria-label="재생 컨트롤 · 진행">
<div class="transport" id="transport" aria-label="재생 컨트롤">
<button class="pbtn sync-btn" id="syncBtn" title="모터싱크: 모터를 플레이헤드 위치로 복귀">SYNC</button>
<button class="pbtn play-emph" id="playBtn" title="재생 (하드웨어 실행 · SYNC 후 활성)">▶</button>
<button class="pbtn" id="revBtn" title="역재생">◀</button>
<button class="pbtn" id="stopBtn" title="정지">■</button>
<button class="pbtn" id="cycleBtn" title="자동 왕복">⇄</button>
</div>
<div class="path-axis-filter" aria-label="표시할 축 경로 선택">
<button class="path-axis-btn" data-path-axis="pan" aria-pressed="true" title="Pan 경로 표시">P</button>
<button class="path-axis-btn" data-path-axis="tilt" aria-pressed="true" title="Tilt 경로 표시">T</button>
<button class="path-axis-btn" data-path-axis="zoom" aria-pressed="true" title="Zoom 경로 표시">Z</button>
<button class="path-axis-btn" data-path-axis="focus" aria-pressed="true" title="Focus 경로 표시">F</button>
<button class="path-axis-btn hide-toggle" id="hideBtn" aria-pressed="true" title="가림 ON: 비활성 축 숨김 / OFF: 비활성 축 딤드 표시(편집·물리이동 제외)">가림</button>
</div>
<div class="pnt-mrk-tools" aria-label="포인트·마커 도구">
<button class="mtool mtool-pnt" id="addPntBtn" title="플레이헤드 위치에 편집 포인트(CP) 추가 (표시 중인 축, RAW/편집)" aria-label="포인트 추가">
<svg viewBox="0 0 20 20" width="17" height="17" aria-hidden="true"><circle cx="8" cy="12" r="3" fill="currentColor"/><path d="M14.5 3.5v6M11.5 6.5h6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
<button class="mtool mtool-del" id="delPntBtn" title="플레이헤드에 가장 가까운 포인트 제거 — CP·일반 포인트 모두 가능 (표시 중인 축, RAW/편집)" aria-label="포인트 제거">
<svg viewBox="0 0 20 20" width="17" height="17" aria-hidden="true"><circle cx="8" cy="12" r="3" fill="currentColor"/><path d="M11.5 6.5h6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
<button class="mtool mtool-mrk" id="addMrkBtn" title="플레이헤드 위치에 Play Marker 생성 (RAW/편집, 최대 10개)" aria-label="마커 생성">
<svg viewBox="0 0 20 20" width="17" height="17" aria-hidden="true"><path d="M4.5 17.5v-14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4.5 4h7l-2 2.75 2 2.75h-7z" fill="currentColor"/><path d="M15.5 12.5v6M12.5 15.5h6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
<button class="mtool mtool-del" id="mrkDelBtn" title="마커 삭제 모드 — ON 상태에서 마커 플래그 클릭 시 삭제 (RAW/편집)" aria-label="마커 삭제 모드">
<svg viewBox="0 0 20 20" width="17" height="17" aria-hidden="true"><path d="M4.5 17.5v-14" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/><path d="M4.5 4h7l-2 2.75 2 2.75h-7z" fill="currentColor" opacity=".85"/><path d="M12.5 15.5h6" stroke="currentColor" stroke-width="1.8" stroke-linecap="round"/></svg>
</button>
</div>
<div class="ptrack" id="ptrack"><div class="pfill" id="pfill"></div></div>
<span class="ptime" id="ptime">0.0 / 0.0 s</span>
</div>
<div class="toast" id="toast"></div>
</div>
<div class="vsplit" id="vsplit" role="separator" aria-orientation="horizontal" title="2D / 3D 영역 비율 조절">
<span class="vsplit-grip"></span>
</div>
<div class="twin-wrap" id="twinWrap">
<div id="twinCanvas" class="twin-canvas">
<div class="twin-stage" aria-hidden="true">
<div class="twin-floor"></div>
<div class="twin-ph"><span class="twin-ph-title">3D Digital Twin</span><small>Phase 1 · 뷰어모드 — GLB 로드 예정</small></div>
</div>
</div>
<div class="twin-toolbar twin-views" role="group" aria-label="카메라 뷰">
<button class="twin-btn active" data-view3d="default" title="기본(원근) 뷰">기본</button>
<button class="twin-btn" data-view3d="front" title="정면 뷰">정면</button>
<button class="twin-btn" data-view3d="side" title="측면 뷰">측면</button>
<button class="twin-btn" data-view3d="top" title="상부 뷰">상부</button>
</div>
<div class="twin-toolbar twin-follow" role="group" aria-label="추종 소스">
<span class="twin-follow-label">추종</span>
<button class="twin-seg active" id="followHead" data-follow="playhead" title="저작 경로(플레이헤드/지령) 추종">저작경로</button>
<button class="twin-seg" id="followMotor" data-follow="motorhead" title="물리 위치(모터헤드/실제) 추종">물리위치</button>
</div>
<div class="twin-axis-gauges" id="twinAxisGauges" aria-label="디지털 트윈 4축 실시간 회전 게이지"></div>
</div>
</div>
<div class="hsplit" id="menuWidthSplit" role="separator" aria-orientation="vertical" title="우측 메뉴 가로폭 조절">
<span class="hsplit-grip"></span>
</div>
<aside id="controlPanel">
<div class="rt-head">
<div class="panel-tabs" role="tablist" aria-label="그래프 보기 전환">
<button class="graph-tab active" id="positionTab" role="tab" aria-selected="true" data-view="position">위치경로</button>
<button class="graph-tab" id="speedTab" role="tab" aria-selected="false" data-view="speed">속도경로</button>
</div>
</div>
<div class="panel-body" id="panelBody">
<div class="aside-top">
<div class="actions">
<span class="preview-inline"><label>미리보기</label>
<button class="sw" id="reviewBtn" title="완화 적용 예상 곡선을 대시선으로 프리뷰 (RAW/편집)"></button></span>
<button class="btn btn-fltjump" id="fltJumpBtn" title="완화를 다시 적용하지 않고 마지막 FLT 곡선으로 전환 — 읽기 전용 뷰, 편집 복귀 시 포인트 유지">FLT</button>
<button class="btn btn-main" id="mainBtn">완화</button>
<button class="btn btn-confirm" id="confirmBtn">승인</button>
</div>
<div class="group" id="densityGroup">
<h3>포인트 밀도</h3>
<div class="row density-row" title="전체 축 일괄: 각 축 op(최적 포인트 ≤48)의 중요도 상위 부분집합을 표시 — CP는 항상 유지">
<label>밀도조절</label>
<span class="point-count-control strength-control" data-strength="density"><input class="point-count-slider" id="densitySlider" type="range" min="1" max="100" step="1" value="100" aria-label="편집 포인트 밀도" /><button class="tbtn stepbtn" data-step="-1" aria-label="밀도 1% 감소">−</button><output class="point-count-value" id="densityVal">100%</output><button class="tbtn stepbtn" data-step="1" aria-label="밀도 1% 증가">+</button></span></div>
<div class="mini" style="margin-top:2px">
<button class="tbtn" id="regenBtn" title="목표 밀도를 현재 경로에 적용 — 드래그 편집·CP·완화 옵션 모두 유지 (RAW/편집)">재생성 (밀도 적용)</button>
<button class="tbtn" id="resetBtn" title="RAW 리맵핑 — CP·완화 옵션 포함 완전 초기화 후 목표 밀도로 재생성 (RAW/편집)">초기화</button>
</div>
</div>
<div class="group" id="histGroup">
<h3>편집 이력</h3>
<div class="mini">
<button class="tbtn" id="undoBtn">↶ Undo</button>
<button class="tbtn" id="redoBtn">Redo ↷</button>
</div>
</div>
</div>
<div class="menu-split" id="menuSplit" role="separator" aria-orientation="horizontal" title="고정 메뉴 / 스크롤 메뉴 비율 조절">
<span class="vsplit-grip"></span>
</div>
<div class="aside-scroll">
<div class="group" id="smoothOptGroup">
<h3>완화 옵션</h3>
<div class="row"><label>SUPER SMOOTH</label>
<button class="sw" id="superSmooth" title="완전 저크리밋 렌더링 — 현재 Kalman·S-Curve 혼합값을 반영한 채 속도곡선을 엣지 없이 완만하게. 편집 재진입으로 베이크되면 자동 해제"></button></div>
<div class="row"><label>AI 모드</label>
<button class="sw" id="aiBtn" title="현재 ON/OFF 동작만 (ML 학습값 미적용)"></button></div>
<div class="row density-row" title="의도 보존 ↔ 부드러움: 낮을수록 손동작 의도 보존, 높을수록 떨림 제거">
<label>Kalman 강도</label>
<span class="point-count-control strength-control" data-strength="flt"><input class="point-count-slider" id="fltStrength" type="range" min="0" max="100" step="1" value="0" aria-label="Kalman 강도" /><button class="tbtn stepbtn" data-step="-1" aria-label="Kalman 1% 감소">−</button><output class="point-count-value" id="fltStrengthVal">0%</output><button class="tbtn stepbtn" data-step="1" aria-label="Kalman 1% 증가">+</button></span></div>
<div class="row density-row" title="의도 보존 ↔ 부드러움: 낮을수록 편집 형태 유지, 높을수록 이상적 가감속 프로필 추종">
<label>S-Curve 추종</label>
<span class="point-count-control strength-control" data-strength="scv"><input class="point-count-slider" id="sCurveStrength" type="range" min="0" max="100" step="1" value="35" aria-label="S-Curve 추종" /><button class="tbtn stepbtn" data-step="-1" aria-label="S-Curve 1% 감소">−</button><output class="point-count-value" id="sCurveStrengthVal">35%</output><button class="tbtn stepbtn" data-step="1" aria-label="S-Curve 1% 증가">+</button></span></div>
</div>
<div class="group" id="scaleGroup">
<h3>경로 확장</h3>
<div class="subh">적용 축: 플레이바 PTZF 선택을 따름</div>
<div class="subh">비례확장</div>
<div id="propScaleWrap">
<div class="row"><label>X 배율(속도)</label>
<input type="range" id="scaleX" min="0.5" max="1.5" step="0.02" value="1" />
<span class="val" id="scaleXVal">1.00x</span></div>
<div class="row"><label>Y 배율(거리)</label>
<input type="range" id="scaleY" min="0.5" max="1.5" step="0.02" value="1" />
<span class="val" id="scaleYVal">1.00x</span></div>
</div>
<div class="subh">동기화</div>
<div class="row"><label>시작/끝점 일치</label><button class="sw" id="matchBtn"></button></div>
<div class="row"><label>시작/끝 점 고정</label><button class="sw" id="pinBtn"></button></div>
</div>
<div class="group" id="offsetGroup">
<h3>경로 이동</h3>
<div class="subh">적용 축: 플레이바 PTZF 선택을 따름</div>
<div class="row move-row"><label>X 위치</label>
<input type="range" id="moveX" min="-15000" max="15000" step="100" value="0" />
<span class="val" id="moveXVal">0.0s</span></div>
<div class="row move-row"><label>Y 위치</label>
<input type="range" id="moveY" min="-360" max="360" step="1" value="0" />
<span class="val" id="moveYVal">0°</span></div>
</div>
<div class="group" id="easeGroup">
<h3>시작/끝 영역 완화</h3>
<div class="subh">적용 축: 플레이바 PTZF 선택을 따름</div>
<div class="row"><label>시작 영역</label>
<input type="range" id="startPct" min="5" max="30" value="15" />
<span class="val" id="startPctVal">15%</span></div>
<div class="row"><label>끝 영역</label>
<input type="range" id="endPct" min="70" max="95" value="85" />
<span class="val" id="endPctVal">85%</span></div>
<div class="row"><label>선택 영역 완화</label><button class="sw" id="easeBtn"></button></div>
<div class="row"><button class="tbtn" id="easeRunBtn" style="flex:1">구간 완만화 실행</button></div>
</div>
<div class="group" id="csvGroup">
<h3>데이터 입출력 (CSV)</h3>
<div class="mini">
<button class="tbtn" id="csvExportBtn">CSV 내보내기</button>
<button class="tbtn" id="csvImportBtn">CSV 가져오기</button>
</div>
<div class="row" style="margin-top:8px"><button class="tbtn" id="csvPresetExportBtn" style="flex:1">프리셋 일괄 내보내기 (개별 파일)</button></div>
<input type="file" id="csvFile" accept=".csv,text/csv" style="display:none" />
</div>
<div class="group">
<h3>FPS 스케일</h3>
<div class="row"><label>스케일 표시</label><button class="sw on" id="gridBtn" title="OFF 시 세부 눈금만 숨김 — Y축 0°·주선 단위, X축 5초 단위는 유지"></button></div>
<div class="row"><label>FPS스케일</label>
<input type="range" id="csvFps" min="1" max="120" step="1" value="30" />
<span class="val" id="csvFpsVal">30fps</span></div>
<div class="row"><label>모터 스케일</label>
<input type="range" id="gridScaleY" min="0.1" max="2" step="0.1" value="1" />
<span class="val" id="gridScaleYVal">1.0x</span></div>
<div class="row"><label>스냅</label><input type="checkbox" id="snap" /></div>
</div>
<div class="group">
<div class="row" style="margin-top:0">
<h3 style="margin:0">프리셋 (CST MP)</h3>
<span style="display:flex;align-items:center;gap:7px">
<span style="font-size:12px;color:var(--text)">삭제</span>
<button class="sw" id="delBtn"></button>
</span>
</div>
<div class="presets" id="presets"></div>
</div>
<div class="group" id="sessionGroup">
<div class="row" style="margin-top:0">
<h3 style="margin:0">세션 (경로+메뉴 상태)</h3>
<span style="display:flex;align-items:center;gap:7px">
<span style="font-size:12px;color:var(--text)">저장</span>
<button class="sw" id="sessSaveMode" title="ON: 슬롯 클릭 시 현재 세션 저장(덮어쓰기) / OFF: 슬롯 클릭 시 호출"></button>
</span>
</div>
<div class="presets" id="sessSlots"></div>
<div class="mini" style="margin-top:8px">
<button class="tbtn" id="sessExportBtn" title="현재 세션(경로·마커·완화·메뉴·레이아웃)을 JSON 파일로 저장">파일 내보내기</button>
<button class="tbtn" id="sessImportBtn" title="세션 JSON 파일을 불러와 화면 전체를 복원">파일 가져오기</button>
</div>
<input type="file" id="sessFile" accept=".json,application/json" style="display:none" />
</div>
</div>
</div>
</aside>
</main>
</div>
<script>
"use strict";
// ---------- 상수 / 좌표계 ----------
const T_MAX = 30000; // ms
const DEG_MAX = 1080; // 전역 저장/편집 상한(축범위 슬라이더 최대치와 정합)
// 축별 편집 범위(°) 개별 제한 — Pan ±360 / Tilt ±60 / Zoom·Focus ±1080
const AXIS_DEG_MAX = { pan: 360, tilt: 60, zoom: 1080, focus: 1080 };
const axisDegMax = name => AXIS_DEG_MAX[name] ?? DEG_MAX;
const EDIT_POINT_MIN = 4;
const OPM = 48; // 축별 최적 포인트(op) 최대 개수 — RAW 복잡도가 낮으면 op는 이보다 적게 생성 (v3.0 확정)
const EDIT_TIME_GAP_MS = 20; // 드래그 중 인접 포인트의 시간 순서가 뒤집히지 않도록 보장
const RAW_SIM_POINT_COUNT = 120; // 개발용 RAWPT가 생성하는 엔코더 모사 샘플 수(실 엔코더 밀도에 근접)
const RDP_EPS_RATIO = 0.0075; // adaptive 추출 허용오차: 축 이동량의 0.75% (D1 확정)
const RDP_EPS_MIN_DEG = 0.3;
const CP_GUARD_MS = 400; // CP 보호 반경: 재주입 시 자동 포인트 정리·-PNT 제거 반경
const MARKER_MAX = 10; // Play Marker M1~M10
const MARKER_COLORS = ["#38bdf8","#f5a524","#a78bfa","#fb7185","#34d399","#facc15","#f472b6","#60a5fa","#fb923c","#4ade80"];
// 완화 강도 슬라이더(0~100%) → 유효 강도 비선형 매핑(γ). 0~30% 구간은 미세, 고강도에서 적극 작동 (§4.5)
const STRENGTH_GAMMA = 2.2;
function effStrength(x){
const u=Math.max(0,Math.min(100,+x||0))/100;
return 100*Math.pow(u,STRENGTH_GAMMA);
}
const TIME_ZOOM_LEVELS = [1, 1.5, 2, 3, 4, 6, 8];
const AXIS_NAMES = ["pan", "tilt", "zoom", "focus"];
const AXIS_LABEL = { pan:"P-PT", tilt:"T-PT", zoom:"Z-PT", focus:"F-PT" };
const COL = { pan: "#38bdf8", tilt: "#f5a524", zoom:"#a78bfa", focus:"#4ade80", flt: "#ec4899" };
// 플레이헤드 = 모터헤드와 동일한 적색·동일 형태. 구분은 실선/솔리드 핸들(플레이헤드) vs 대시/아웃라인 핸들(모터)만.
const PLAYHEAD_COL = "#ef4444";
const cv = document.getElementById("cv");
const ctx = cv.getContext("2d");
let plot = { x: 0, y: 0, w: 0, h: 0 };
let dpr = Math.max(1, window.devicePixelRatio || 1);
// 터치 디스플레이에서 실수로 페이지 텍스트/HTML이 드래그 선택되는 현상 방지
document.addEventListener("selectstart", e=>{
if(e.target && e.target.closest && e.target.closest(".frame")) e.preventDefault();
});
document.addEventListener("dragstart", e=>{
if(e.target && e.target.closest && e.target.closest(".frame")) e.preventDefault();
});
// ---------- 상태 ----------
const state = {
stage: "raw", // raw | flt | edit
viewMode: "position", // position(편집) | speed(읽기 전용)
timeZoomIndex: 0,
timeViewStart: 0,
timeViewEnd: T_MAX,
rangeDeg: 180, // Y축 표시 반경(± rangeDeg°). 축범위 슬라이더: ±45 ~ ±1080
fltStrength: 0, // Kalman 강도(0~100) — 비파괴 완화 옵션: 편집 곡선 투영 필터(γ 유효강도, §7.2)
sCurveStrength: 35, // S-Curve 추종(0~100). γ 매핑 후 유효 약 10% — 기본은 의도 보존 우선 (D5)
gridScaleY: 1, // 모터 스케일(Y 격자 밀도)
gridOn: true, // OFF 시 세부 눈금만 숨김 (Y 0°·45° 주선, X 5초 주선은 유지)
review: false, // 미리보기: 완화 예상 곡선 대시선 프리뷰 (RAW/편집 전용)
snap: false,
scaleXPrev: 1,
scaleYPrev: 1,
density: 100, // "적용된" 편집 포인트 밀도(%) — 재생성 시에만 변경 (v3.2 C안)
pendingDensity: 100, // 슬라이더 목표값 — 고스트 프리뷰만 갱신, 포인트는 불변
hideInactive: true, // 가림 ON: 비활성 축 숨김 / OFF: 비활성 축 딤드 표시(편집 불가)
match: false,
startPct: 15,
endPct: 85,
ease: false,
ai: false,
superSmooth: false,
presets: new Array(10).fill(null),
dirty: true, // 마지막 저장 이후 경로 변경 여부
loadedPreset: -1, // 현재 호출된 프리셋 인덱스
deleteMode: false,
movePrev: { X:0, Y:0 },
// v3.0 축 선택 일원화: visibleAxes가 유일한 "활성 축" 집합 — 표시·편집·스케일·이동·완화영역·물리 모터 이동 공통 적용
visibleAxes: { pan:true, tilt:true, zoom:true, focus:true },
pinEnds: false, // 시작/끝(IN·OUT) 포인트 고정
pin: null, // 축별 {axis:[in,out]} 고정값
rawMeta: { source:"simulator", sequence:0, capturedAt:0 },
fltDirect: false, // FLT 전환(완화 미적용) 읽기 전용 뷰 — 편집 복귀 시 재추출 대신 포인트 유지
markers: [], // Play Marker [{id:1~10, t}] — pose는 항상 현재 Final Curve에서 유도
markerDelete: false, // 마커 삭제 모드(편집 모드 전용)
pathEdited: false, // 사용자가 경로를 수정했는지 — true면 Kalman dial 잠금 (D2 확정)
};
// frameSamples layer — Final Curve를 선택 FPS로 샘플링한 Preview/Export/MCU 출력 전용 레이어.
// 편집(스케일·오프셋·스무딩)은 keypoint/Final Curve 단계에만 적용되고, 이 레이어는 소비 시점에 지연 재생성된다.
const frames = { fps: 30, dirty: true, rows: [], t0: 0, t1: 0 };
const visibleAxisNames = () => AXIS_NAMES.filter(name=>state.visibleAxes[name]);
// ---------- IN/OUT 포인트 고정 ----------
function capturePins(){
state.pin = {};
AXIS_NAMES.forEach(n=>{
state.pin[n] = null;
const p = (state.stage==="flt" && axes[n].filtered.length) ? axes[n].filtered : axes[n].points;
if(p.length>=2) state.pin[n] = [{t:p[0].t,deg:p[0].deg}, {t:p[p.length-1].t,deg:p[p.length-1].deg}];
});
}
function applyPins(arr, name){
if(!state.pinEnds || !state.pin || !state.pin[name] || arr.length<2) return;
const [i,o]=state.pin[name];
arr[0].t=i.t; arr[0].deg=i.deg;
arr[arr.length-1].t=o.t; arr[arr.length-1].deg=o.deg;
}
function enforcePinsPoints(){ AXIS_NAMES.forEach(n=>applyPins(axes[n].points,n)); }
function markDirty(){
state.dirty = true;
frames.dirty = true;
invalidateProfiles(); // [R16] 경로 변이 → 실행 프로필 캐시 무효화
if(state.loadedPreset!==-1){ state.loadedPreset=-1; renderPresets(); }
}
// 재생(플레이) 상태. synced: 플레이바가 모터 위치와 동기화됨(모터싱크 후 재생 가능)
// dir: 1(정방향)/-1(역방향). atEnd: 끝에서 정지(역플레이 대기), atStart: 시작에서 정지
const play = { on: false, synced: false, t: 0, dir: 1, cycle: false, raf: null, last: 0 };
// 모터 실제 위치 — pose 기반 모델. onPath=true면 pose는 곡선 위 시간 t에서 유도(경로 재생/정지 상태),
// false면 경로 밖 임시 FLT 이동 중(SYNC·마커 실행)이며 pose 값이 실제 위치를 나타낸다.
const motor = { t: 0, onPath: true, pose: { pan:0, tilt:0, zoom:0, focus:0 } };
// Undo/Redo 이력 (포인트 편집, 최대 20단계)
let undoStack = [], redoStack = [];
const HISTORY_MAX = 20;
// 각 축 (v3.0 op 모델):
// raw — 고밀도 엔코더 캡처 원본 (불변 보존)
// op — RAW에서 추출한 최적 포인트 전체(≤OPM) + 중요도 rank + CP. 편집의 단일 소스.
// points — op의 "밀도 뷰": rank 상위 부분집합 ∪ CP (중첩 부분집합 — 밀도를 낮췄다 올려도 포인트가 튀지 않음)
// filtered — 완화(비파괴) 결과 제어점
// rawOp — RAW에서 추출한 원본 op의 불변 캐시 (밀도 프리뷰·재생성 전용, v3.2)
const axes = {
pan: { raw: [], op: [], rawOp: [], points: [], filtered: [] },
tilt: { raw: [], op: [], rawOp: [], points: [], filtered: [] },
zoom: { raw: [], op: [], rawOp: [], points: [], filtered: [] },
focus:{ raw: [], op: [], rawOp: [], points: [], filtered: [] },
};
function constantPath(deg=0){ return [{t:0,deg},{t:T_MAX,deg}]; }
function persistPresets(){
try{ localStorage.setItem("cinehead-v11-presets",JSON.stringify({version:12,presets:state.presets})); }catch(_){ }
}
// v12: {paths, markers, opts:{완화 옵션}} — [R11 수정] 렌더를 좌우하는 완화 옵션까지 저장해 왕복 무결성 확보.
// v11 이하(opts 없음)·v10 이하(축별 경로 객체)는 마이그레이션 래핑.
function normalizeStoredPreset(p){
if(!p) return null;
if(p.paths) return { paths:p.paths, markers:Array.isArray(p.markers)?p.markers.slice(0,MARKER_MAX):[], opts:p.opts||null };
return { paths:p, markers:[], opts:null };
}
function restorePersistedPresets(){
try{
const LEGACY_KEYS=["cinehead-v10-presets","cinehead-v9-presets","cinehead-v8-presets","cinehead-v7-presets","cinehead-v6-presets","cinehead-v5-presets","cinehead-v4-presets","cinehead-v3-presets","cinehead-v2-presets"];
let raw=localStorage.getItem("cinehead-v11-presets");
let migrated=false;
for(const k of LEGACY_KEYS){ if(!raw){ raw=localStorage.getItem(k); if(raw) migrated=true; } }
const saved=JSON.parse(raw||"null");
if(saved?.version>=2&&saved?.version<=12&&Array.isArray(saved.presets)){
state.presets=saved.presets.map(normalizeStoredPreset).slice(0,10).concat(new Array(10).fill(null)).slice(0,10);
// [클린업] 구 버전 키 정리 + 현행 스키마(v12)로 즉시 재저장 — fallback 체인 1회성화
if(migrated||saved.version<12) persistPresets();
LEGACY_KEYS.forEach(k=>{ try{ localStorage.removeItem(k); }catch(_){ } });
}
}catch(_){ }