arthu1 commited on
Commit
2c39fa0
·
verified ·
1 Parent(s): 9de3ffa

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +733 -19
index.html CHANGED
@@ -1,19 +1,733 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>AI-Powered Browser IDE</title>
7
+
8
+ <!-- Monaco Editor -->
9
+ <link rel="stylesheet" data-name="vs/editor/editor.main" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/editor/editor.main.css">
10
+
11
+ <!-- xterm.js -->
12
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.css">
13
+
14
+ <!-- Font Awesome for icons -->
15
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
16
+
17
+ <style>
18
+ * {
19
+ margin: 0;
20
+ padding: 0;
21
+ box-sizing: border-box;
22
+ }
23
+
24
+ :root {
25
+ --primary: #6366f1;
26
+ --primary-dark: #4f46e5;
27
+ --secondary: #8b5cf6;
28
+ --success: #10b981;
29
+ --warning: #f59e0b;
30
+ --danger: #ef4444;
31
+ --dark: #1f2937;
32
+ --darker: #111827;
33
+ --light: #f3f4f6;
34
+ --lighter: #f9fafb;
35
+ --border: #e5e7eb;
36
+ --text-primary: #111827;
37
+ --text-secondary: #6b7280;
38
+ --sidebar-width: 250px;
39
+ --terminal-height: 200px;
40
+ --header-height: 48px;
41
+ }
42
+
43
+ body {
44
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
45
+ background: var(--lighter);
46
+ color: var(--text-primary);
47
+ height: 100vh;
48
+ overflow: hidden;
49
+ }
50
+
51
+ /* Layout */
52
+ .ide-container {
53
+ display: grid;
54
+ grid-template-rows: var(--header-height) 1fr var(--terminal-height);
55
+ height: 100vh;
56
+ }
57
+
58
+ /* Header */
59
+ .header {
60
+ background: var(--darker);
61
+ color: white;
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: space-between;
65
+ padding: 0 1rem;
66
+ border-bottom: 1px solid var(--border);
67
+ z-index: 100;
68
+ }
69
+
70
+ .header-left {
71
+ display: flex;
72
+ align-items: center;
73
+ gap: 1rem;
74
+ }
75
+
76
+ .logo {
77
+ display: flex;
78
+ align-items: center;
79
+ gap: 0.5rem;
80
+ font-weight: 600;
81
+ font-size: 1.1rem;
82
+ }
83
+
84
+ .logo i {
85
+ color: var(--primary);
86
+ }
87
+
88
+ .header-actions {
89
+ display: flex;
90
+ gap: 0.5rem;
91
+ }
92
+
93
+ /* Main Content Area */
94
+ .main-content {
95
+ display: grid;
96
+ grid-template-columns: var(--sidebar-width) 1fr 350px;
97
+ overflow: hidden;
98
+ }
99
+
100
+ /* Sidebar */
101
+ .sidebar {
102
+ background: var(--dark);
103
+ color: white;
104
+ display: flex;
105
+ flex-direction: column;
106
+ border-right: 1px solid var(--border);
107
+ }
108
+
109
+ .sidebar-header {
110
+ padding: 1rem;
111
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
112
+ display: flex;
113
+ justify-content: space-between;
114
+ align-items: center;
115
+ }
116
+
117
+ .file-tree {
118
+ flex: 1;
119
+ overflow-y: auto;
120
+ padding: 0.5rem;
121
+ }
122
+
123
+ .file-item {
124
+ display: flex;
125
+ align-items: center;
126
+ padding: 0.5rem;
127
+ cursor: pointer;
128
+ border-radius: 4px;
129
+ transition: background 0.2s;
130
+ }
131
+
132
+ .file-item:hover {
133
+ background: rgba(255, 255, 255, 0.1);
134
+ }
135
+
136
+ .file-item.active {
137
+ background: var(--primary);
138
+ }
139
+
140
+ .file-icon {
141
+ margin-right: 0.5rem;
142
+ width: 16px;
143
+ text-align: center;
144
+ }
145
+
146
+ .file-name {
147
+ flex: 1;
148
+ font-size: 0.9rem;
149
+ }
150
+
151
+ .file-actions {
152
+ display: none;
153
+ gap: 0.25rem;
154
+ }
155
+
156
+ .file-item:hover .file-actions {
157
+ display: flex;
158
+ }
159
+
160
+ /* Editor Area */
161
+ .editor-area {
162
+ display: flex;
163
+ flex-direction: column;
164
+ background: white;
165
+ }
166
+
167
+ .editor-tabs {
168
+ background: var(--light);
169
+ display: flex;
170
+ border-bottom: 1px solid var(--border);
171
+ overflow-x: auto;
172
+ }
173
+
174
+ .tab {
175
+ display: flex;
176
+ align-items: center;
177
+ padding: 0.75rem 1rem;
178
+ background: white;
179
+ border-right: 1px solid var(--border);
180
+ cursor: pointer;
181
+ gap: 0.5rem;
182
+ min-width: 150px;
183
+ }
184
+
185
+ .tab.active {
186
+ background: white;
187
+ border-bottom: 2px solid var(--primary);
188
+ }
189
+
190
+ .tab-close {
191
+ margin-left: 0.5rem;
192
+ opacity: 0;
193
+ transition: opacity 0.2s;
194
+ }
195
+
196
+ .tab:hover .tab-close {
197
+ opacity: 1;
198
+ }
199
+
200
+ .editor-container {
201
+ flex: 1;
202
+ position: relative;
203
+ }
204
+
205
+ /* AI Assistant Panel */
206
+ .ai-panel {
207
+ background: white;
208
+ border-left: 1px solid var(--border);
209
+ display: flex;
210
+ flex-direction: column;
211
+ }
212
+
213
+ .ai-header {
214
+ padding: 1rem;
215
+ border-bottom: 1px solid var(--border);
216
+ display: flex;
217
+ align-items: center;
218
+ gap: 0.5rem;
219
+ font-weight: 600;
220
+ }
221
+
222
+ .ai-status {
223
+ display: flex;
224
+ align-items: center;
225
+ gap: 0.5rem;
226
+ font-size: 0.85rem;
227
+ color: var(--text-secondary);
228
+ }
229
+
230
+ .status-dot {
231
+ width: 8px;
232
+ height: 8px;
233
+ border-radius: 50%;
234
+ background: var(--success);
235
+ animation: pulse 2s infinite;
236
+ }
237
+
238
+ @keyframes pulse {
239
+ 0%, 100% { opacity: 1; }
240
+ 50% { opacity: 0.5; }
241
+ }
242
+
243
+ .chat-messages {
244
+ flex: 1;
245
+ overflow-y: auto;
246
+ padding: 1rem;
247
+ display: flex;
248
+ flex-direction: column;
249
+ gap: 1rem;
250
+ }
251
+
252
+ .message {
253
+ max-width: 90%;
254
+ padding: 0.75rem;
255
+ border-radius: 8px;
256
+ animation: fadeIn 0.3s;
257
+ }
258
+
259
+ @keyframes fadeIn {
260
+ from { opacity: 0; transform: translateY(10px); }
261
+ to { opacity: 1; transform: translateY(0); }
262
+ }
263
+
264
+ .message.user {
265
+ background: var(--primary);
266
+ color: white;
267
+ align-self: flex-end;
268
+ }
269
+
270
+ .message.ai {
271
+ background: var(--light);
272
+ align-self: flex-start;
273
+ }
274
+
275
+ .message-content {
276
+ margin-bottom: 0.5rem;
277
+ }
278
+
279
+ .message-actions {
280
+ display: flex;
281
+ gap: 0.5rem;
282
+ margin-top: 0.5rem;
283
+ }
284
+
285
+ .chat-input {
286
+ padding: 1rem;
287
+ border-top: 1px solid var(--border);
288
+ }
289
+
290
+ .chat-input-container {
291
+ display: flex;
292
+ gap: 0.5rem;
293
+ }
294
+
295
+ /* Terminal */
296
+ .terminal {
297
+ background: var(--darker);
298
+ border-top: 1px solid var(--border);
299
+ display: flex;
300
+ flex-direction: column;
301
+ }
302
+
303
+ .terminal-header {
304
+ background: var(--dark);
305
+ padding: 0.5rem 1rem;
306
+ display: flex;
307
+ align-items: center;
308
+ gap: 0.5rem;
309
+ color: white;
310
+ font-size: 0.85rem;
311
+ }
312
+
313
+ .terminal-body {
314
+ flex: 1;
315
+ padding: 0.5rem;
316
+ }
317
+
318
+ /* Preview */
319
+ .preview-container {
320
+ position: absolute;
321
+ top: 48px;
322
+ right: 0;
323
+ width: 400px;
324
+ height: 300px;
325
+ background: white;
326
+ border: 1px solid var(--border);
327
+ border-radius: 8px;
328
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
329
+ display: none;
330
+ flex-direction: column;
331
+ z-index: 50;
332
+ animation: slideIn 0.3s;
333
+ }
334
+
335
+ @keyframes slideIn {
336
+ from { transform: translateX(100%); }
337
+ to { transform: translateX(0); }
338
+ }
339
+
340
+ .preview-container.active {
341
+ display: flex;
342
+ }
343
+
344
+ .preview-header {
345
+ padding: 0.75rem;
346
+ border-bottom: 1px solid var(--border);
347
+ display: flex;
348
+ justify-content: space-between;
349
+ align-items: center;
350
+ font-weight: 600;
351
+ }
352
+
353
+ .preview-frame {
354
+ flex: 1;
355
+ border: none;
356
+ }
357
+
358
+ /* Buttons */
359
+ .btn {
360
+ padding: 0.5rem 1rem;
361
+ border: none;
362
+ border-radius: 4px;
363
+ cursor: pointer;
364
+ font-size: 0.9rem;
365
+ transition: all 0.2s;
366
+ display: inline-flex;
367
+ align-items: center;
368
+ gap: 0.5rem;
369
+ }
370
+
371
+ .btn-primary {
372
+ background: var(--primary);
373
+ color: white;
374
+ }
375
+
376
+ .btn-primary:hover {
377
+ background: var(--primary-dark);
378
+ }
379
+
380
+ .btn-secondary {
381
+ background: var(--light);
382
+ color: var(--text-primary);
383
+ }
384
+
385
+ .btn-secondary:hover {
386
+ background: var(--border);
387
+ }
388
+
389
+ .btn-icon {
390
+ padding: 0.5rem;
391
+ background: transparent;
392
+ color: var(--text-secondary);
393
+ }
394
+
395
+ .btn-icon:hover {
396
+ background: var(--light);
397
+ color: var(--text-primary);
398
+ }
399
+
400
+ /* Input */
401
+ .input {
402
+ flex: 1;
403
+ padding: 0.5rem 0.75rem;
404
+ border: 1px solid var(--border);
405
+ border-radius: 4px;
406
+ font-size: 0.9rem;
407
+ }
408
+
409
+ .input:focus {
410
+ outline: none;
411
+ border-color: var(--primary);
412
+ box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
413
+ }
414
+
415
+ /* Modal */
416
+ .modal {
417
+ position: fixed;
418
+ top: 0;
419
+ left: 0;
420
+ right: 0;
421
+ bottom: 0;
422
+ background: rgba(0, 0, 0, 0.5);
423
+ display: none;
424
+ align-items: center;
425
+ justify-content: center;
426
+ z-index: 1000;
427
+ }
428
+
429
+ .modal.active {
430
+ display: flex;
431
+ }
432
+
433
+ .modal-content {
434
+ background: white;
435
+ padding: 2rem;
436
+ border-radius: 8px;
437
+ width: 90%;
438
+ max-width: 500px;
439
+ animation: modalFadeIn 0.3s;
440
+ }
441
+
442
+ @keyframes modalFadeIn {
443
+ from { opacity: 0; transform: scale(0.95); }
444
+ to { opacity: 1; transform: scale(1); }
445
+ }
446
+
447
+ .modal-header {
448
+ font-size: 1.25rem;
449
+ font-weight: 600;
450
+ margin-bottom: 1rem;
451
+ }
452
+
453
+ .modal-body {
454
+ margin-bottom: 1.5rem;
455
+ }
456
+
457
+ .modal-footer {
458
+ display: flex;
459
+ justify-content: flex-end;
460
+ gap: 0.5rem;
461
+ }
462
+
463
+ /* Loading */
464
+ .loading {
465
+ display: inline-block;
466
+ width: 16px;
467
+ height: 16px;
468
+ border: 2px solid var(--border);
469
+ border-top-color: var(--primary);
470
+ border-radius: 50%;
471
+ animation: spin 0.8s linear infinite;
472
+ }
473
+
474
+ @keyframes spin {
475
+ to { transform: rotate(360deg); }
476
+ }
477
+
478
+ /* Responsive */
479
+ @media (max-width: 1024px) {
480
+ .ai-panel {
481
+ display: none;
482
+ }
483
+
484
+ .main-content {
485
+ grid-template-columns: var(--sidebar-width) 1fr;
486
+ }
487
+ }
488
+
489
+ @media (max-width: 768px) {
490
+ .sidebar {
491
+ position: absolute;
492
+ left: -250px;
493
+ transition: left 0.3s;
494
+ z-index: 200;
495
+ }
496
+
497
+ .sidebar.open {
498
+ left: 0;
499
+ }
500
+
501
+ .main-content {
502
+ grid-template-columns: 1fr;
503
+ }
504
+ }
505
+
506
+ /* Context Menu */
507
+ .context-menu {
508
+ position: fixed;
509
+ background: white;
510
+ border: 1px solid var(--border);
511
+ border-radius: 4px;
512
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
513
+ padding: 0.5rem 0;
514
+ display: none;
515
+ z-index: 1000;
516
+ }
517
+
518
+ .context-menu.active {
519
+ display: block;
520
+ }
521
+
522
+ .context-menu-item {
523
+ padding: 0.5rem 1rem;
524
+ cursor: pointer;
525
+ display: flex;
526
+ align-items: center;
527
+ gap: 0.75rem;
528
+ font-size: 0.9rem;
529
+ }
530
+
531
+ .context-menu-item:hover {
532
+ background: var(--light);
533
+ }
534
+ </style>
535
+ </head>
536
+ <body>
537
+ <div class="ide-container">
538
+ <!-- Header -->
539
+ <header class="header">
540
+ <div class="header-left">
541
+ <div class="logo">
542
+ <i class="fas fa-code"></i>
543
+ <span>AI IDE</span>
544
+ </div>
545
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" style="color: white; text-decoration: none; font-size: 0.85rem;">
546
+ Built with anycoder
547
+ </a>
548
+ </div>
549
+ <div class="header-actions">
550
+ <button class="btn btn-icon" onclick="runProject()" title="Run Project">
551
+ <i class="fas fa-play"></i>
552
+ </button>
553
+ <button class="btn btn-icon" onclick="showPreview()" title="Preview">
554
+ <i class="fas fa-eye"></i>
555
+ </button>
556
+ <button class="btn btn-icon" onclick="toggleSidebar()" title="Toggle Sidebar">
557
+ <i class="fas fa-bars"></i>
558
+ </button>
559
+ </div>
560
+ </header>
561
+
562
+ <!-- Main Content -->
563
+ <div class="main-content">
564
+ <!-- Sidebar -->
565
+ <aside class="sidebar" id="sidebar">
566
+ <div class="sidebar-header">
567
+ <span>Explorer</span>
568
+ <button class="btn btn-icon" onclick="createFile()" style="color: white;">
569
+ <i class="fas fa-plus"></i>
570
+ </button>
571
+ </div>
572
+ <div class="file-tree" id="fileTree"></div>
573
+ </aside>
574
+
575
+ <!-- Editor Area -->
576
+ <main class="editor-area">
577
+ <div class="editor-tabs" id="editorTabs"></div>
578
+ <div class="editor-container" id="editorContainer"></div>
579
+ </main>
580
+
581
+ <!-- AI Assistant Panel -->
582
+ <aside class="ai-panel">
583
+ <div class="ai-header">
584
+ <i class="fas fa-robot"></i>
585
+ <span>AI Assistant</span>
586
+ </div>
587
+ <div class="ai-status">
588
+ <span class="status-dot"></span>
589
+ <span>Ready</span>
590
+ </div>
591
+ <div class="chat-messages" id="chatMessages"></div>
592
+ <div class="chat-input">
593
+ <div class="chat-input-container">
594
+ <input type="text" class="input" placeholder="Ask AI to help with code..." id="chatInput" onkeypress="handleChatInput(event)">
595
+ <button class="btn btn-primary" onclick="sendChatMessage()">
596
+ <i class="fas fa-paper-plane"></i>
597
+ </button>
598
+ </div>
599
+ </div>
600
+ </aside>
601
+ </div>
602
+
603
+ <!-- Terminal -->
604
+ <div class="terminal">
605
+ <div class="terminal-header">
606
+ <i class="fas fa-terminal"></i>
607
+ <span>Terminal</span>
608
+ <button class="btn btn-icon" onclick="clearTerminal()" style="color: white; margin-left: auto;">
609
+ <i class="fas fa-trash"></i>
610
+ </button>
611
+ </div>
612
+ <div class="terminal-body" id="terminal"></div>
613
+ </div>
614
+ </div>
615
+
616
+ <!-- Preview Window -->
617
+ <div class="preview-container" id="previewContainer">
618
+ <div class="preview-header">
619
+ <span>Preview</span>
620
+ <button class="btn btn-icon" onclick="hidePreview()">
621
+ <i class="fas fa-times"></i>
622
+ </button>
623
+ </div>
624
+ <iframe class="preview-frame" id="previewFrame"></iframe>
625
+ </div>
626
+
627
+ <!-- Modal -->
628
+ <div class="modal" id="modal">
629
+ <div class="modal-content">
630
+ <div class="modal-header" id="modalHeader"></div>
631
+ <div class="modal-body" id="modalBody"></div>
632
+ <div class="modal-footer" id="modalFooter"></div>
633
+ </div>
634
+ </div>
635
+
636
+ <!-- Context Menu -->
637
+ <div class="context-menu" id="contextMenu">
638
+ <div class="context-menu-item" onclick="renameFile()">
639
+ <i class="fas fa-edit"></i>
640
+ <span>Rename</span>
641
+ </div>
642
+ <div class="context-menu-item" onclick="deleteFile()">
643
+ <i class="fas fa-trash"></i>
644
+ <span>Delete</span>
645
+ </div>
646
+ <div class="context-menu-item" onclick="duplicateFile()">
647
+ <i class="fas fa-copy"></i>
648
+ <span>Duplicate</span>
649
+ </div>
650
+ </div>
651
+
652
+ <!-- Scripts -->
653
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs/loader.js"></script>
654
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/xterm/5.3.0/xterm.min.js"></script>
655
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/xterm-addon-fit/0.8.0/xterm-addon-fit.min.js"></script>
656
+
657
+ <script>
658
+ // Global state
659
+ let fileSystem = {};
660
+ let openTabs = [];
661
+ let activeTab = null;
662
+ let editors = {};
663
+ let terminal = null;
664
+ let contextFile = null;
665
+
666
+ // Initialize Monaco Editor
667
+ require.config({ paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.44.0/min/vs' } });
668
+ require(['vs/editor/editor.main'], function() {
669
+ // Set up default files
670
+ initializeFileSystem();
671
+ renderFileTree();
672
+
673
+ // Initialize terminal
674
+ initializeTerminal();
675
+
676
+ // Open default file
677
+ openFile('index.html');
678
+
679
+ // Add AI welcome message
680
+ addAIMessage("Hello! I'm your AI coding assistant. I can help you write, debug, and optimize your code. Just ask me anything!");
681
+ });
682
+
683
+ // File System Management
684
+ function initializeFileSystem() {
685
+ const defaultFiles = {
686
+ 'index.html': `<!DOCTYPE html>
687
+ <html lang="en">
688
+ <head>
689
+ <meta charset="UTF-8">
690
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
691
+ <title>My App</title>
692
+ <style>
693
+ body {
694
+ font-family: Arial, sans-serif;
695
+ margin: 0;
696
+ padding: 20px;
697
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
698
+ color: white;
699
+ }
700
+ .container {
701
+ max-width: 800px;
702
+ margin: 0 auto;
703
+ text-align: center;
704
+ }
705
+ h1 {
706
+ font-size: 2.5rem;
707
+ margin-bottom: 1rem;
708
+ }
709
+ .card {
710
+ background: rgba(255, 255, 255, 0.1);
711
+ padding: 2rem;
712
+ border-radius: 10px;
713
+ backdrop-filter: blur(10px);
714
+ margin-top: 2rem;
715
+ }
716
+ </style>
717
+ </head>
718
+ <body>
719
+ <div class="container">
720
+ <h1>Welcome to AI IDE</h1>
721
+ <p>Your web development environment with AI assistance</p>
722
+ <div class="card">
723
+ <h2>Features</h2>
724
+ <ul style="text-align: left; display: inline-block;">
725
+ <li>🚀 Live preview</li>
726
+ <li>🤖 AI coding assistant</li>
727
+ <li>💻 Terminal access</li>
728
+ <li>📁 File management</li>
729
+ </ul>
730
+ </div>
731
+ </div>
732
+ </body>
733
+ </html>