hadidadi commited on
Commit
18f6a74
·
verified ·
1 Parent(s): f00a7bb

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +1135 -1543
index.html CHANGED
@@ -1,1564 +1,1156 @@
1
  <!DOCTYPE html>
2
  <html lang="ar" dir="rtl">
 
3
  <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>CodeSpace - بيئة تطوير متكاملة</title>
7
- <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet">
8
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
9
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/ace.js"></script>
10
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-javascript.min.js"></script>
11
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-html.min.js"></script>
12
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-css.min.js"></script>
13
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-python.min.js"></script>
14
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-json.min.js"></script>
15
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-markdown.min.js"></script>
16
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/theme-one_dark.min.js"></script>
17
- <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/ext-language_tools.min.js"></script>
18
- <style>
19
- :root {
20
- --bg-primary: #0d1117;
21
- --bg-secondary: #161b22;
22
- --bg-tertiary: #21262d;
23
- --bg-hover: #30363d;
24
- --border-color: #30363d;
25
- --text-primary: #e6edf3;
26
- --text-secondary: #8b949e;
27
- --text-muted: #6e7681;
28
- --accent-blue: #58a6ff;
29
- --accent-green: #3fb950;
30
- --accent-orange: #f0883e;
31
- --accent-purple: #a371f7;
32
- --accent-red: #f85149;
33
- --accent-yellow: #d29922;
34
- --accent-cyan: #39c5cf;
35
- --sidebar-width: 260px;
36
- --panel-height: 200px;
37
- --header-height: 48px;
38
- --tab-height: 36px;
39
- }
40
-
41
- * {
42
- margin: 0;
43
- padding: 0;
44
- box-sizing: border-box;
45
- }
46
-
47
- body {
48
- font-family: 'Tajawal', sans-serif;
49
- background: var(--bg-primary);
50
- color: var(--text-primary);
51
- overflow: hidden;
52
- height: 100vh;
53
- }
54
-
55
- /* Header */
56
- .header {
57
- height: var(--header-height);
58
- background: var(--bg-secondary);
59
- border-bottom: 1px solid var(--border-color);
60
- display: flex;
61
- align-items: center;
62
- justify-content: space-between;
63
- padding: 0 16px;
64
- position: relative;
65
- z-index: 100;
66
- }
67
-
68
- .header-right {
69
- display: flex;
70
- align-items: center;
71
- gap: 16px;
72
- }
73
-
74
- .logo {
75
- display: flex;
76
- align-items: center;
77
- gap: 10px;
78
- font-weight: 700;
79
- font-size: 1.2rem;
80
- color: var(--text-primary);
81
- }
82
-
83
- .logo-icon {
84
- width: 32px;
85
- height: 32px;
86
- background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
87
- border-radius: 8px;
88
- display: flex;
89
- align-items: center;
90
- justify-content: center;
91
- font-size: 16px;
92
- }
93
-
94
- .project-name {
95
- display: flex;
96
- align-items: center;
97
- gap: 8px;
98
- padding: 6px 12px;
99
- background: var(--bg-tertiary);
100
- border-radius: 6px;
101
- font-size: 0.9rem;
102
- cursor: pointer;
103
- transition: all 0.2s;
104
- }
105
-
106
- .project-name:hover {
107
- background: var(--bg-hover);
108
- }
109
-
110
- .project-name input {
111
- background: transparent;
112
- border: none;
113
- color: var(--text-primary);
114
- font-family: inherit;
115
- font-size: inherit;
116
- width: 120px;
117
- outline: none;
118
- }
119
-
120
- .header-center {
121
- display: flex;
122
- align-items: center;
123
- gap: 8px;
124
- }
125
-
126
- .run-btn {
127
- display: flex;
128
- align-items: center;
129
- gap: 8px;
130
- padding: 8px 20px;
131
- background: linear-gradient(135deg, var(--accent-green), #238636);
132
- border: none;
133
- border-radius: 6px;
134
- color: white;
135
- font-family: inherit;
136
- font-size: 0.9rem;
137
- font-weight: 600;
138
- cursor: pointer;
139
- transition: all 0.2s;
140
- }
141
-
142
- .run-btn:hover {
143
- transform: translateY(-1px);
144
- box-shadow: 0 4px 12px rgba(63, 185, 80, 0.3);
145
- }
146
-
147
- .run-btn:active {
148
- transform: translateY(0);
149
- }
150
-
151
- .header-left {
152
- display: flex;
153
- align-items: center;
154
- gap: 8px;
155
- }
156
-
157
- .header-btn {
158
- width: 36px;
159
- height: 36px;
160
- display: flex;
161
- align-items: center;
162
- justify-content: center;
163
- background: transparent;
164
- border: none;
165
- border-radius: 6px;
166
- color: var(--text-secondary);
167
- cursor: pointer;
168
- transition: all 0.2s;
169
- }
170
-
171
- .header-btn:hover {
172
- background: var(--bg-hover);
173
- color: var(--text-primary);
174
- }
175
-
176
- .credit-link {
177
- font-size: 0.75rem;
178
- color: var(--text-muted);
179
- text-decoration: none;
180
- padding: 4px 8px;
181
- border-radius: 4px;
182
- transition: all 0.2s;
183
- }
184
-
185
- .credit-link:hover {
186
- color: var(--accent-blue);
187
- background: var(--bg-tertiary);
188
- }
189
-
190
- /* Main Layout */
191
- .main-container {
192
- display: flex;
193
- height: calc(100vh - var(--header-height));
194
- }
195
-
196
- /* Sidebar */
197
- .sidebar {
198
- width: var(--sidebar-width);
199
- background: var(--bg-secondary);
200
- border-left: 1px solid var(--border-color);
201
- display: flex;
202
- flex-direction: column;
203
- transition: width 0.3s ease;
204
- overflow: hidden;
205
- }
206
-
207
- .sidebar.collapsed {
208
- width: 48px;
209
- }
210
-
211
- .sidebar-header {
212
- padding: 12px 16px;
213
- display: flex;
214
- align-items: center;
215
- justify-content: space-between;
216
- border-bottom: 1px solid var(--border-color);
217
- min-height: 44px;
218
- }
219
-
220
- .sidebar-title {
221
- font-size: 0.8rem;
222
- font-weight: 600;
223
- text-transform: uppercase;
224
- color: var(--text-secondary);
225
- letter-spacing: 0.5px;
226
- }
227
-
228
- .sidebar-actions {
229
- display: flex;
230
- gap: 4px;
231
- }
232
-
233
- .sidebar-btn {
234
- width: 28px;
235
- height: 28px;
236
- display: flex;
237
- align-items: center;
238
- justify-content: center;
239
- background: transparent;
240
- border: none;
241
- border-radius: 4px;
242
- color: var(--text-secondary);
243
- cursor: pointer;
244
- transition: all 0.2s;
245
- font-size: 0.85rem;
246
- }
247
-
248
- .sidebar-btn:hover {
249
- background: var(--bg-hover);
250
- color: var(--text-primary);
251
- }
252
-
253
- .file-tree {
254
- flex: 1;
255
- overflow-y: auto;
256
- padding: 8px 0;
257
- }
258
-
259
- .file-tree::-webkit-scrollbar {
260
- width: 8px;
261
- }
262
-
263
- .file-tree::-webkit-scrollbar-track {
264
- background: transparent;
265
- }
266
-
267
- .file-tree::-webkit-scrollbar-thumb {
268
- background: var(--bg-hover);
269
- border-radius: 4px;
270
- }
271
-
272
- .tree-item {
273
- display: flex;
274
- align-items: center;
275
- gap: 8px;
276
- padding: 6px 16px;
277
- cursor: pointer;
278
- transition: all 0.15s;
279
- position: relative;
280
- }
281
-
282
- .tree-item:hover {
283
- background: var(--bg-tertiary);
284
- }
285
-
286
- .tree-item.active {
287
- background: var(--bg-tertiary);
288
- }
289
-
290
- .tree-item.active::before {
291
- content: '';
292
- position: absolute;
293
- right: 0;
294
- top: 0;
295
- bottom: 0;
296
- width: 2px;
297
- background: var(--accent-blue);
298
- }
299
-
300
- .tree-item.folder {
301
- font-weight: 500;
302
- }
303
-
304
- .tree-item .icon {
305
- width: 18px;
306
- height: 18px;
307
- display: flex;
308
- align-items: center;
309
- justify-content: center;
310
- font-size: 0.85rem;
311
- }
312
-
313
- .tree-item .icon.folder-icon {
314
- color: var(--accent-orange);
315
- }
316
-
317
- .tree-item .icon.html-icon {
318
- color: var(--accent-orange);
319
- }
320
-
321
- .tree-item .icon.css-icon {
322
- color: var(--accent-blue);
323
- }
324
-
325
- .tree-item .icon.js-icon {
326
- color: var(--accent-yellow);
327
- }
328
-
329
- .tree-item .icon.py-icon {
330
- color: var(--accent-blue);
331
- }
332
-
333
- .tree-item .icon.json-icon {
334
- color: var(--accent-yellow);
335
- }
336
-
337
- .tree-item .icon.md-icon {
338
- color: var(--text-secondary);
339
- }
340
-
341
- .tree-item .name {
342
- font-size: 0.9rem;
343
- white-space: nowrap;
344
- overflow: hidden;
345
- text-overflow: ellipsis;
346
- }
347
-
348
- .tree-children {
349
- padding-right: 16px;
350
- }
351
-
352
- .tree-children.collapsed {
353
- display: none;
354
- }
355
-
356
- /* Editor Area */
357
- .editor-area {
358
- flex: 1;
359
- display: flex;
360
- flex-direction: column;
361
- min-width: 0;
362
- }
363
-
364
- /* Tabs */
365
- .tabs-container {
366
- display: flex;
367
- background: var(--bg-secondary);
368
- border-bottom: 1px solid var(--border-color);
369
- height: var(--tab-height);
370
- overflow-x: auto;
371
- overflow-y: hidden;
372
- }
373
-
374
- .tabs-container::-webkit-scrollbar {
375
- height: 4px;
376
- }
377
-
378
- .tabs-container::-webkit-scrollbar-thumb {
379
- background: var(--bg-hover);
380
- border-radius: 2px;
381
- }
382
-
383
- .tab {
384
- display: flex;
385
- align-items: center;
386
- gap: 8px;
387
- padding: 0 16px;
388
- height: 100%;
389
- background: transparent;
390
- border: none;
391
- border-left: 1px solid var(--border-color);
392
- color: var(--text-secondary);
393
- cursor: pointer;
394
- transition: all 0.15s;
395
- white-space: nowrap;
396
- font-family: inherit;
397
- font-size: 0.85rem;
398
- position: relative;
399
- }
400
-
401
- .tab:hover {
402
- background: var(--bg-tertiary);
403
- color: var(--text-primary);
404
- }
405
-
406
- .tab.active {
407
- background: var(--bg-primary);
408
- color: var(--text-primary);
409
- }
410
-
411
- .tab.active::after {
412
- content: '';
413
- position: absolute;
414
- bottom: 0;
415
- left: 0;
416
- right: 0;
417
- height: 2px;
418
- background: var(--accent-blue);
419
- }
420
-
421
- .tab .close-btn {
422
- width: 18px;
423
- height: 18px;
424
- display: flex;
425
- align-items: center;
426
- justify-content: center;
427
- border-radius: 4px;
428
- opacity: 0;
429
- transition: all 0.15s;
430
- }
431
-
432
- .tab:hover .close-btn {
433
- opacity: 1;
434
- }
435
-
436
- .tab .close-btn:hover {
437
- background: var(--bg-hover);
438
- }
439
-
440
- .tab.modified .name::after {
441
- content: '●';
442
- margin-right: 4px;
443
- color: var(--accent-orange);
444
- }
445
-
446
- /* Editor */
447
- .editor-wrapper {
448
- flex: 1;
449
- display: flex;
450
- position: relative;
451
- overflow: hidden;
452
- }
453
-
454
- .editor-container {
455
- flex: 1;
456
- position: relative;
457
- }
458
-
459
- #editor {
460
- width: 100%;
461
- height: 100%;
462
- font-family: 'JetBrains Mono', monospace;
463
- font-size: 14px;
464
- line-height: 1.6;
465
- }
466
-
467
- .ace_editor {
468
- font-family: 'JetBrains Mono', monospace !important;
469
- }
470
-
471
- .ace_gutter {
472
- background: var(--bg-secondary) !important;
473
- color: var(--text-muted) !important;
474
- }
475
-
476
- .ace_gutter-active-line {
477
- background: var(--bg-tertiary) !important;
478
- }
479
-
480
- /* Preview Panel */
481
- .preview-panel {
482
- width: 50%;
483
- border-right: 1px solid var(--border-color);
484
- display: flex;
485
- flex-direction: column;
486
- background: var(--bg-primary);
487
- }
488
-
489
- .preview-header {
490
- display: flex;
491
- align-items: center;
492
- justify-content: space-between;
493
- padding: 8px 16px;
494
- background: var(--bg-secondary);
495
- border-bottom: 1px solid var(--border-color);
496
- min-height: 40px;
497
- }
498
-
499
- .preview-title {
500
- font-size: 0.8rem;
501
- font-weight: 600;
502
- color: var(--text-secondary);
503
- display: flex;
504
- align-items: center;
505
- gap: 8px;
506
- }
507
-
508
- .preview-url {
509
- flex: 1;
510
- margin: 0 16px;
511
- padding: 4px 12px;
512
- background: var(--bg-tertiary);
513
- border: 1px solid var(--border-color);
514
- border-radius: 4px;
515
- color: var(--text-secondary);
516
- font-size: 0.8rem;
517
- font-family: 'JetBrains Mono', monospace;
518
- direction: ltr;
519
- text-align: left;
520
- }
521
-
522
- .preview-actions {
523
- display: flex;
524
- gap: 4px;
525
- }
526
-
527
- .preview-frame-container {
528
- flex: 1;
529
- position: relative;
530
- background: white;
531
- }
532
-
533
- #preview-frame {
534
- width: 100%;
535
- height: 100%;
536
- border: none;
537
- background: white;
538
- }
539
-
540
- /* Terminal Panel */
541
- .terminal-panel {
542
- height: var(--panel-height);
543
- background: var(--bg-secondary);
544
- border-top: 1px solid var(--border-color);
545
- display: flex;
546
- flex-direction: column;
547
- transition: height 0.2s ease;
548
- }
549
-
550
- .terminal-panel.collapsed {
551
- height: 36px;
552
- }
553
-
554
- .terminal-header {
555
- display: flex;
556
- align-items: center;
557
- padding: 0 16px;
558
- height: 36px;
559
- background: var(--bg-tertiary);
560
- border-bottom: 1px solid var(--border-color);
561
- gap: 8px;
562
- }
563
-
564
- .terminal-tab {
565
- padding: 6px 12px;
566
- font-size: 0.8rem;
567
- color: var(--text-secondary);
568
- cursor: pointer;
569
- border-radius: 4px;
570
- transition: all 0.15s;
571
- display: flex;
572
- align-items: center;
573
- gap: 6px;
574
- }
575
-
576
- .terminal-tab:hover {
577
- background: var(--bg-hover);
578
- color: var(--text-primary);
579
- }
580
-
581
- .terminal-tab.active {
582
- background: var(--bg-primary);
583
- color: var(--text-primary);
584
- }
585
-
586
- .terminal-actions {
587
- margin-right: auto;
588
- display: flex;
589
- gap: 4px;
590
- }
591
-
592
- .terminal-content {
593
- flex: 1;
594
- overflow: hidden;
595
- position: relative;
596
- }
597
-
598
- .terminal-output {
599
- width: 100%;
600
- height: 100%;
601
- background: var(--bg-primary);
602
- padding: 12px;
603
- font-family: 'JetBrains Mono', monospace;
604
- font-size: 13px;
605
- line-height: 1.5;
606
- overflow-y: auto;
607
- direction: ltr;
608
- text-align: left;
609
- }
610
-
611
- .terminal-output::-webkit-scrollbar {
612
- width: 8px;
613
- }
614
-
615
- .terminal-output::-webkit-scrollbar-thumb {
616
- background: var(--bg-hover);
617
- border-radius: 4px;
618
- }
619
-
620
- .terminal-line {
621
- margin-bottom: 4px;
622
- }
623
-
624
- .terminal-line.command {
625
- color: var(--accent-cyan);
626
- }
627
-
628
- .terminal-line.output {
629
- color: var(--text-secondary);
630
- }
631
-
632
- .terminal-line.error {
633
- color: var(--accent-red);
634
- }
635
-
636
- .terminal-line.success {
637
- color: var(--accent-green);
638
- }
639
-
640
- .terminal-line.info {
641
- color: var(--accent-blue);
642
- }
643
-
644
- .terminal-input-line {
645
- display: flex;
646
- align-items: center;
647
- gap: 8px;
648
- padding: 8px 12px;
649
- background: var(--bg-secondary);
650
- border-top: 1px solid var(--border-color);
651
- }
652
-
653
- .terminal-prompt {
654
- color: var(--accent-green);
655
- font-family: 'JetBrains Mono', monospace;
656
- font-size: 13px;
657
- }
658
-
659
- .terminal-input {
660
- flex: 1;
661
- background: transparent;
662
- border: none;
663
- color: var(--text-primary);
664
- font-family: 'JetBrains Mono', monospace;
665
- font-size: 13px;
666
- outline: none;
667
- direction: ltr;
668
- text-align: left;
669
- }
670
-
671
- /* Resize Handle */
672
- .resize-handle {
673
- position: absolute;
674
- background: transparent;
675
- z-index: 10;
676
- }
677
-
678
- .resize-handle.horizontal {
679
- left: 0;
680
- right: 0;
681
- height: 4px;
682
- cursor: ns-resize;
683
- top: -2px;
684
- }
685
-
686
- .resize-handle.vertical {
687
- top: 0;
688
- bottom: 0;
689
- width: 4px;
690
- cursor: ew-resize;
691
- right: -2px;
692
- }
693
-
694
- .resize-handle:hover {
695
- background: var(--accent-blue);
696
- }
697
-
698
- /* Welcome Screen */
699
- .welcome-screen {
700
- flex: 1;
701
- display: flex;
702
- flex-direction: column;
703
- align-items: center;
704
- justify-content: center;
705
- padding: 40px;
706
- text-align: center;
707
- background: var(--bg-primary);
708
- }
709
-
710
- .welcome-icon {
711
- width: 80px;
712
- height: 80px;
713
- background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
714
- border-radius: 20px;
715
- display: flex;
716
- align-items: center;
717
- justify-content: center;
718
- font-size: 36px;
719
- margin-bottom: 24px;
720
- animation: pulse 2s ease-in-out infinite;
721
- }
722
-
723
- @keyframes pulse {
724
- 0%, 100% { transform: scale(1); }
725
- 50% { transform: scale(1.05); }
726
- }
727
-
728
- .welcome-title {
729
- font-size: 2rem;
730
- font-weight: 700;
731
- margin-bottom: 12px;
732
- }
733
-
734
- .welcome-subtitle {
735
- color: var(--text-secondary);
736
- font-size: 1.1rem;
737
- margin-bottom: 32px;
738
- max-width: 500px;
739
- }
740
-
741
- .welcome-actions {
742
- display: flex;
743
- gap: 12px;
744
- flex-wrap: wrap;
745
- justify-content: center;
746
- }
747
-
748
- .welcome-btn {
749
- display: flex;
750
- align-items: center;
751
- gap: 8px;
752
- padding: 12px 24px;
753
- background: var(--bg-tertiary);
754
- border: 1px solid var(--border-color);
755
- border-radius: 8px;
756
- color: var(--text-primary);
757
- font-family: inherit;
758
- font-size: 0.95rem;
759
- cursor: pointer;
760
- transition: all 0.2s;
761
- }
762
-
763
- .welcome-btn:hover {
764
- background: var(--bg-hover);
765
- border-color: var(--accent-blue);
766
- }
767
-
768
- .welcome-btn.primary {
769
- background: var(--accent-blue);
770
- border-color: var(--accent-blue);
771
- }
772
-
773
- .welcome-btn.primary:hover {
774
- background: #4393e6;
775
- }
776
-
777
- /* Modal */
778
- .modal-overlay {
779
- position: fixed;
780
- top: 0;
781
- left: 0;
782
- right: 0;
783
- bottom: 0;
784
- background: rgba(0, 0, 0, 0.7);
785
- display: flex;
786
- align-items: center;
787
- justify-content: center;
788
- z-index: 1000;
789
- opacity: 0;
790
- visibility: hidden;
791
- transition: all 0.2s;
792
- }
793
-
794
- .modal-overlay.active {
795
- opacity: 1;
796
- visibility: visible;
797
- }
798
-
799
- .modal {
800
- background: var(--bg-secondary);
801
- border: 1px solid var(--border-color);
802
- border-radius: 12px;
803
- width: 90%;
804
- max-width: 480px;
805
- transform: scale(0.95);
806
- transition: transform 0.2s;
807
- }
808
-
809
- .modal-overlay.active .modal {
810
- transform: scale(1);
811
- }
812
-
813
- .modal-header {
814
- display: flex;
815
- align-items: center;
816
- justify-content: space-between;
817
- padding: 16px 20px;
818
- border-bottom: 1px solid var(--border-color);
819
- }
820
-
821
- .modal-title {
822
- font-size: 1.1rem;
823
- font-weight: 600;
824
- }
825
-
826
- .modal-close {
827
- width: 32px;
828
- height: 32px;
829
- display: flex;
830
- align-items: center;
831
- justify-content: center;
832
- background: transparent;
833
- border: none;
834
- border-radius: 6px;
835
- color: var(--text-secondary);
836
- cursor: pointer;
837
- transition: all 0.15s;
838
- }
839
-
840
- .modal-close:hover {
841
- background: var(--bg-hover);
842
- color: var(--text-primary);
843
- }
844
-
845
- .modal-body {
846
- padding: 20px;
847
- }
848
-
849
- .form-group {
850
- margin-bottom: 16px;
851
- }
852
-
853
- .form-label {
854
- display: block;
855
- font-size: 0.9rem;
856
- color: var(--text-secondary);
857
- margin-bottom: 8px;
858
- }
859
-
860
- .form-input {
861
- width: 100%;
862
- padding: 10px 14px;
863
- background: var(--bg-tertiary);
864
- border: 1px solid var(--border-color);
865
- border-radius: 6px;
866
- color: var(--text-primary);
867
- font-family: inherit;
868
- font-size: 0.95rem;
869
- outline: none;
870
- transition: border-color 0.2s;
871
- }
872
-
873
- .form-input:focus {
874
- border-color: var(--accent-blue);
875
- }
876
-
877
- .form-input::placeholder {
878
- color: var(--text-muted);
879
- }
880
-
881
- .form-select {
882
- width: 100%;
883
- padding: 10px 14px;
884
- background: var(--bg-tertiary);
885
- border: 1px solid var(--border-color);
886
- border-radius: 6px;
887
- color: var(--text-primary);
888
- font-family: inherit;
889
- font-size: 0.95rem;
890
- outline: none;
891
- cursor: pointer;
892
- }
893
-
894
- .modal-footer {
895
- display: flex;
896
- justify-content: flex-end;
897
- gap: 12px;
898
- padding: 16px 20px;
899
- border-top: 1px solid var(--border-color);
900
- }
901
-
902
- .btn {
903
- padding: 10px 20px;
904
- border-radius: 6px;
905
- font-family: inherit;
906
- font-size: 0.9rem;
907
- font-weight: 500;
908
- cursor: pointer;
909
- transition: all 0.2s;
910
- }
911
-
912
- .btn-secondary {
913
- background: var(--bg-tertiary);
914
- border: 1px solid var(--border-color);
915
- color: var(--text-primary);
916
- }
917
-
918
- .btn-secondary:hover {
919
- background: var(--bg-hover);
920
- }
921
-
922
- .btn-primary {
923
- background: var(--accent-blue);
924
- border: none;
925
- color: white;
926
- }
927
-
928
- .btn-primary:hover {
929
- background: #4393e6;
930
- }
931
-
932
- /* Context Menu */
933
- .context-menu {
934
- position: fixed;
935
- background: var(--bg-secondary);
936
- border: 1px solid var(--border-color);
937
- border-radius: 8px;
938
- padding: 6px 0;
939
- min-width: 180px;
940
- z-index: 1001;
941
- opacity: 0;
942
- visibility: hidden;
943
- transform: scale(0.95);
944
- transition: all 0.15s;
945
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
946
- }
947
-
948
- .context-menu.active {
949
- opacity: 1;
950
- visibility: visible;
951
- transform: scale(1);
952
- }
953
-
954
- .context-menu-item {
955
- display: flex;
956
- align-items: center;
957
- gap: 12px;
958
- padding: 8px 16px;
959
- font-size: 0.9rem;
960
- color: var(--text-primary);
961
- cursor: pointer;
962
- transition: all 0.15s;
963
- }
964
-
965
- .context-menu-item:hover {
966
- background: var(--bg-tertiary);
967
- }
968
-
969
- .context-menu-item i {
970
- width: 16px;
971
- color: var(--text-secondary);
972
- }
973
-
974
- .context-menu-divider {
975
- height: 1px;
976
- background: var(--border-color);
977
- margin: 6px 0;
978
- }
979
-
980
- /* Toast */
981
- .toast-container {
982
- position: fixed;
983
- bottom: 20px;
984
- left: 20px;
985
- z-index: 1002;
986
- display: flex;
987
- flex-direction: column;
988
- gap: 8px;
989
- }
990
-
991
- .toast {
992
- display: flex;
993
- align-items: center;
994
- gap: 12px;
995
- padding: 12px 16px;
996
- background: var(--bg-secondary);
997
- border: 1px solid var(--border-color);
998
- border-radius: 8px;
999
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
1000
- animation: slideIn 0.3s ease;
1001
- }
1002
-
1003
- @keyframes slideIn {
1004
- from {
1005
- opacity: 0;
1006
- transform: translateX(-20px);
1007
- }
1008
- to {
1009
- opacity: 1;
1010
- transform: translateX(0);
1011
- }
1012
- }
1013
-
1014
- .toast.success {
1015
- border-color: var(--accent-green);
1016
- }
1017
-
1018
- .toast.error {
1019
- border-color: var(--accent-red);
1020
- }
1021
-
1022
- .toast.info {
1023
- border-color: var(--accent-blue);
1024
- }
1025
-
1026
- .toast-icon {
1027
- font-size: 1.1rem;
1028
- }
1029
-
1030
- .toast.success .toast-icon {
1031
- color: var(--accent-green);
1032
- }
1033
-
1034
- .toast.error .toast-icon {
1035
- color: var(--accent-red);
1036
- }
1037
-
1038
- .toast.info .toast-icon {
1039
- color: var(--accent-blue);
1040
- }
1041
-
1042
- /* Status Bar */
1043
- .status-bar {
1044
- height: 24px;
1045
- background: var(--bg-tertiary);
1046
- border-top: 1px solid var(--border-color);
1047
- display: flex;
1048
- align-items: center;
1049
- justify-content: space-between;
1050
- padding: 0 16px;
1051
- font-size: 0.75rem;
1052
- color: var(--text-secondary);
1053
- }
1054
-
1055
- .status-left, .status-right {
1056
- display: flex;
1057
- align-items: center;
1058
- gap: 16px;
1059
- }
1060
-
1061
- .status-item {
1062
- display: flex;
1063
- align-items: center;
1064
- gap: 6px;
1065
- }
1066
-
1067
- /* Loading */
1068
- .loading-overlay {
1069
- position: absolute;
1070
- top: 0;
1071
- left: 0;
1072
- right: 0;
1073
- bottom: 0;
1074
- background: var(--bg-primary);
1075
- display: flex;
1076
- align-items: center;
1077
- justify-content: center;
1078
- z-index: 100;
1079
- opacity: 0;
1080
- visibility: hidden;
1081
- transition: all 0.3s;
1082
- }
1083
-
1084
- .loading-overlay.active {
1085
- opacity: 1;
1086
- visibility: visible;
1087
- }
1088
-
1089
- .loading-spinner {
1090
- width: 40px;
1091
- height: 40px;
1092
- border: 3px solid var(--bg-hover);
1093
- border-top-color: var(--accent-blue);
1094
- border-radius: 50%;
1095
- animation: spin 1s linear infinite;
1096
- }
1097
-
1098
- @keyframes spin {
1099
- to { transform: rotate(360deg); }
1100
- }
1101
-
1102
- /* Responsive */
1103
- @media (max-width: 1024px) {
1104
- .sidebar {
1105
- position: fixed;
1106
- right: 0;
1107
- top: var(--header-height);
1108
- bottom: 0;
1109
- z-index: 50;
1110
- transform: translateX(100%);
1111
- transition: transform 0.3s ease;
1112
- }
1113
-
1114
- .sidebar.open {
1115
- transform: translateX(0);
1116
- }
1117
-
1118
- .preview-panel {
1119
- width: 100%;
1120
- }
1121
-
1122
- .editor-wrapper {
1123
- flex-direction: column;
1124
- }
1125
- }
1126
-
1127
- @media (max-width: 768px) {
1128
- .header-center {
1129
- display: none;
1130
- }
1131
-
1132
- .project-name {
1133
- display: none;
1134
- }
1135
-
1136
- .welcome-title {
1137
- font-size: 1.5rem;
1138
- }
1139
-
1140
- .welcome-subtitle {
1141
- font-size: 1rem;
1142
- }
1143
- }
1144
-
1145
- /* Animations */
1146
- @media (prefers-reduced-motion: no-preference) {
1147
- .fade-in {
1148
- animation: fadeIn 0.3s ease;
1149
- }
1150
-
1151
- @keyframes fadeIn {
1152
- from { opacity: 0; }
1153
- to { opacity: 1; }
1154
- }
1155
- }
1156
-
1157
- /* Split View */
1158
- .split-view {
1159
- display: flex;
1160
- flex: 1;
1161
- overflow: hidden;
1162
- }
1163
-
1164
- .editor-pane {
1165
- flex: 1;
1166
- display: flex;
1167
- flex-direction: column;
1168
- min-width: 0;
1169
- }
1170
-
1171
- .editor-pane:first-child {
1172
- border-left: 1px solid var(--border-color);
1173
- }
1174
-
1175
- /* Search Panel */
1176
- .search-panel {
1177
- padding: 12px 16px;
1178
- background: var(--bg-tertiary);
1179
- border-bottom: 1px solid var(--border-color);
1180
- display: none;
1181
- }
1182
-
1183
- .search-panel.active {
1184
- display: block;
1185
- }
1186
-
1187
- .search-input-wrapper {
1188
- display: flex;
1189
- gap: 8px;
1190
- }
1191
-
1192
- .search-input {
1193
- flex: 1;
1194
- padding: 8px 12px;
1195
- background: var(--bg-primary);
1196
- border: 1px solid var(--border-color);
1197
- border-radius: 6px;
1198
- color: var(--text-primary);
1199
- font-family: 'JetBrains Mono', monospace;
1200
- font-size: 0.9rem;
1201
- outline: none;
1202
- }
1203
-
1204
- .search-input:focus {
1205
- border-color: var(--accent-blue);
1206
- }
1207
-
1208
- .search-btn {
1209
- padding: 8px 16px;
1210
- background: var(--accent-blue);
1211
- border: none;
1212
- border-radius: 6px;
1213
- color: white;
1214
- font-family: inherit;
1215
- font-size: 0.85rem;
1216
- cursor: pointer;
1217
- transition: all 0.2s;
1218
- }
1219
-
1220
- .search-btn:hover {
1221
- background: #4393e6;
1222
- }
1223
-
1224
- /* Console Panel */
1225
- .console-panel {
1226
- display: none;
1227
- height: 100%;
1228
- overflow: auto;
1229
- }
1230
-
1231
- .console-panel.active {
1232
- display: block;
1233
- }
1234
-
1235
- /* Problems Panel */
1236
- .problems-panel {
1237
- display: none;
1238
- padding: 12px;
1239
- }
1240
-
1241
- .problems-panel.active {
1242
- display: block;
1243
- }
1244
-
1245
- .problem-item {
1246
- display: flex;
1247
- align-items: flex-start;
1248
- gap: 8px;
1249
- padding: 8px;
1250
- border-radius: 4px;
1251
- margin-bottom: 4px;
1252
- font-size: 0.85rem;
1253
- }
1254
-
1255
- .problem-item:hover {
1256
- background: var(--bg-tertiary);
1257
- }
1258
-
1259
- .problem-item.error {
1260
- color: var(--accent-red);
1261
- }
1262
-
1263
- .problem-item.warning {
1264
- color: var(--accent-yellow);
1265
- }
1266
-
1267
- /* Git Panel */
1268
- .git-panel {
1269
- padding: 16px;
1270
- display: none;
1271
- }
1272
-
1273
- .git-panel.active {
1274
- display: block;
1275
- }
1276
-
1277
- .git-status {
1278
- display: flex;
1279
- align-items: center;
1280
- gap: 8px;
1281
- padding: 8px 12px;
1282
- background: var(--bg-tertiary);
1283
- border-radius: 6px;
1284
- font-size: 0.85rem;
1285
- margin-bottom: 12px;
1286
- }
1287
-
1288
- .git-branch {
1289
- color: var(--accent-green);
1290
- }
1291
-
1292
- .git-commit-input {
1293
- width: 100%;
1294
- padding: 10px 12px;
1295
- background: var(--bg-tertiary);
1296
- border: 1px solid var(--border-color);
1297
- border-radius: 6px;
1298
- color: var(--text-primary);
1299
- font-family: inherit;
1300
- font-size: 0.9rem;
1301
- margin-bottom: 12px;
1302
- resize: none;
1303
- min-height: 80px;
1304
- }
1305
-
1306
- .git-commit-btn {
1307
- width: 100%;
1308
- padding: 10px;
1309
- background: var(--accent-green);
1310
- border: none;
1311
- border-radius: 6px;
1312
- color: white;
1313
- font-family: inherit;
1314
- font-size: 0.9rem;
1315
- font-weight: 500;
1316
- cursor: pointer;
1317
- transition: all 0.2s;
1318
- }
1319
-
1320
- .git-commit-btn:hover {
1321
- background: #2ea043;
1322
- }
1323
- </style>
1324
  </head>
 
1325
  <body>
1326
- <!-- Header -->
1327
- <header class="header">
1328
- <div class="header-right">
1329
- <div class="logo">
1330
- <div class="logo-icon">
1331
- <i class="fas fa-code"></i>
1332
- </div>
1333
- <span>CodeSpace</span>
1334
- </div>
1335
- <div class="project-name">
1336
- <i class="fas fa-folder"></i>
1337
- <input type="text" id="project-name" value="مشروعي الأول" spellcheck="false">
1338
- </div>
1339
- </div>
1340
- <div class="header-center">
1341
- <button class="run-btn" onclick="runCode()">
1342
- <i class="fas fa-play"></i>
1343
- <span>تشغيل</span>
1344
- </button>
1345
- </div>
1346
- <div class="header-left">
1347
- <button class="header-btn" onclick="toggleSidebar()" title="إظهار/إخفاء الشريط الجانبي">
1348
- <i class="fas fa-bars"></i>
1349
- </button>
1350
- <button class="header-btn" onclick="shareProject()" title="مشاركة">
1351
- <i class="fas fa-share-alt"></i>
1352
- </button>
1353
- <button class="header-btn" onclick="downloadProject()" title="تحميل">
1354
- <i class="fas fa-download"></i>
1355
- </button>
1356
- <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="credit-link">
1357
- Built with anycoder
1358
- </a>
1359
  </div>
1360
- </header>
1361
-
1362
- <!-- Main Container -->
1363
- <div class="main-container">
1364
- <!-- Sidebar -->
1365
- <aside class="sidebar" id="sidebar">
1366
- <div class="sidebar-header">
1367
- <span class="sidebar-title">الملفات</span>
1368
- <div class="sidebar-actions">
1369
- <button class="sidebar-btn" onclick="showNewFileModal()" title="ملف جديد">
1370
- <i class="fas fa-file-plus"></i>
1371
- </button>
1372
- <button class="sidebar-btn" onclick="showNewFolderModal()" title="مجلد جديد">
1373
- <i class="fas fa-folder-plus"></i>
1374
- </button>
1375
- </div>
1376
- </div>
1377
- <div class="file-tree" id="file-tree">
1378
- <!-- Files will be rendered here -->
1379
- </div>
1380
- </aside>
1381
-
1382
- <!-- Editor Area -->
1383
- <main class="editor-area">
1384
- <!-- Tabs -->
1385
- <div class="tabs-container" id="tabs-container">
1386
- <!-- Tabs will be rendered here -->
1387
- </div>
1388
-
1389
- <!-- Split View -->
1390
- <div class="split-view">
1391
- <!-- Editor Pane -->
1392
- <div class="editor-pane">
1393
- <div class="search-panel" id="search-panel">
1394
- <div class="search-input-wrapper">
1395
- <input type="text" class="search-input" id="search-input" placeholder="بحث...">
1396
- <input type="text" class="search-input" id="replace-input" placeholder="استبدال...">
1397
- <button class="search-btn" onclick="searchInEditor()">بحث</button>
1398
- <button class="search-btn" onclick="replaceInEditor()">استبدال</button>
1399
- </div>
1400
- </div>
1401
- <div class="editor-wrapper">
1402
- <div class="editor-container" id="editor-container">
1403
- <div id="editor"></div>
1404
- </div>
1405
- </div>
1406
- </div>
1407
-
1408
- <!-- Preview Pane -->
1409
- <div class="editor-pane preview-panel" id="preview-panel">
1410
- <div class="preview-header">
1411
- <span class="preview-title">
1412
- <i class="fas fa-eye"></i>
1413
- معاينة
1414
- </span>
1415
- <input type="text" class="preview-url" id="preview-url" value="localhost:3000" readonly>
1416
- <div class="preview-actions">
1417
- <button class="header-btn" onclick="refreshPreview()" title="تحديث">
1418
- <i class="fas fa-sync-alt"></i>
1419
- </button>
1420
- <button class="header-btn" onclick="openPreviewInNewTab()" title="فتح في نافذة جديدة">
1421
- <i class="fas fa-external-link-alt"></i>
1422
- </button>
1423
- </div>
1424
- </div>
1425
- <div class="preview-frame-container">
1426
- <iframe id="preview-frame" sandbox="allow-scripts allow-same-origin"></iframe>
1427
- <div class="resize-handle vertical"></div>
1428
- </div>
1429
- </div>
1430
- </div>
1431
-
1432
- <!-- Terminal Panel -->
1433
- <div class="terminal-panel" id="terminal-panel">
1434
- <div class="terminal-header">
1435
- <div class="terminal-tab active" onclick="switchTerminalTab('terminal')">
1436
- <i class="fas fa-terminal"></i>
1437
- الطرفية
1438
- </div>
1439
- <div class="terminal-tab" onclick="switchTerminalTab('console')">
1440
- <i class="fas fa-bug"></i>
1441
- الكونسول
1442
- </div>
1443
- <div class="terminal-tab" onclick="switchTerminalTab('problems')">
1444
- <i class="fas fa-exclamation-triangle"></i>
1445
- المشاكل
1446
- </div>
1447
- <div class="terminal-actions">
1448
- <button class="sidebar-btn" onclick="clearTerminal()" title="مسح">
1449
- <i class="fas fa-trash"></i>
1450
- </button>
1451
- <button class="sidebar-btn" onclick="toggleTerminal()" title="تصغير/تكبير">
1452
- <i class="fas fa-chevron-down"></i>
1453
- </button>
1454
- </div>
1455
- </div>
1456
- <div class="terminal-content">
1457
- <div class="terminal-output" id="terminal-output">
1458
- <div class="terminal-line info">مرحباً بك في CodeSpace! اكتب 'help' للحصول على المساعدة.</div>
1459
- </div>
1460
- <div class="terminal-input-line">
1461
- <span class="terminal-prompt">$</span>
1462
- <input type="text" class="terminal-input" id="terminal-input" placeholder="أدخل الأمر..." autofocus>
1463
- </div>
1464
- </div>
1465
- </div>
1466
- </main>
1467
  </div>
1468
-
1469
- <!-- Status Bar -->
1470
- <div class="status-bar">
1471
- <div class="status-left">
1472
- <div class="status-item">
1473
- <i class="fas fa-code-branch"></i>
1474
- <span>main</span>
1475
- </div>
1476
- <div class="status-item" id="status-sync">
1477
- <i class="fas fa-check-circle"></i>
1478
- <span>محفوظ</span>
1479
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1480
  </div>
1481
- <div class="status-right">
1482
- <div class="status-item" id="status-language">
1483
- <span>JavaScript</span>
1484
- </div>
1485
- <div class="status-item" id="status-position">
1486
- <span>سطر عمود 1</span>
1487
- </div>
1488
- <div class="status-item">
1489
- <span>UTF-8</span>
 
 
 
1490
  </div>
 
1491
  </div>
1492
- </div>
1493
 
1494
- <!-- New File Modal -->
1495
- <div class="modal-overlay" id="new-file-modal">
1496
- <div class="modal">
1497
- <div class="modal-header">
1498
- <h3 class="modal-title">ملف جديد</h3>
1499
- <button class="modal-close" onclick="closeModal('new-file-modal')">
1500
- <i class="fas fa-times"></i>
1501
- </button>
1502
- </div>
1503
- <div class="modal-body">
1504
- <div class="form-group">
1505
- <label class="form-label">اسم الملف</label>
1506
- <input type="text" class="form-input" id="new-file-name" placeholder="script.js">
1507
- </div>
1508
- <div class="form-group">
1509
- <label class="form-label">نوع الملف</label>
1510
- <select class="form-select" id="new-file-type">
1511
- <option value="javascript">JavaScript (.js)</option>
1512
- <option value="html">HTML (.html)</option>
1513
- <option value="css">CSS (.css)</option>
1514
- <option value="python">Python (.py)</option>
1515
- <option value="json">JSON (.json)</option>
1516
- <option value="markdown">Markdown (.md)</option>
1517
- </select>
1518
- </div>
1519
- </div>
1520
- <div class="modal-footer">
1521
- <button class="btn btn-secondary" onclick="closeModal('new-file-modal')">إلغاء</button>
1522
- <button class="btn btn-primary" onclick="createNewFile()">إنشاء</button>
1523
  </div>
 
 
 
 
1524
  </div>
1525
- </div>
1526
-
1527
- <!-- Context Menu -->
1528
- <div class="context-menu" id="context-menu">
1529
- <div class="context-menu-item" onclick="renameFile()">
1530
- <i class="fas fa-edit"></i>
1531
- <span>إعادة تسمية</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
1532
  </div>
1533
- <div class="context-menu-item" onclick="duplicateFile()">
1534
- <i class="fas fa-copy"></i>
1535
- <spanسخ</span>
 
 
 
 
 
 
 
1536
  </div>
1537
- <div class="context-menu-divider"></div>
1538
- <div class="context-menu-item" onclick="deleteFile()" style="color: var(--accent-red);">
1539
- <i class="fas fa-trash"></i>
1540
- <span>حذف</span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1541
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1542
  </div>
 
1543
 
1544
- <!-- Toast Container -->
1545
- <div class="toast-container" id="toast-container"></div>
1546
-
1547
- <script>
1548
- // Initialize variables first
1549
- let editor = null;
1550
- let currentFile = null;
1551
- let openTabs = [];
1552
- let fileSystem = {};
1553
- let selectedContextItem = null;
1554
-
1555
- // File System
1556
- const defaultFiles = {
1557
- 'index.html': {
1558
- name: 'index.html',
1559
- type: 'html',
1560
- content: `<!DOCTYPE html>
 
 
 
 
 
 
 
 
1561
  <html lang="ar" dir="rtl">
1562
  <head>
1563
  <meta charset="UTF-8">
1564
- <meta
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <!DOCTYPE html>
2
  <html lang="ar" dir="rtl">
3
+
4
  <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>CodeSpace - بيئة تطوير متكاملة</title>
8
+ <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Tajawal:wght@400;500;700&display=swap" rel="stylesheet">
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
10
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/ace.js"></script>
11
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-javascript.min.js"></script>
12
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-html.min.js"></script>
13
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-css.min.js"></script>
14
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-python.min.js"></script>
15
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-json.min.js"></script>
16
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/mode-markdown.min.js"></script>
17
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/theme-one_dark.min.js"></script>
18
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.2/ext-language_tools.min.js"></script>
19
+ <style>
20
+ :root {
21
+ --bg-primary: #0d1117;
22
+ --bg-secondary: #161b22;
23
+ --bg-tertiary: #21262d;
24
+ --bg-hover: #30363d;
25
+ --border-color: #30363d;
26
+ --text-primary: #e6edf3;
27
+ --text-secondary: #8b949e;
28
+ --text-muted: #6e7681;
29
+ --accent-blue: #58a6ff;
30
+ --accent-green: #3fb950;
31
+ --accent-orange: #f0883e;
32
+ --accent-purple: #a371f7;
33
+ --accent-red: #f85149;
34
+ --accent-yellow: #d29922;
35
+ --accent-cyan: #39c5cf;
36
+ --sidebar-width: 260px;
37
+ --panel-height: 180px;
38
+ --header-height: 48px;
39
+ --tab-height: 36px;
40
+ }
41
+
42
+ * {
43
+ margin: 0;
44
+ padding: 0;
45
+ box-sizing: border-box;
46
+ }
47
+
48
+ body {
49
+ font-family: 'Tajawal', sans-serif;
50
+ background: var(--bg-primary);
51
+ color: var(--text-primary);
52
+ overflow: hidden;
53
+ height: 100vh;
54
+ }
55
+
56
+ .header {
57
+ height: var(--header-height);
58
+ background: var(--bg-secondary);
59
+ border-bottom: 1px solid var(--border-color);
60
+ display: flex;
61
+ align-items: center;
62
+ justify-content: space-between;
63
+ padding: 0 16px;
64
+ position: relative;
65
+ z-index: 100;
66
+ }
67
+
68
+ .header-right {
69
+ display: flex;
70
+ align-items: center;
71
+ gap: 16px;
72
+ }
73
+
74
+ .logo {
75
+ display: flex;
76
+ align-items: center;
77
+ gap: 10px;
78
+ font-weight: 700;
79
+ font-size: 1.2rem;
80
+ color: var(--text-primary);
81
+ }
82
+
83
+ .logo-icon {
84
+ width: 32px;
85
+ height: 32px;
86
+ background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
87
+ border-radius: 8px;
88
+ display: flex;
89
+ align-items: center;
90
+ justify-content: center;
91
+ font-size: 16px;
92
+ }
93
+
94
+ .project-name {
95
+ display: flex;
96
+ align-items: center;
97
+ gap: 8px;
98
+ padding: 6px 12px;
99
+ background: var(--bg-tertiary);
100
+ border-radius: 6px;
101
+ font-size: 0.9rem;
102
+ cursor: pointer;
103
+ transition: all 0.2s;
104
+ }
105
+
106
+ .project-name:hover {
107
+ background: var(--bg-hover);
108
+ }
109
+
110
+ .project-name input {
111
+ background: transparent;
112
+ border: none;
113
+ color: var(--text-primary);
114
+ font-family: inherit;
115
+ font-size: inherit;
116
+ width: 120px;
117
+ outline: none;
118
+ }
119
+
120
+ .header-center {
121
+ display: flex;
122
+ align-items: center;
123
+ gap: 8px;
124
+ }
125
+
126
+ .run-btn {
127
+ display: flex;
128
+ align-items: center;
129
+ gap: 8px;
130
+ padding: 8px 24px;
131
+ background: linear-gradient(135deg, var(--accent-green), #238636);
132
+ border: none;
133
+ border-radius: 8px;
134
+ color: white;
135
+ font-family: inherit;
136
+ font-size: 0.95rem;
137
+ font-weight: 600;
138
+ cursor: pointer;
139
+ transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
140
+ box-shadow: 0 2px 8px rgba(63, 185, 80, 0.25);
141
+ }
142
+
143
+ .run-btn:hover {
144
+ transform: translateY(-2px);
145
+ box-shadow: 0 6px 20px rgba(63, 185, 80, 0.4);
146
+ }
147
+
148
+ .run-btn:active {
149
+ transform: translateY(0);
150
+ }
151
+
152
+ .run-btn.running {
153
+ background: linear-gradient(135deg, var(--accent-orange), #da3633);
154
+ }
155
+
156
+ .run-btn i {
157
+ transition: transform 0.3s ease;
158
+ }
159
+
160
+ .run-btn:hover i {
161
+ transform: scale(1.1);
162
+ }
163
+
164
+ .header-left {
165
+ display: flex;
166
+ align-items: center;
167
+ gap: 8px;
168
+ }
169
+
170
+ .header-btn {
171
+ width: 36px;
172
+ height: 36px;
173
+ display: flex;
174
+ align-items: center;
175
+ justify-content: center;
176
+ background: transparent;
177
+ border: none;
178
+ border-radius: 6px;
179
+ color: var(--text-secondary);
180
+ cursor: pointer;
181
+ transition: all 0.2s;
182
+ }
183
+
184
+ .header-btn:hover {
185
+ background: var(--bg-hover);
186
+ color: var(--text-primary);
187
+ }
188
+
189
+ .credit-link {
190
+ font-size: 0.75rem;
191
+ color: var(--text-muted);
192
+ text-decoration: none;
193
+ padding: 4px 8px;
194
+ border-radius: 4px;
195
+ transition: all 0.2s;
196
+ }
197
+
198
+ .credit-link:hover {
199
+ color: var(--accent-blue);
200
+ background: var(--bg-tertiary);
201
+ }
202
+
203
+ .main-container {
204
+ display: flex;
205
+ height: calc(100vh - var(--header-height));
206
+ }
207
+
208
+ .sidebar {
209
+ width: var(--sidebar-width);
210
+ background: var(--bg-secondary);
211
+ border-left: 1px solid var(--border-color);
212
+ display: flex;
213
+ flex-direction: column;
214
+ transition: width 0.3s ease;
215
+ overflow: hidden;
216
+ }
217
+
218
+ .sidebar.collapsed {
219
+ width: 48px;
220
+ }
221
+
222
+ .sidebar-header {
223
+ padding: 12px 16px;
224
+ display: flex;
225
+ align-items: center;
226
+ justify-content: space-between;
227
+ border-bottom: 1px solid var(--border-color);
228
+ min-height: 44px;
229
+ }
230
+
231
+ .sidebar-title {
232
+ font-size: 0.8rem;
233
+ font-weight: 600;
234
+ text-transform: uppercase;
235
+ color: var(--text-secondary);
236
+ letter-spacing: 0.5px;
237
+ }
238
+
239
+ .sidebar-actions {
240
+ display: flex;
241
+ gap: 4px;
242
+ }
243
+
244
+ .sidebar-btn {
245
+ width: 28px;
246
+ height: 28px;
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ background: transparent;
251
+ border: none;
252
+ border-radius: 4px;
253
+ color: var(--text-secondary);
254
+ cursor: pointer;
255
+ transition: all 0.2s;
256
+ font-size: 0.85rem;
257
+ }
258
+
259
+ .sidebar-btn:hover {
260
+ background: var(--bg-hover);
261
+ color: var(--text-primary);
262
+ }
263
+
264
+ .file-tree {
265
+ flex: 1;
266
+ overflow-y: auto;
267
+ padding: 8px 0;
268
+ }
269
+
270
+ .file-tree::-webkit-scrollbar {
271
+ width: 8px;
272
+ }
273
+
274
+ .file-tree::-webkit-scrollbar-track {
275
+ background: transparent;
276
+ }
277
+
278
+ .file-tree::-webkit-scrollbar-thumb {
279
+ background: var(--bg-hover);
280
+ border-radius: 4px;
281
+ }
282
+
283
+ .tree-item {
284
+ display: flex;
285
+ align-items: center;
286
+ gap: 8px;
287
+ padding: 6px 16px;
288
+ cursor: pointer;
289
+ transition: all 0.15s;
290
+ position: relative;
291
+ }
292
+
293
+ .tree-item:hover {
294
+ background: var(--bg-tertiary);
295
+ }
296
+
297
+ .tree-item.active {
298
+ background: var(--bg-tertiary);
299
+ }
300
+
301
+ .tree-item.active::before {
302
+ content: '';
303
+ position: absolute;
304
+ right: 0;
305
+ top: 0;
306
+ bottom: 0;
307
+ width: 2px;
308
+ background: var(--accent-blue);
309
+ }
310
+
311
+ .tree-item .icon {
312
+ width: 18px;
313
+ height: 18px;
314
+ display: flex;
315
+ align-items: center;
316
+ justify-content: center;
317
+ font-size: 0.85rem;
318
+ }
319
+
320
+ .tree-item .icon.html-icon { color: var(--accent-orange); }
321
+ .tree-item .icon.css-icon { color: var(--accent-blue); }
322
+ .tree-item .icon.js-icon { color: var(--accent-yellow); }
323
+ .tree-item .icon.py-icon { color: var(--accent-cyan); }
324
+ .tree-item .icon.json-icon { color: var(--accent-yellow); }
325
+ .tree-item .icon.md-icon { color: var(--text-secondary); }
326
+
327
+ .tree-item .name {
328
+ font-size: 0.9rem;
329
+ white-space: nowrap;
330
+ overflow: hidden;
331
+ text-overflow: ellipsis;
332
+ }
333
+
334
+ .editor-area {
335
+ flex: 1;
336
+ display: flex;
337
+ flex-direction: column;
338
+ min-width: 0;
339
+ }
340
+
341
+ .tabs-container {
342
+ display: flex;
343
+ background: var(--bg-secondary);
344
+ border-bottom: 1px solid var(--border-color);
345
+ height: var(--tab-height);
346
+ overflow-x: auto;
347
+ overflow-y: hidden;
348
+ }
349
+
350
+ .tabs-container::-webkit-scrollbar {
351
+ height: 4px;
352
+ }
353
+
354
+ .tabs-container::-webkit-scrollbar-thumb {
355
+ background: var(--bg-hover);
356
+ border-radius: 2px;
357
+ }
358
+
359
+ .tab {
360
+ display: flex;
361
+ align-items: center;
362
+ gap: 8px;
363
+ padding: 0 16px;
364
+ height: 100%;
365
+ background: transparent;
366
+ border: none;
367
+ border-left: 1px solid var(--border-color);
368
+ color: var(--text-secondary);
369
+ cursor: pointer;
370
+ transition: all 0.15s;
371
+ white-space: nowrap;
372
+ font-family: inherit;
373
+ font-size: 0.85rem;
374
+ position: relative;
375
+ }
376
+
377
+ .tab:hover {
378
+ background: var(--bg-tertiary);
379
+ color: var(--text-primary);
380
+ }
381
+
382
+ .tab.active {
383
+ background: var(--bg-primary);
384
+ color: var(--text-primary);
385
+ }
386
+
387
+ .tab.active::after {
388
+ content: '';
389
+ position: absolute;
390
+ bottom: 0;
391
+ left: 0;
392
+ right: 0;
393
+ height: 2px;
394
+ background: var(--accent-blue);
395
+ }
396
+
397
+ .tab .close-btn {
398
+ width: 18px;
399
+ height: 18px;
400
+ display: flex;
401
+ align-items: center;
402
+ justify-content: center;
403
+ border-radius: 4px;
404
+ opacity: 0;
405
+ transition: all 0.15s;
406
+ }
407
+
408
+ .tab:hover .close-btn {
409
+ opacity: 1;
410
+ }
411
+
412
+ .tab .close-btn:hover {
413
+ background: var(--bg-hover);
414
+ }
415
+
416
+ .split-view {
417
+ display: flex;
418
+ flex: 1;
419
+ overflow: hidden;
420
+ }
421
+
422
+ .editor-pane {
423
+ flex: 1;
424
+ display: flex;
425
+ flex-direction: column;
426
+ min-width: 0;
427
+ }
428
+
429
+ .editor-pane:first-child {
430
+ border-left: 1px solid var(--border-color);
431
+ }
432
+
433
+ .editor-wrapper {
434
+ flex: 1;
435
+ display: flex;
436
+ position: relative;
437
+ overflow: hidden;
438
+ }
439
+
440
+ .editor-container {
441
+ flex: 1;
442
+ position: relative;
443
+ }
444
+
445
+ #editor {
446
+ width: 100%;
447
+ height: 100%;
448
+ font-family: 'JetBrains Mono', monospace;
449
+ font-size: 14px;
450
+ line-height: 1.6;
451
+ }
452
+
453
+ .ace_editor {
454
+ font-family: 'JetBrains Mono', monospace !important;
455
+ }
456
+
457
+ .ace_gutter {
458
+ background: var(--bg-secondary) !important;
459
+ color: var(--text-muted) !important;
460
+ }
461
+
462
+ .ace_gutter-active-line {
463
+ background: var(--bg-tertiary) !important;
464
+ }
465
+
466
+ .preview-panel {
467
+ width: 50%;
468
+ border-right: 1px solid var(--border-color);
469
+ display: flex;
470
+ flex-direction: column;
471
+ background: var(--bg-primary);
472
+ }
473
+
474
+ .preview-header {
475
+ display: flex;
476
+ align-items: center;
477
+ justify-content: space-between;
478
+ padding: 8px 16px;
479
+ background: var(--bg-secondary);
480
+ border-bottom: 1px solid var(--border-color);
481
+ min-height: 40px;
482
+ }
483
+
484
+ .preview-title {
485
+ font-size: 0.8rem;
486
+ font-weight: 600;
487
+ color: var(--text-secondary);
488
+ display: flex;
489
+ align-items: center;
490
+ gap: 8px;
491
+ }
492
+
493
+ .preview-url {
494
+ flex: 1;
495
+ margin: 0 16px;
496
+ padding: 4px 12px;
497
+ background: var(--bg-tertiary);
498
+ border: 1px solid var(--border-color);
499
+ border-radius: 4px;
500
+ color: var(--text-secondary);
501
+ font-size: 0.8rem;
502
+ font-family: 'JetBrains Mono', monospace;
503
+ direction: ltr;
504
+ text-align: left;
505
+ }
506
+
507
+ .preview-actions {
508
+ display: flex;
509
+ gap: 4px;
510
+ }
511
+
512
+ .preview-frame-container {
513
+ flex: 1;
514
+ position: relative;
515
+ background: white;
516
+ }
517
+
518
+ #preview-frame {
519
+ width: 100%;
520
+ height: 100%;
521
+ border: none;
522
+ background: white;
523
+ }
524
+
525
+ .terminal-panel {
526
+ height: var(--panel-height);
527
+ background: var(--bg-secondary);
528
+ border-top: 1px solid var(--border-color);
529
+ display: flex;
530
+ flex-direction: column;
531
+ transition: height 0.2s ease;
532
+ }
533
+
534
+ .terminal-panel.collapsed {
535
+ height: 36px;
536
+ }
537
+
538
+ .terminal-header {
539
+ display: flex;
540
+ align-items: center;
541
+ padding: 0 16px;
542
+ height: 36px;
543
+ background: var(--bg-tertiary);
544
+ border-bottom: 1px solid var(--border-color);
545
+ gap: 8px;
546
+ }
547
+
548
+ .terminal-tab {
549
+ padding: 6px 12px;
550
+ font-size: 0.8rem;
551
+ color: var(--text-secondary);
552
+ cursor: pointer;
553
+ border-radius: 4px;
554
+ transition: all 0.15s;
555
+ display: flex;
556
+ align-items: center;
557
+ gap: 6px;
558
+ }
559
+
560
+ .terminal-tab:hover {
561
+ background: var(--bg-hover);
562
+ color: var(--text-primary);
563
+ }
564
+
565
+ .terminal-tab.active {
566
+ background: var(--bg-primary);
567
+ color: var(--text-primary);
568
+ }
569
+
570
+ .terminal-actions {
571
+ margin-right: auto;
572
+ display: flex;
573
+ gap: 4px;
574
+ }
575
+
576
+ .terminal-content {
577
+ flex: 1;
578
+ overflow: hidden;
579
+ position: relative;
580
+ }
581
+
582
+ .terminal-output {
583
+ width: 100%;
584
+ height: 100%;
585
+ background: var(--bg-primary);
586
+ padding: 12px;
587
+ font-family: 'JetBrains Mono', monospace;
588
+ font-size: 13px;
589
+ line-height: 1.5;
590
+ overflow-y: auto;
591
+ direction: ltr;
592
+ text-align: left;
593
+ }
594
+
595
+ .terminal-output::-webkit-scrollbar {
596
+ width: 8px;
597
+ }
598
+
599
+ .terminal-output::-webkit-scrollbar-thumb {
600
+ background: var(--bg-hover);
601
+ border-radius: 4px;
602
+ }
603
+
604
+ .terminal-line {
605
+ margin-bottom: 4px;
606
+ }
607
+
608
+ .terminal-line.command { color: var(--accent-cyan); }
609
+ .terminal-line.output { color: var(--text-secondary); }
610
+ .terminal-line.error { color: var(--accent-red); }
611
+ .terminal-line.success { color: var(--accent-green); }
612
+ .terminal-line.info { color: var(--accent-blue); }
613
+
614
+ .terminal-input-line {
615
+ display: flex;
616
+ align-items: center;
617
+ gap: 8px;
618
+ padding: 8px 12px;
619
+ background: var(--bg-secondary);
620
+ border-top: 1px solid var(--border-color);
621
+ }
622
+
623
+ .terminal-prompt {
624
+ color: var(--accent-green);
625
+ font-family: 'JetBrains Mono', monospace;
626
+ font-size: 13px;
627
+ }
628
+
629
+ .terminal-input {
630
+ flex: 1;
631
+ background: transparent;
632
+ border: none;
633
+ color: var(--text-primary);
634
+ font-family: 'JetBrains Mono', monospace;
635
+ font-size: 13px;
636
+ outline: none;
637
+ direction: ltr;
638
+ text-align: left;
639
+ }
640
+
641
+ .status-bar {
642
+ height: 24px;
643
+ background: var(--bg-tertiary);
644
+ border-top: 1px solid var(--border-color);
645
+ display: flex;
646
+ align-items: center;
647
+ justify-content: space-between;
648
+ padding: 0 16px;
649
+ font-size: 0.75rem;
650
+ color: var(--text-secondary);
651
+ }
652
+
653
+ .status-left, .status-right {
654
+ display: flex;
655
+ align-items: center;
656
+ gap: 16px;
657
+ }
658
+
659
+ .status-item {
660
+ display: flex;
661
+ align-items: center;
662
+ gap: 6px;
663
+ }
664
+
665
+ .modal-overlay {
666
+ position: fixed;
667
+ top: 0;
668
+ left: 0;
669
+ right: 0;
670
+ bottom: 0;
671
+ background: rgba(0, 0, 0, 0.7);
672
+ display: flex;
673
+ align-items: center;
674
+ justify-content: center;
675
+ z-index: 1000;
676
+ opacity: 0;
677
+ visibility: hidden;
678
+ transition: all 0.2s;
679
+ }
680
+
681
+ .modal-overlay.active {
682
+ opacity: 1;
683
+ visibility: visible;
684
+ }
685
+
686
+ .modal {
687
+ background: var(--bg-secondary);
688
+ border: 1px solid var(--border-color);
689
+ border-radius: 12px;
690
+ width: 90%;
691
+ max-width: 480px;
692
+ transform: scale(0.95);
693
+ transition: transform 0.2s;
694
+ }
695
+
696
+ .modal-overlay.active .modal {
697
+ transform: scale(1);
698
+ }
699
+
700
+ .modal-header {
701
+ display: flex;
702
+ align-items: center;
703
+ justify-content: space-between;
704
+ padding: 16px 20px;
705
+ border-bottom: 1px solid var(--border-color);
706
+ }
707
+
708
+ .modal-title {
709
+ font-size: 1.1rem;
710
+ font-weight: 600;
711
+ }
712
+
713
+ .modal-close {
714
+ width: 32px;
715
+ height: 32px;
716
+ display: flex;
717
+ align-items: center;
718
+ justify-content: center;
719
+ background: transparent;
720
+ border: none;
721
+ border-radius: 6px;
722
+ color: var(--text-secondary);
723
+ cursor: pointer;
724
+ transition: all 0.15s;
725
+ }
726
+
727
+ .modal-close:hover {
728
+ background: var(--bg-hover);
729
+ color: var(--text-primary);
730
+ }
731
+
732
+ .modal-body {
733
+ padding: 20px;
734
+ }
735
+
736
+ .form-group {
737
+ margin-bottom: 16px;
738
+ }
739
+
740
+ .form-label {
741
+ display: block;
742
+ font-size: 0.9rem;
743
+ color: var(--text-secondary);
744
+ margin-bottom: 8px;
745
+ }
746
+
747
+ .form-input {
748
+ width: 100%;
749
+ padding: 10px 14px;
750
+ background: var(--bg-tertiary);
751
+ border: 1px solid var(--border-color);
752
+ border-radius: 6px;
753
+ color: var(--text-primary);
754
+ font-family: inherit;
755
+ font-size: 0.95rem;
756
+ outline: none;
757
+ transition: border-color 0.2s;
758
+ }
759
+
760
+ .form-input:focus {
761
+ border-color: var(--accent-blue);
762
+ }
763
+
764
+ .form-select {
765
+ width: 100%;
766
+ padding: 10px 14px;
767
+ background: var(--bg-tertiary);
768
+ border: 1px solid var(--border-color);
769
+ border-radius: 6px;
770
+ color: var(--text-primary);
771
+ font-family: inherit;
772
+ font-size: 0.95rem;
773
+ outline: none;
774
+ cursor: pointer;
775
+ }
776
+
777
+ .modal-footer {
778
+ display: flex;
779
+ justify-content: flex-end;
780
+ gap: 12px;
781
+ padding: 16px 20px;
782
+ border-top: 1px solid var(--border-color);
783
+ }
784
+
785
+ .btn {
786
+ padding: 10px 20px;
787
+ border-radius: 6px;
788
+ font-family: inherit;
789
+ font-size: 0.9rem;
790
+ font-weight: 500;
791
+ cursor: pointer;
792
+ transition: all 0.2s;
793
+ }
794
+
795
+ .btn-secondary {
796
+ background: var(--bg-tertiary);
797
+ border: 1px solid var(--border-color);
798
+ color: var(--text-primary);
799
+ }
800
+
801
+ .btn-secondary:hover {
802
+ background: var(--bg-hover);
803
+ }
804
+
805
+ .btn-primary {
806
+ background: var(--accent-blue);
807
+ border: none;
808
+ color: white;
809
+ }
810
+
811
+ .btn-primary:hover {
812
+ background: #4393e6;
813
+ }
814
+
815
+ .context-menu {
816
+ position: fixed;
817
+ background: var(--bg-secondary);
818
+ border: 1px solid var(--border-color);
819
+ border-radius: 8px;
820
+ padding: 6px 0;
821
+ min-width: 180px;
822
+ z-index: 1001;
823
+ opacity: 0;
824
+ visibility: hidden;
825
+ transform: scale(0.95);
826
+ transition: all 0.15s;
827
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
828
+ }
829
+
830
+ .context-menu.active {
831
+ opacity: 1;
832
+ visibility: visible;
833
+ transform: scale(1);
834
+ }
835
+
836
+ .context-menu-item {
837
+ display: flex;
838
+ align-items: center;
839
+ gap: 12px;
840
+ padding: 8px 16px;
841
+ font-size: 0.9rem;
842
+ color: var(--text-primary);
843
+ cursor: pointer;
844
+ transition: all 0.15s;
845
+ }
846
+
847
+ .context-menu-item:hover {
848
+ background: var(--bg-tertiary);
849
+ }
850
+
851
+ .context-menu-item i {
852
+ width: 16px;
853
+ color: var(--text-secondary);
854
+ }
855
+
856
+ .context-menu-divider {
857
+ height: 1px;
858
+ background: var(--border-color);
859
+ margin: 6px 0;
860
+ }
861
+
862
+ .toast-container {
863
+ position: fixed;
864
+ bottom: 20px;
865
+ left: 20px;
866
+ z-index: 1002;
867
+ display: flex;
868
+ flex-direction: column;
869
+ gap: 8px;
870
+ }
871
+
872
+ .toast {
873
+ display: flex;
874
+ align-items: center;
875
+ gap: 12px;
876
+ padding: 12px 16px;
877
+ background: var(--bg-secondary);
878
+ border: 1px solid var(--border-color);
879
+ border-radius: 8px;
880
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
881
+ animation: slideIn 0.3s ease;
882
+ }
883
+
884
+ @keyframes slideIn {
885
+ from {
886
+ opacity: 0;
887
+ transform: translateX(-20px);
888
+ }
889
+ to {
890
+ opacity: 1;
891
+ transform: translateX(0);
892
+ }
893
+ }
894
+
895
+ .toast.success { border-color: var(--accent-green); }
896
+ .toast.error { border-color: var(--accent-red); }
897
+ .toast.info { border-color: var(--accent-blue); }
898
+
899
+ .toast-icon { font-size: 1.1rem; }
900
+ .toast.success .toast-icon { color: var(--accent-green); }
901
+ .toast.error .toast-icon { color: var(--accent-red); }
902
+ .toast.info .toast-icon { color: var(--accent-blue); }
903
+
904
+ .console-panel, .problems-panel {
905
+ display: none;
906
+ height: 100%;
907
+ overflow: auto;
908
+ background: var(--bg-primary);
909
+ padding: 12px;
910
+ font-family: 'JetBrains Mono', monospace;
911
+ font-size: 13px;
912
+ }
913
+
914
+ .console-panel.active, .problems-panel.active {
915
+ display: block;
916
+ }
917
+
918
+ @media (max-width: 1024px) {
919
+ .sidebar {
920
+ position: fixed;
921
+ right: 0;
922
+ top: var(--header-height);
923
+ bottom: 0;
924
+ z-index: 50;
925
+ transform: translateX(100%);
926
+ transition: transform 0.3s ease;
927
+ }
928
+
929
+ .sidebar.open {
930
+ transform: translateX(0);
931
+ }
932
+
933
+ .preview-panel {
934
+ width: 100%;
935
+ }
936
+
937
+ .split-view {
938
+ flex-direction: column;
939
+ }
940
+ }
941
+
942
+ @media (max-width: 768px) {
943
+ .header-center { display: none; }
944
+ .project-name { display: none; }
945
+ }
946
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
947
  </head>
948
+
949
  <body>
950
+ <header class="header">
951
+ <div class="header-right">
952
+ <div class="logo">
953
+ <div class="logo-icon">
954
+ <i class="fas fa-code"></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
955
  </div>
956
+ <span>CodeSpace</span>
957
+ </div>
958
+ <div class="project-name">
959
+ <i class="fas fa-folder"></i>
960
+ <input type="text" id="project-name" value="مشروعي الأول" spellcheck="false">
961
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
  </div>
963
+ <div class="header-center">
964
+ <button class="run-btn" id="run-btn" onclick="runCode()">
965
+ <i class="fas fa-play"></i>
966
+ <span>تشغيل</span>
967
+ </button>
968
+ </div>
969
+ <div class="header-left">
970
+ <button class="header-btn" onclick="toggleSidebar()" title="إظهار/إخفاء الشريط الجانبي">
971
+ <i class="fas fa-bars"></i>
972
+ </button>
973
+ <button class="header-btn" onclick="downloadProject()" title="تحميل">
974
+ <i class="fas fa-download"></i>
975
+ </button>
976
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="credit-link">
977
+ Built with anycoder
978
+ </a>
979
+ </div>
980
+ </header>
981
+
982
+ <div class="main-container">
983
+ <aside class="sidebar" id="sidebar">
984
+ <div class="sidebar-header">
985
+ <span class="sidebar-title">الملفات</span>
986
+ <div class="sidebar-actions">
987
+ <button class="sidebar-btn" onclick="showNewFileModal()" title="ملف جديد">
988
+ <i class="fas fa-file-plus"></i>
989
+ </button>
990
  </div>
991
+ </div>
992
+ <div class="file-tree" id="file-tree"></div>
993
+ </aside>
994
+
995
+ <main class="editor-area">
996
+ <div class="tabs-container" id="tabs-container"></div>
997
+
998
+ <div class="split-view">
999
+ <div class="editor-pane">
1000
+ <div class="editor-wrapper">
1001
+ <div class="editor-container" id="editor-container">
1002
+ <div id="editor"></div>
1003
  </div>
1004
+ </div>
1005
  </div>
 
1006
 
1007
+ <div class="editor-pane preview-panel" id="preview-panel">
1008
+ <div class="preview-header">
1009
+ <span class="preview-title">
1010
+ <i class="fas fa-eye"></i>
1011
+ معاينة مباشرة
1012
+ </span>
1013
+ <input type="text" class="preview-url" id="preview-url" value="localhost:3000" readonly>
1014
+ <div class="preview-actions">
1015
+ <button class="header-btn" onclick="refreshPreview()" title="تحديث">
1016
+ <i class="fas fa-sync-alt"></i>
1017
+ </button>
1018
+ <button class="header-btn" onclick="openPreviewInNewTab()" title="فتح في نافذة جديدة">
1019
+ <i class="fas fa-external-link-alt"></i>
1020
+ </button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1021
  </div>
1022
+ </div>
1023
+ <div class="preview-frame-container">
1024
+ <iframe id="preview-frame" sandbox="allow-scripts allow-same-origin"></iframe>
1025
+ </div>
1026
  </div>
1027
+ </div>
1028
+
1029
+ <div class="terminal-panel" id="terminal-panel">
1030
+ <div class="terminal-header">
1031
+ <div class="terminal-tab active" onclick="switchTerminalTab('terminal')">
1032
+ <i class="fas fa-terminal"></i>
1033
+ الطرفية
1034
+ </div>
1035
+ <div class="terminal-tab" onclick="switchTerminalTab('console')">
1036
+ <i class="fas fa-bug"></i>
1037
+ الكونسول
1038
+ </div>
1039
+ <div class="terminal-actions">
1040
+ <button class="sidebar-btn" onclick="clearTerminal()" title="مسح">
1041
+ <i class="fas fa-trash"></i>
1042
+ </button>
1043
+ <button class="sidebar-btn" onclick="toggleTerminal()" title="تصغير/تكبير">
1044
+ <i class="fas fa-chevron-down"></i>
1045
+ </button>
1046
+ </div>
1047
  </div>
1048
+ <div class="terminal-content">
1049
+ <div class="terminal-output" id="terminal-output">
1050
+ <div class="terminal-line info">مرحباً بك في CodeSpace! اضغط على زر "تشغيل" لتنفيذ الكود.</div>
1051
+ </div>
1052
+ <div class="console-panel" id="console-panel"></div>
1053
+ <div class="problems-panel" id="problems-panel"></div>
1054
+ <div class="terminal-input-line">
1055
+ <span class="terminal-prompt">$</span>
1056
+ <input type="text" class="terminal-input" id="terminal-input" placeholder="أدخل الأمر...">
1057
+ </div>
1058
  </div>
1059
+ </div>
1060
+ </main>
1061
+ </div>
1062
+
1063
+ <div class="status-bar">
1064
+ <div class="status-left">
1065
+ <div class="status-item">
1066
+ <i class="fas fa-code-branch"></i>
1067
+ <span>main</span>
1068
+ </div>
1069
+ <div class="status-item" id="status-sync">
1070
+ <i class="fas fa-check-circle"></i>
1071
+ <span>جاهز</span>
1072
+ </div>
1073
+ </div>
1074
+ <div class="status-right">
1075
+ <div class="status-item" id="status-language">
1076
+ <span>HTML</span>
1077
+ </div>
1078
+ <div class="status-item" id="status-position">
1079
+ <span>سطر 1، عمود 1</span>
1080
+ </div>
1081
+ </div>
1082
+ </div>
1083
+
1084
+ <div class="modal-overlay" id="new-file-modal">
1085
+ <div class="modal">
1086
+ <div class="modal-header">
1087
+ <h3 class="modal-title">ملف جديد</h3>
1088
+ <button class="modal-close" onclick="closeModal('new-file-modal')">
1089
+ <i class="fas fa-times"></i>
1090
+ </button>
1091
+ </div>
1092
+ <div class="modal-body">
1093
+ <div class="form-group">
1094
+ <label class="form-label">اسم الملف</label>
1095
+ <input type="text" class="form-input" id="new-file-name" placeholder="script.js">
1096
  </div>
1097
+ <div class="form-group">
1098
+ <label class="form-label">نوع الملف</label>
1099
+ <select class="form-select" id="new-file-type">
1100
+ <option value="javascript">JavaScript (.js)</option>
1101
+ <option value="html">HTML (.html)</option>
1102
+ <option value="css">CSS (.css)</option>
1103
+ <option value="python">Python (.py)</option>
1104
+ <option value="json">JSON (.json)</option>
1105
+ </select>
1106
+ </div>
1107
+ </div>
1108
+ <div class="modal-footer">
1109
+ <button class="btn btn-secondary" onclick="closeModal('new-file-modal')">إلغاء</button>
1110
+ <button class="btn btn-primary" onclick="createNewFile()">إنشاء</button>
1111
+ </div>
1112
  </div>
1113
+ </div>
1114
 
1115
+ <div class="context-menu" id="context-menu">
1116
+ <div class="context-menu-item" onclick="renameFile()">
1117
+ <i class="fas fa-edit"></i>
1118
+ <span>إعادة تسمية</span>
1119
+ </div>
1120
+ <div class="context-menu-item" onclick="deleteFile()">
1121
+ <i class="fas fa-trash"></i>
1122
+ <span>حذف</span>
1123
+ </div>
1124
+ </div>
1125
+
1126
+ <div class="toast-container" id="toast-container"></div>
1127
+
1128
+ <script>
1129
+ let editor = null;
1130
+ let currentFile = null;
1131
+ let openTabs = [];
1132
+ let fileSystem = {};
1133
+ let selectedContextItem = null;
1134
+
1135
+ const defaultFiles = {
1136
+ 'index.html': {
1137
+ name: 'index.html',
1138
+ type: 'html',
1139
+ content: `<!DOCTYPE html>
1140
  <html lang="ar" dir="rtl">
1141
  <head>
1142
  <meta charset="UTF-8">
1143
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
1144
+ <title>تطبيقي الأول</title>
1145
+ <link rel="stylesheet" href="style.css">
1146
+ </head>
1147
+ <body>
1148
+ <div class="container">
1149
+ <h1>مرحباً بالعالم!</h1>
1150
+ <p>هذا تطبيقي الأول باستخدام CodeSpace</p>
1151
+ <button id="clickMe">اضغط هنا!</button>
1152
+ <div id="output"></div>
1153
+ </div>
1154
+ <script src="script.js"><\/script>
1155
+ </body>
1156
+ </html>