Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1365 lines (1199 loc) · 56.1 KB
/
Copy pathindex.html
File metadata and controls
1365 lines (1199 loc) · 56.1 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="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ubuntu 24.04 Terminal Mockup</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&family=Ubuntu+Mono:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--ubuntu-bg: #300A24;
--header-bg: #2d2d2d;
--close-btn: #E95420;
--user-color: #33d17a;
--path-color: #3584e4;
--page-bg: radial-gradient(circle at center, #2c001e 0%, #0f000a 100%);
--text-color: #ffffff;
--header-text: #cccccc;
--dot-color: #4f4f4f;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background: var(--page-bg);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start; /* Stacks toolbar -> terminal -> grid */
padding: 50px 0;
font-family: 'Ubuntu Mono', monospace;
overflow-y: auto; /* Allow scrolling for additional sections */
gap: 20px;
}
.terminal-window {
width: 850px;
height: 550px;
background-color: var(--ubuntu-bg);
border-radius: 10px;
box-shadow:
0 30px 60px rgba(0, 0, 0, 0.7),
inset 0 0 15px rgba(0, 0, 0, 0.3); /* Final Touch: Inner Shadow */
display: flex;
flex-direction: column;
border: 1px solid rgba(255, 255, 255, 0.08);
overflow: hidden;
animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.header {
background-color: var(--header-bg);
height: 38px;
display: flex;
align-items: center;
justify-content: flex-start;
padding: 0 12px; /* Header Padding: 12px from left */
user-select: none;
border-bottom: 1px solid rgba(0, 0, 0, 0.3);
gap: 12px; /* Tight Gap: 12px between controls and title */
}
.controls {
display: flex;
gap: 10px;
align-items: center;
}
.control-dot {
width: 16px; /* Button Scale: 16px */
height: 16px;
border-radius: 50%;
background-color: var(--dot-color);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
user-select: none;
position: relative;
}
/* SVG-style CSS Icons - Always Visible */
.icon {
opacity: 0.8;
display: flex;
align-items: center;
justify-content: center;
}
.icon-close {
position: relative;
width: 7px;
height: 7px;
}
.icon-close::before, .icon-close::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 9px;
height: 1px;
background-color: white;
}
.icon-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.icon-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.icon-min {
width: 7px;
height: 1px;
background-color: white;
}
.icon-max {
width: 6px;
height: 6px;
border: 1px solid white;
border-radius: 1px;
}
.control-dot.close {
background-color: var(--close-btn);
}
.window-title {
color: #d1d1d1;
font-size: 16px; /* GNOME title is usually slightly smaller */
font-weight: 400;
padding: 0; /* Remove padding to ensure perfect vertical center */
margin: 0;
border-radius: 4px;
transition: background 0.2s;
cursor: text;
opacity: 0.7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
height: 100%; /* Vertical Alignment: Center within parent flex */
}
/* Default styling for terminal output */
.terminal-body {
flex-grow: 1;
padding: 12px;
color: #ffffff; /* Explicitly white */
font-weight: normal; /* Explicitly normal weight */
font-size: 16px;
line-height: 1.4;
overflow-y: auto;
outline: none;
white-space: pre-wrap;
word-wrap: break-word;
scrollbar-width: thin;
scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
caret-color: #ffffff;
caret-shape: block; /* Ubuntu solid block cursor */
}
.terminal-body::-webkit-scrollbar {
width: 8px;
}
.terminal-body::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.2);
border-radius: 4px;
}
/* Glassmorphism External Toolbar styling */
.external-toolbar {
position: relative; /* Remove absolute/sticky overlap */
background-color: rgba(18, 18, 18, 0.8); /* Slightly darker */
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
padding: 12px 28px;
display: flex;
gap: 15px;
border-radius: 12px;
align-items: center;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
margin-bottom: 10px; /* Space above terminal */
z-index: 1000;
}
.toolbar-btn {
background: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.1);
color: rgba(255, 255, 255, 0.7);
font-family: 'Ubuntu Mono', monospace;
font-size: 13px;
padding: 6px 14px;
border-radius: 6px;
cursor: pointer;
user-select: none;
}
.toolbar-btn:active {
transform: scale(0.96);
}
.toolbar-label {
color: rgba(255, 255, 255, 0.2);
font-size: 10px;
margin-right: 8px;
text-transform: uppercase;
letter-spacing: 1.5px;
font-weight: bold;
}
.toolbar-input {
background: rgba(0, 0, 0, 0.4); /* Darker background */
border: 1px solid rgba(255, 255, 255, 0.15);
color: #fff;
font-family: 'Ubuntu Mono', monospace;
font-size: 13px;
padding: 6px 12px;
border-radius: 6px;
width: 250px; /* Consolidated width */
outline: none;
transition: all 0.2s;
}
.toolbar-input:focus {
border-color: rgba(255, 255, 255, 0.3);
background: rgba(255, 255, 255, 0.08);
}
.toolbar-btn.active-btn {
background: rgba(233, 84, 32, 0.15) !important;
border-color: #E95420 !important;
color: #ffffff !important;
box-shadow: 0 0 8px rgba(233, 84, 32, 0.4);
}
/* ==========================================================================
Ubuntu Permissions Window Styling (Boxed Yaru Card Theme)
========================================================================== */
.permissions-window {
width: 440px; /* Exact native width constraint of an Ubuntu file properties dialog */
max-width: 440px;
background-color: #fafafa;
border-radius: 16px; /* Smooth rounded corners */
box-shadow:
0 30px 60px rgba(0, 0, 0, 0.35),
0 1px 3px rgba(0, 0, 0, 0.05);
display: flex;
flex-direction: column;
border: 1px solid rgba(0, 0, 0, 0.08);
overflow: visible; /* Prevents clipping of external absolute buttons and dropdown menus */
margin-top: 48px; /* 48px vertical margin separation */
margin-bottom: 48px;
font-family: 'Ubuntu', sans-serif;
animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
transition: opacity 0.3s ease, transform 0.3s ease, height 0.3s ease, margin 0.3s ease;
position: relative; /* Enables absolute coordinates for outside edit buttons */
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(30px); }
to { opacity: 1; transform: translateY(0); }
}
.permissions-window.hidden {
opacity: 0;
transform: translateY(20px) scale(0.98);
pointer-events: none;
height: 0;
margin-top: 0 !important;
margin-bottom: 0 !important;
border-color: transparent;
box-shadow: none;
overflow: hidden;
}
.permissions-header {
background-color: #ffffff;
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
border-bottom: 1px solid rgba(0, 0, 0, 0.06);
user-select: none;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
}
.permissions-header .header-action-btn {
width: 36px;
height: 36px;
border-radius: 50%;
border: none;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
color: #3d3d3d;
cursor: pointer;
transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}
.permissions-header .header-action-btn:hover {
background-color: #f1f1f1;
color: #111111;
}
.permissions-header .header-action-btn:active {
transform: scale(0.92);
}
.permissions-header .header-title {
font-size: 16px;
font-weight: 500;
color: #111111;
text-align: center;
}
.permissions-body {
padding: 16px 20px 20px 20px; /* Reduced paddings to balance with the narrower width */
background-color: #f6f6f6; /* Native light gray settings background */
display: flex;
flex-direction: column;
gap: 12px; /* Balanced gap between cards */
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
}
/* Distinct white card containers with smooth highly rounded corners */
.yaru-card {
background-color: #ffffff;
border-radius: 14px; /* Highly rounded 12px-16px corners */
border: 1px solid rgba(0, 0, 0, 0.06);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
overflow: visible; /* Needed for absolute dropdown choices overlay */
transition: box-shadow 0.3s ease;
width: 100%; /* Stretches card to full width */
}
.yaru-card:focus-within {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.yaru-card-header {
padding: 10px 14px 2px 14px; /* Refined padding for compact layout */
font-size: 10.5px;
font-weight: 700;
text-transform: uppercase;
color: #727272;
letter-spacing: 0.8px;
user-select: none;
}
.yaru-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 14px; /* Tightened padding with description text removed */
min-height: 40px; /* Reduced min-height for clean compact Yaru look */
position: relative;
}
/* Faint divider lines between rows within each card */
.yaru-row:not(:last-child) {
border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.row-content {
display: flex;
flex-direction: column;
gap: 1px;
max-width: calc(100% - 170px); /* Keep text from overlapping trigger */
}
.row-label {
font-size: 14px;
font-weight: 500;
color: #2d2d2d;
font-family: 'Ubuntu', sans-serif;
}
.row-desc {
font-size: 11.5px;
color: #727272;
line-height: 1.3;
}
/* Yaru Select / Dropdown Trigger Boxed Widget - Borderless & Floating */
.yaru-select-wrapper {
position: relative;
width: 160px; /* Slimmer select wrapper */
user-select: none;
}
.yaru-select-trigger {
background: transparent;
border: none;
box-shadow: none;
padding: 6px 8px;
font-size: 14px;
color: #2d2d2d;
cursor: default;
display: flex;
align-items: center;
justify-content: flex-end; /* Cleanly RIGHT-ALIGNED value */
text-align: right;
gap: 6px;
transition: all 0.2s ease;
border-radius: 8px;
pointer-events: none; /* Disabled in View Mode */
width: 100%;
}
.edit-mode .yaru-select-trigger {
cursor: pointer;
pointer-events: auto; /* Enabled in Edit Mode */
}
.edit-mode .yaru-select-trigger:hover {
background-color: rgba(0, 0, 0, 0.04);
color: #111111;
}
.edit-mode .yaru-select-trigger:focus-within,
.edit-mode .yaru-select-trigger.active {
background-color: rgba(233, 84, 32, 0.06);
color: #E95420; /* Ubuntu Orange accent color */
outline: none;
}
.yaru-select-trigger .selected-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.yaru-select-trigger .chevron-icon {
color: #888888;
opacity: 0.4; /* Styled as disabled text by default (View Mode) */
transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.edit-mode .yaru-select-trigger .chevron-icon {
opacity: 0.8; /* Enabled look in Edit Mode */
color: #555555;
}
.edit-mode .yaru-select-trigger:hover .chevron-icon {
opacity: 1;
color: #2d2d2d;
}
.edit-mode .yaru-select-trigger.active .chevron-icon {
transform: rotate(180deg);
color: #E95420;
opacity: 1;
}
/* CRITICAL: Hide dropdown chevrons next to Owner and Group names in View Mode */
#select-owner-trigger .chevron-icon,
#select-group-trigger .chevron-icon {
display: none !important;
}
/* Show Owner and Group chevrons only in Edit Mode */
.edit-mode #select-owner-trigger .chevron-icon,
.edit-mode #select-group-trigger .chevron-icon {
display: block !important;
}
.yaru-select-options {
position: absolute;
top: calc(100% + 4px);
left: 0;
right: 0;
background: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.08);
border-radius: 8px;
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
z-index: 100;
opacity: 0;
visibility: hidden;
transform: translateY(-8px);
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
overflow: hidden;
padding: 4px 0;
}
.yaru-select-options.show {
opacity: 1;
visibility: visible;
transform: translateY(0);
}
.yaru-option {
padding: 8px 12px;
font-size: 13.5px;
color: #2d2d2d;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
text-align: right; /* Right-align dropdown options to match value */
}
.yaru-option:hover {
background-color: rgba(233, 84, 32, 0.08);
color: #E95420;
}
.yaru-option.selected {
background-color: #E95420;
color: #ffffff;
font-weight: 500;
}
/* Elegant Global Edit Button placed absolutely OUTSIDE above the top-right corner of the window */
.global-edit-btn {
position: absolute;
right: 0;
top: -46px; /* Floating neatly above the top-right corner of the window */
height: 34px;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 0 16px;
border-radius: 6px; /* Rounded corners matching header bar action item */
border: 1px solid rgba(0, 0, 0, 0.25);
background-color: #3d3d3d; /* Subtle dark gray */
color: #ffffff;
font-size: 13px;
font-weight: 500;
font-family: 'Ubuntu', sans-serif;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.1s ease;
}
.global-edit-btn:hover {
background-color: #4a4a4a;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
transform: translateY(-1px);
}
.global-edit-btn:active {
transform: translateY(0) scale(0.97);
background-color: #2b2b2b;
}
/* Editing active state (GNOME green for active save actions) */
.global-edit-btn.editing-active {
background-color: #2ec27e;
color: #ffffff;
border-color: #26a269;
box-shadow: 0 3px 10px rgba(46, 194, 126, 0.35);
}
.global-edit-btn.editing-active:hover {
background-color: #26a269;
box-shadow: 0 5px 15px rgba(38, 162, 105, 0.45);
transform: translateY(-1px);
}
.global-edit-btn.editing-active:active {
transform: translateY(0) scale(0.97);
background-color: #208b59;
}
.global-edit-btn .icon-save {
display: none !important;
}
.global-edit-btn.editing-active .icon-pencil {
display: none !important;
}
.global-edit-btn.editing-active .icon-save {
display: block !important;
}
/* Inline Pencil edit buttons hidden by default, visible in edit-mode */
.inline-edit-btn {
display: none;
width: 26px;
height: 26px;
border-radius: 50%;
border: none;
background: transparent;
align-items: center;
justify-content: center;
cursor: pointer;
color: #727272;
transition: all 0.2s ease, transform 0.1s ease;
margin-left: 6px;
}
.edit-mode .inline-edit-btn {
display: flex;
}
.inline-edit-btn:hover {
background-color: rgba(0, 0, 0, 0.06);
color: #111111;
}
.inline-edit-btn:active {
transform: scale(0.9);
}
/* Dynamic name editor inline input */
.yaru-editable-container {
display: flex;
align-items: center;
justify-content: flex-end; /* Right-align editable container */
gap: 4px;
width: 100%;
}
.inline-edit-input {
background: #ffffff;
border: 1px solid #E95420;
box-shadow: 0 0 0 3px rgba(233, 84, 32, 0.15);
color: #2d2d2d;
font-family: 'Ubuntu', sans-serif;
font-size: 13.5px;
padding: 6px 10px;
border-radius: 8px;
outline: none;
width: 110px; /* Scaled down inline-input to fit within the slimmer row */
transition: all 0.2s ease;
}
.icon-btn {
width: 30px;
height: 30px;
border-radius: 50%;
border: none;
background: transparent;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
color: #727272;
transition: all 0.2s ease, transform 0.1s ease;
}
.icon-btn:hover {
background-color: rgba(0, 0, 0, 0.06);
color: #111111;
}
.icon-btn:active {
transform: scale(0.9);
}
.icon-btn.primary {
color: #E95420;
}
.icon-btn.primary:hover {
background-color: rgba(233, 84, 32, 0.08);
color: #E95420;
}
/* Security Context block style inside the card */
.security-value {
font-size: 14px;
color: #555555;
font-family: 'Ubuntu Mono', monospace;
background-color: rgba(0, 0, 0, 0.04);
padding: 4px 8px;
border-radius: 6px;
border: 1px dashed rgba(0, 0, 0, 0.08);
user-select: text;
text-align: right; /* Right align context value */
}
</style>
</head>
<body>
<div class="external-toolbar">
<span class="toolbar-label">Identity</span>
<input type="text" id="input-identity" class="toolbar-input" placeholder="user@host:path" value="soura@ubuntu">
<div style="width: 1px; height: 20px; background: rgba(255,255,255,0.1); margin: 0 4px;"></div>
<button class="toolbar-btn" id="btn-prompt">Insert Prompt</button>
<button class="toolbar-btn" id="btn-bold">Toggle Bold</button>
<button class="toolbar-btn" id="btn-reset">Normal White</button>
<button class="toolbar-btn active-btn" id="btn-permissions" style="margin-left: auto; border-color: rgba(233, 84, 32, 0.4); color: #E95420; font-weight: bold;">Permissions Panel</button>
</div>
<div class="terminal-window">
<div class="header">
<div class="controls">
<div class="control-dot close"><div class="icon icon-close"></div></div>
<div class="control-dot"><div class="icon icon-min"></div></div>
<div class="control-dot"><div class="icon icon-max"></div></div>
</div>
<div class="window-title" contenteditable="true" style="font-size: 14px;">soura@ubuntu: ~</div>
</div>
<div class="terminal-body" id="terminal" contenteditable="true" spellcheck="false"><span class="user" style="color: #33d17a; font-weight: bold;">soura@ubuntu</span><span style="color: #ffffff; font-weight: bold;">:</span><span class="path" style="color: #3584e4; font-weight: bold;">~</span><span class="char" style="color: #ffffff; font-weight: bold;">$</span> ls -l
total 4
-rw-r--r-- 1 soura soura 1234 May 24 10:00 note.txt
<span class="user" style="color: #33d17a; font-weight: bold;">soura@ubuntu</span><span style="color: #ffffff; font-weight: bold;">:</span><span class="path" style="color: #3584e4; font-weight: bold;">~</span><span class="char" style="color: #ffffff; font-weight: bold;">$</span> </div>
</div>
<!-- ==========================================================================
Ubuntu File Permissions / Properties Window (Boxed Yaru Card Theme)
========================================================================== -->
<div class="permissions-window" id="permissions-panel">
<div class="permissions-header">
<button class="header-action-btn" id="btn-back-perm" title="Back">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>
</button>
<div class="header-title">Set Custom Permissions</div>
<button class="header-action-btn" id="btn-close-perm" title="Close">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
</button>
</div>
<div class="permissions-body">
<!-- Group 1: Owner Card -->
<div class="yaru-card">
<div class="yaru-card-header">Owner</div>
<!-- Owner Selector Row -->
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Owner</span>
</div>
<div class="yaru-editable-container" id="owner-edit-container">
<div class="yaru-select-wrapper" id="select-owner-wrapper">
<div class="yaru-select-trigger" id="select-owner-trigger">
<span class="selected-text" id="owner-display-name">Soura (You)</span>
<svg class="chevron-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 8px; transition: transform 0.2s ease;"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
<div class="yaru-select-options" id="select-owner-options">
<!-- Dynamically loaded options -->
</div>
</div>
<button class="inline-edit-btn" id="btn-edit-owner" title="Edit owner name">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
</button>
</div>
</div>
<!-- Owner Access Row -->
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Access</span>
</div>
<div class="yaru-select-wrapper" id="select-owner-access-wrapper">
<div class="yaru-select-trigger" id="select-owner-access-trigger">
<span class="selected-text">Read and Write</span>
<svg class="chevron-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 8px; transition: transform 0.2s ease;"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
<div class="yaru-select-options">
<div class="yaru-option selected" data-value="readwrite">Read and Write</div>
<div class="yaru-option" data-value="readonly">Read-Only</div>
<div class="yaru-option" data-value="none">None</div>
</div>
</div>
</div>
</div>
<!-- Group 2: Group Card -->
<div class="yaru-card">
<div class="yaru-card-header">Group</div>
<!-- Group Selector Row -->
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Group</span>
</div>
<div class="yaru-editable-container" id="group-edit-container">
<div class="yaru-select-wrapper" id="select-group-wrapper">
<div class="yaru-select-trigger" id="select-group-trigger">
<span class="selected-text" id="group-display-name">Soura</span>
<svg class="chevron-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 8px; transition: transform 0.2s ease;"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
<div class="yaru-select-options" id="select-group-options">
<!-- Dynamically loaded options -->
</div>
</div>
<button class="inline-edit-btn" id="btn-edit-group" title="Edit group name">
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
</button>
</div>
</div>
<!-- Group Access Row -->
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Access</span>
</div>
<div class="yaru-select-wrapper" id="select-group-access-wrapper">
<div class="yaru-select-trigger" id="select-group-access-trigger">
<span class="selected-text">Read-Only</span>
<svg class="chevron-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 8px; transition: transform 0.2s ease;"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
<div class="yaru-select-options">
<div class="yaru-option" data-value="readwrite">Read and Write</div>
<div class="yaru-option selected" data-value="readonly">Read-Only</div>
<div class="yaru-option" data-value="none">None</div>
</div>
</div>
</div>
</div>
<!-- Group 3: Other Users Card -->
<div class="yaru-card">
<div class="yaru-card-header">Other Users</div>
<!-- Other Access Row -->
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Access</span>
</div>
<div class="yaru-select-wrapper" id="select-others-access-wrapper">
<div class="yaru-select-trigger" id="select-others-access-trigger">
<span class="selected-text">Write-Only</span>
<svg class="chevron-icon" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" style="margin-left: 8px; transition: transform 0.2s ease;"><polyline points="6 9 12 15 18 9"></polyline></svg>
</div>
<div class="yaru-select-options">
<div class="yaru-option" data-value="readwrite">Read and Write</div>
<div class="yaru-option" data-value="readonly">Read-Only</div>
<div class="yaru-option selected" data-value="writeonly">Write-Only</div>
<div class="yaru-option" data-value="none">None</div>
</div>
</div>
</div>
</div>
<!-- Group 4: Security Context Card -->
<div class="yaru-card">
<div class="yaru-row">
<div class="row-content">
<span class="row-label">Security Context</span>
</div>
<div class="security-value">Unknown</div>
</div>
</div>
</div>
<!-- Elegant Global Edit Button placed absolutely OUTSIDE above the top-right corner of the window -->
<button class="global-edit-btn" id="btn-global-edit" title="Edit Permissions">
<svg class="icon-pencil" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"></path><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path></svg>
<svg class="icon-save" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>
<span id="btn-global-edit-text">Edit Permissions</span>
</button>
</div>
<script>
window.addEventListener('DOMContentLoaded', () => {
const terminal = document.getElementById('terminal');
const btnPrompt = document.getElementById('btn-prompt');
const btnBold = document.getElementById('btn-bold');
const btnReset = document.getElementById('btn-reset');
const inputIdentity = document.getElementById('input-identity');
const windowTitle = document.querySelector('.window-title');
// --- Functionality ---
const updateHeaderTitle = () => {
const full = inputIdentity.value || 'user@host: ~';
// Only take the user@host part for the title usually,
// but we can just show the full string up to path
const parts = full.split(':');
windowTitle.innerText = parts[0] + (parts[1] ? ': ' + parts[1] : ': ~');
};
const insertPrompt = () => {
const full = inputIdentity.value || 'soura@ubuntu';
// Split logic: user@host | : | path
let [userHost, path] = full.split(':');
if (!path) path = '~';
path = path.replace('$', '').replace('#', '').trim();
const promptHTML = `<span class="user" style="color: #33d17a; font-weight: bold;">${userHost}</span><span style="color: #ffffff; font-weight: bold;">:</span><span class="path" style="color: #3584e4; font-weight: bold;">${path}</span><span class="char" style="color: #ffffff; font-weight: bold;">$</span> `;
document.execCommand('insertHTML', false, promptHTML);
document.execCommand('bold', false, null);
document.execCommand('foreColor', false, '#ffffff');
};
const toggleBold = () => {
document.execCommand('bold', false, null);
};
const resetToNormal = () => {
document.execCommand('removeFormat', false, null);
document.execCommand('foreColor', false, '#ffffff');
document.execCommand('bold', false, null);
// Toggle bold off if it was on. If it was off, this turns it on.
// Executing 'bold' always toggles in contenteditable.
};
// --- Event Listeners ---
btnPrompt.addEventListener('click', insertPrompt);
btnBold.addEventListener('click', toggleBold);
btnReset.addEventListener('click', resetToNormal);
inputIdentity.addEventListener('input', updateHeaderTitle);
// Initialize header title
updateHeaderTitle();
// Hotkeys
terminal.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.key.toLowerCase() === 'b') {
e.preventDefault();
insertPrompt();
}
});
// Helper function to detect common file patterns and wrap them in correct color span classes
const highlightFileNames = (lineText) => {
// Matches filenames with extensions (.js, .jsx, .ts, .tsx, .json, .css, .txt, .sh)
return lineText.replace(/\b([\w-]+\.(js|jsx|ts|tsx|json|css|txt|sh))\b/g, (match, filename, ext) => {
const extension = ext.toLowerCase();
if (extension === 'sh') {
// ONLY explicit shell scripts are styled as green
return `<span style="color: #33d17a; font-weight: bold;">${filename}</span>`;
} else {
// All standard source code, configuration, stylesheet, and data files display in clean, uniform white
return `<span style="color: #ffffff;">${filename}</span>`;
}
});
};
// Helper function to parse terminal lines and color them dynamically
const parseAndColorText = (text) => {
const lines = text.split(/\r?\n/);
const parsedLines = lines.map((line, idx) => {
if (idx === lines.length - 1 && line === '') return '';
const match = line.match(/^([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+)(:)([^$#]*)([$#])([\s\S]*)$/);
if (match) {
const userHost = match[1];
const colon = match[2];
const path = match[3];
const symbol = match[4];
const cmd = match[5];
const highlightedCmd = highlightFileNames(cmd);
return `<span class="user" style="color: #33d17a; font-weight: bold;">${userHost}</span>` +
`<span style="color: #ffffff; font-weight: bold;">${colon}</span>` +
`<span class="path" style="color: #3584e4; font-weight: bold;">${path}</span>` +
`<span class="char" style="color: #ffffff; font-weight: bold;">${symbol}</span>` +
`<span class="command" style="color: #ffffff;">${highlightedCmd}</span>`;
} else {
const highlightedLine = highlightFileNames(line);
return `<span style="color: #ffffff;">${highlightedLine}</span>`;
}
});
return parsedLines.join('\n');
};
// Handle Paste - Strict Ubuntu Yaru Dynamic Color Parsing
terminal.addEventListener('paste', (e) => {
e.preventDefault();
const text = (e.clipboardData || window.clipboardData).getData('text/plain');
const htmlContent = parseAndColorText(text);
document.execCommand('insertHTML', false, htmlContent);
});
// --- Lifecycle ---
// Auto-focus the terminal
terminal.focus();
// Place cursor at the end
const moveToEnd = () => {
const range = document.createRange();
const selection = window.getSelection();
range.selectNodeContents(terminal);
range.collapse(false);
selection.removeAllRanges();
selection.addRange(range);
};
moveToEnd();