developerbayman commited on
Commit
342be81
·
verified ·
1 Parent(s): 680bf17

undefined - Initial Deployment

Browse files
Files changed (2) hide show
  1. README.md +7 -7
  2. index.html +507 -19
README.md CHANGED
@@ -1,12 +1,12 @@
1
  ---
2
- title: >-
3
- Neat Python Ide Im Making Thought It Was Gonna Help Me With Python And Did
4
- This In Html
5
- emoji: 📊
6
- colorFrom: yellow
7
- colorTo: green
8
  sdk: static
9
  pinned: false
 
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: neat-python-ide-im-making-thought-it-was-gonna-help-me-with-python-and-did-this-in-html
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: pink
 
 
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,507 @@
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>Python IDE with Ollama</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ .code-editor {
11
+ font-family: 'Courier New', monospace;
12
+ font-size: 14px;
13
+ line-height: 1.5;
14
+ tab-size: 4;
15
+ }
16
+
17
+ .dark .code-editor {
18
+ background-color: #1e1e1e;
19
+ color: #d4d4d4;
20
+ }
21
+
22
+ .light .code-editor {
23
+ background-color: #ffffff;
24
+ color: #333333;
25
+ }
26
+
27
+ .chat-message {
28
+ max-width: 80%;
29
+ word-wrap: break-word;
30
+ }
31
+
32
+ .resize-handle {
33
+ width: 4px;
34
+ background-color: rgba(156, 163, 175, 0.3);
35
+ cursor: col-resize;
36
+ transition: background-color 0.2s;
37
+ }
38
+
39
+ .resize-handle:hover {
40
+ background-color: rgba(156, 163, 175, 0.6);
41
+ }
42
+
43
+ .tab-active {
44
+ border-bottom: 2px solid;
45
+ }
46
+
47
+ .dark .tab-active {
48
+ border-color: #3b82f6;
49
+ }
50
+
51
+ .light .tab-active {
52
+ border-color: #2563eb;
53
+ }
54
+ </style>
55
+ </head>
56
+ <body class="h-screen flex flex-col dark:bg-gray-900">
57
+ <!-- Top Navigation -->
58
+ <nav class="bg-blue-600 text-white p-2 shadow-md">
59
+ <div class="container mx-auto flex justify-between items-center">
60
+ <div class="flex items-center space-x-4">
61
+ <h1 class="text-xl font-bold">Python IDE with Ollama</h1>
62
+ <div class="hidden md:flex space-x-2">
63
+ <button class="px-3 py-1 rounded hover:bg-blue-700">File</button>
64
+ <button class="px-3 py-1 rounded hover:bg-blue-700">Edit</button>
65
+ <button class="px-3 py-1 rounded hover:bg-blue-700">View</button>
66
+ <button class="px-3 py-1 rounded hover:bg-blue-700">Run</button>
67
+ <button class="px-3 py-1 rounded hover:bg-blue-700">Tools</button>
68
+ </div>
69
+ </div>
70
+ <div class="flex items-center space-x-4">
71
+ <button id="theme-toggle" class="p-1 rounded-full hover:bg-blue-700">
72
+ <i class="fas fa-moon"></i>
73
+ </button>
74
+ <button class="px-3 py-1 bg-blue-700 rounded hover:bg-blue-800">
75
+ <i class="fas fa-question-circle"></i> Help
76
+ </button>
77
+ </div>
78
+ </div>
79
+ </nav>
80
+
81
+ <!-- Main Content Area -->
82
+ <div class="flex flex-1 overflow-hidden">
83
+ <!-- Editor Area -->
84
+ <div class="flex-1 flex flex-col overflow-hidden">
85
+ <!-- Tabs -->
86
+ <div class="bg-gray-800 dark:bg-gray-800 flex items-center border-b border-gray-700">
87
+ <div class="flex overflow-x-auto" id="editor-tabs">
88
+ <div class="tab flex items-center px-4 py-2 text-white border-b-2 border-blue-500 tab-active">
89
+ <span>main.py</span>
90
+ <button class="ml-2 text-gray-400 hover:text-white">
91
+ <i class="fas fa-times"></i>
92
+ </button>
93
+ </div>
94
+ <button class="px-3 py-2 text-gray-400 hover:text-white">
95
+ <i class="fas fa-plus"></i>
96
+ </button>
97
+ </div>
98
+ </div>
99
+
100
+ <!-- Code Editor -->
101
+ <div class="flex-1 overflow-auto">
102
+ <textarea id="code-editor" class="code-editor w-full h-full p-4 resize-none outline-none dark:bg-gray-800 dark:text-gray-200" spellcheck="false"># Welcome to Python IDE with Ollama integration
103
+
104
+ def hello_world():
105
+ print("Hello, World!")
106
+
107
+ if __name__ == "__main__":
108
+ hello_world()</textarea>
109
+ </div>
110
+
111
+ <!-- Output Console -->
112
+ <div class="bg-gray-900 text-gray-200 border-t border-gray-700" style="height: 200px;">
113
+ <div class="flex justify-between items-center bg-gray-800 px-4 py-2">
114
+ <span class="font-mono">Output</span>
115
+ <div class="flex space-x-2">
116
+ <button class="text-gray-400 hover:text-white">
117
+ <i class="fas fa-trash-alt"></i>
118
+ </button>
119
+ <button class="text-gray-400 hover:text-white">
120
+ <i class="fas fa-expand"></i>
121
+ </button>
122
+ </div>
123
+ </div>
124
+ <div id="output-console" class="p-2 font-mono text-sm overflow-y-auto h-full">
125
+ <div class="text-green-400">>>> Ready</div>
126
+ </div>
127
+ </div>
128
+
129
+ <!-- Toolbar -->
130
+ <div class="bg-gray-800 px-4 py-2 flex items-center space-x-2 border-t border-gray-700">
131
+ <button class="px-3 py-1 bg-green-600 text-white rounded hover:bg-green-700 flex items-center">
132
+ <i class="fas fa-play mr-2"></i> Run
133
+ </button>
134
+ <button class="px-3 py-1 bg-red-600 text-white rounded hover:bg-red-700 flex items-center">
135
+ <i class="fas fa-stop mr-2"></i> Stop
136
+ </button>
137
+ <button class="px-3 py-1 bg-blue-600 text-white rounded hover:bg-blue-700 flex items-center">
138
+ <i class="fas fa-cog mr-2"></i> Build
139
+ </button>
140
+ <select class="px-2 py-1 bg-gray-700 text-white rounded border border-gray-600">
141
+ <option>.deb</option>
142
+ <option>.exe</option>
143
+ </select>
144
+ <button class="px-3 py-1 bg-purple-600 text-white rounded hover:bg-purple-700 flex items-center">
145
+ <i class="fas fa-plus-circle mr-2"></i> Venv
146
+ </button>
147
+ <button class="px-3 py-1 bg-yellow-600 text-white rounded hover:bg-yellow-700 flex items-center">
148
+ <i class="fas fa-trash-alt mr-2"></i> Remove Venv
149
+ </button>
150
+ </div>
151
+ </div>
152
+
153
+ <!-- Resize Handle -->
154
+ <div class="resize-handle"></div>
155
+
156
+ <!-- Chat Panel -->
157
+ <div class="w-80 bg-gray-800 border-l border-gray-700 flex flex-col">
158
+ <div class="p-3 border-b border-gray-700 flex justify-between items-center">
159
+ <h3 class="font-semibold text-white">Ollama Chat</h3>
160
+ <div class="flex items-center space-x-2">
161
+ <select id="model-selector" class="bg-gray-700 text-white text-sm rounded px-2 py-1 border border-gray-600">
162
+ <option>llama2</option>
163
+ <option>codellama</option>
164
+ <option>mistral</option>
165
+ </select>
166
+ <button id="refresh-models" class="text-gray-400 hover:text-white">
167
+ <i class="fas fa-sync-alt"></i>
168
+ </button>
169
+ </div>
170
+ </div>
171
+
172
+ <!-- Chat Messages -->
173
+ <div id="chat-messages" class="flex-1 overflow-y-auto p-3 space-y-3">
174
+ <div class="chat-message bg-blue-600 text-white p-3 rounded-lg self-end">
175
+ <div class="font-bold">You:</div>
176
+ <div>How can I improve this code?</div>
177
+ </div>
178
+ <div class="chat-message bg-gray-700 text-white p-3 rounded-lg">
179
+ <div class="font-bold">Ollama:</div>
180
+ <div>Here are some suggestions to improve your code:
181
+ 1. Add docstrings to document your functions
182
+ 2. Consider using type hints
183
+ 3. Add error handling</div>
184
+ </div>
185
+ <div class="chat-message bg-blue-600 text-white p-3 rounded-lg self-end">
186
+ <div class="font-bold">You:</div>
187
+ <div>Can you show me an example?</div>
188
+ </div>
189
+ <div class="chat-message bg-gray-700 text-white p-3 rounded-lg">
190
+ <div class="font-bold">Ollama:</div>
191
+ <div class="font-mono text-sm bg-gray-800 p-2 rounded">
192
+ <pre>def hello_world() -> None:
193
+ """Prints a hello world message to the console."""
194
+ try:
195
+ print("Hello, World!")
196
+ except Exception as e:
197
+ print(f"An error occurred: {e}")</pre>
198
+ </div>
199
+ </div>
200
+ </div>
201
+
202
+ <!-- Chat Input -->
203
+ <div class="p-3 border-t border-gray-700">
204
+ <div class="relative">
205
+ <textarea id="chat-input" class="w-full bg-gray-700 text-white rounded p-2 pr-10 resize-none outline-none" rows="3" placeholder="Ask Ollama about your code..."></textarea>
206
+ <button id="send-message" class="absolute right-2 bottom-2 bg-blue-600 text-white p-1 rounded hover:bg-blue-700">
207
+ <i class="fas fa-paper-plane"></i>
208
+ </button>
209
+ </div>
210
+ </div>
211
+ </div>
212
+ </div>
213
+
214
+ <!-- Status Bar -->
215
+ <div class="bg-gray-800 text-gray-300 text-sm px-4 py-1 flex justify-between items-center border-t border-gray-700">
216
+ <div class="flex items-center space-x-4">
217
+ <span id="status-message">Ready</span>
218
+ <span class="hidden md:inline">Python 3.10.6</span>
219
+ </div>
220
+ <div class="flex items-center space-x-4">
221
+ <span id="cursor-position">Ln 1, Col 1</span>
222
+ <span id="file-encoding">UTF-8</span>
223
+ </div>
224
+ </div>
225
+
226
+ <script>
227
+ // Theme toggle
228
+ const themeToggle = document.getElementById('theme-toggle');
229
+ const body = document.body;
230
+
231
+ themeToggle.addEventListener('click', () => {
232
+ body.classList.toggle('dark');
233
+ body.classList.toggle('light');
234
+
235
+ if (body.classList.contains('dark')) {
236
+ themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
237
+ localStorage.setItem('theme', 'dark');
238
+ } else {
239
+ themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
240
+ localStorage.setItem('theme', 'light');
241
+ }
242
+
243
+ // Update editor theme
244
+ updateEditorTheme();
245
+ });
246
+
247
+ // Initialize theme
248
+ if (localStorage.getItem('theme') === 'light') {
249
+ body.classList.remove('dark');
250
+ body.classList.add('light');
251
+ themeToggle.innerHTML = '<i class="fas fa-moon"></i>';
252
+ } else {
253
+ body.classList.remove('light');
254
+ body.classList.add('dark');
255
+ themeToggle.innerHTML = '<i class="fas fa-sun"></i>';
256
+ }
257
+
258
+ function updateEditorTheme() {
259
+ const editor = document.getElementById('code-editor');
260
+ if (body.classList.contains('dark')) {
261
+ editor.classList.add('dark:bg-gray-800', 'dark:text-gray-200');
262
+ editor.classList.remove('bg-white', 'text-gray-800');
263
+ } else {
264
+ editor.classList.remove('dark:bg-gray-800', 'dark:text-gray-200');
265
+ editor.classList.add('bg-white', 'text-gray-800');
266
+ }
267
+ }
268
+
269
+ // Chat functionality
270
+ const chatInput = document.getElementById('chat-input');
271
+ const sendMessageBtn = document.getElementById('send-message');
272
+ const chatMessages = document.getElementById('chat-messages');
273
+ const modelSelector = document.getElementById('model-selector');
274
+ const refreshModelsBtn = document.getElementById('refresh-models');
275
+
276
+ sendMessageBtn.addEventListener('click', sendMessage);
277
+ chatInput.addEventListener('keydown', (e) => {
278
+ if (e.key === 'Enter' && !e.shiftKey) {
279
+ e.preventDefault();
280
+ sendMessage();
281
+ }
282
+ });
283
+
284
+ function sendMessage() {
285
+ const message = chatInput.value.trim();
286
+ if (message) {
287
+ // Add user message
288
+ addMessage('You', message, true);
289
+ chatInput.value = '';
290
+
291
+ // Simulate Ollama response
292
+ setTimeout(() => {
293
+ const responses = [
294
+ "I've analyzed your code. Here are some suggestions...",
295
+ "That's an interesting question. Let me think...",
296
+ "Based on your code, I recommend...",
297
+ "Here's an improved version of your function:",
298
+ "I found a potential issue in your code..."
299
+ ];
300
+ const randomResponse = responses[Math.floor(Math.random() * responses.length)];
301
+
302
+ if (message.toLowerCase().includes('example')) {
303
+ // Return a code example
304
+ addMessage('Ollama', randomResponse, false);
305
+ setTimeout(() => {
306
+ addCodeExample();
307
+ }, 500);
308
+ } else {
309
+ addMessage('Ollama', randomResponse, false);
310
+ }
311
+ }, 1000);
312
+ }
313
+ }
314
+
315
+ function addMessage(sender, message, isUser) {
316
+ const messageDiv = document.createElement('div');
317
+ messageDiv.className = `chat-message ${isUser ? 'bg-blue-600 self-end' : 'bg-gray-700'} text-white p-3 rounded-lg ${isUser ? 'self-end' : ''}`;
318
+ messageDiv.innerHTML = `<div class="font-bold">${sender}:</div><div>${message}</div>`;
319
+ chatMessages.appendChild(messageDiv);
320
+ chatMessages.scrollTop = chatMessages.scrollHeight;
321
+ }
322
+
323
+ function addCodeExample() {
324
+ const codeDiv = document.createElement('div');
325
+ codeDiv.className = 'chat-message bg-gray-700 text-white p-3 rounded-lg';
326
+ codeDiv.innerHTML = `
327
+ <div class="font-bold">Ollama:</div>
328
+ <div class="font-mono text-sm bg-gray-800 p-2 rounded">
329
+ <pre>def improved_function():\n """This is a better version of your code."""\n try:\n # Improved logic here\n pass\n except Exception as e:\n print(f"Error: {e}")</pre>
330
+ </div>
331
+ `;
332
+ chatMessages.appendChild(codeDiv);
333
+ chatMessages.scrollTop = chatMessages.scrollHeight;
334
+ }
335
+
336
+ // Model refresh
337
+ refreshModelsBtn.addEventListener('click', () => {
338
+ // Simulate model refresh
339
+ const statusMessage = document.getElementById('status-message');
340
+ statusMessage.textContent = 'Refreshing Ollama models...';
341
+
342
+ setTimeout(() => {
343
+ // Add some dummy models
344
+ modelSelector.innerHTML = `
345
+ <option>llama2</option>
346
+ <option selected>codellama</option>
347
+ <option>mistral</option>
348
+ <option>phi</option>
349
+ <option>gemma</option>
350
+ `;
351
+ statusMessage.textContent = 'Models refreshed';
352
+
353
+ // Show a toast notification
354
+ showToast('Models list updated successfully');
355
+ }, 1500);
356
+ });
357
+
358
+ // Run button functionality
359
+ document.querySelector('.bg-green-600').addEventListener('click', () => {
360
+ const outputConsole = document.getElementById('output-console');
361
+ const statusMessage = document.getElementById('status-message');
362
+
363
+ outputConsole.innerHTML = '<div class="text-green-400">>>> Running script...</div>';
364
+ statusMessage.textContent = 'Running script...';
365
+
366
+ // Simulate script execution
367
+ setTimeout(() => {
368
+ outputConsole.innerHTML += `
369
+ <div class="text-white">Hello, World!</div>
370
+ <div class="text-green-400">>>> Script finished (0.12s)</div>
371
+ `;
372
+ statusMessage.textContent = 'Script finished';
373
+ }, 2000);
374
+ });
375
+
376
+ // Stop button functionality
377
+ document.querySelector('.bg-red-600').addEventListener('click', () => {
378
+ const outputConsole = document.getElementById('output-console');
379
+ const statusMessage = document.getElementById('status-message');
380
+
381
+ outputConsole.innerHTML += '<div class="text-red-400">>>> Script stopped by user</div>';
382
+ statusMessage.textContent = 'Script stopped';
383
+ });
384
+
385
+ // Tab functionality
386
+ document.querySelectorAll('#editor-tabs .tab').forEach(tab => {
387
+ tab.addEventListener('click', (e) => {
388
+ if (e.target.tagName !== 'BUTTON') {
389
+ document.querySelectorAll('#editor-tabs .tab').forEach(t => {
390
+ t.classList.remove('tab-active');
391
+ });
392
+ tab.classList.add('tab-active');
393
+ }
394
+ });
395
+
396
+ const closeBtn = tab.querySelector('button');
397
+ if (closeBtn) {
398
+ closeBtn.addEventListener('click', (e) => {
399
+ e.stopPropagation();
400
+ tab.remove();
401
+ });
402
+ }
403
+ });
404
+
405
+ // Add new tab
406
+ document.querySelector('#editor-tabs button:last-child').addEventListener('click', () => {
407
+ const newTab = document.createElement('div');
408
+ newTab.className = 'tab flex items-center px-4 py-2 text-white border-b-2 border-blue-500 tab-active';
409
+ newTab.innerHTML = `
410
+ <span>new_file.py</span>
411
+ <button class="ml-2 text-gray-400 hover:text-white">
412
+ <i class="fas fa-times"></i>
413
+ </button>
414
+ `;
415
+
416
+ // Remove active class from other tabs
417
+ document.querySelectorAll('#editor-tabs .tab').forEach(t => {
418
+ t.classList.remove('tab-active');
419
+ });
420
+
421
+ document.querySelector('#editor-tabs').insertBefore(newTab, document.querySelector('#editor-tabs button:last-child'));
422
+
423
+ // Add click handler for the new tab
424
+ newTab.addEventListener('click', (e) => {
425
+ if (e.target.tagName !== 'BUTTON') {
426
+ document.querySelectorAll('#editor-tabs .tab').forEach(t => {
427
+ t.classList.remove('tab-active');
428
+ });
429
+ newTab.classList.add('tab-active');
430
+ }
431
+ });
432
+
433
+ // Add close handler for the new tab
434
+ newTab.querySelector('button').addEventListener('click', (e) => {
435
+ e.stopPropagation();
436
+ newTab.remove();
437
+ });
438
+ });
439
+
440
+ // Resize functionality
441
+ const resizeHandle = document.querySelector('.resize-handle');
442
+ const editorArea = document.querySelector('.flex-1');
443
+ const chatPanel = document.querySelector('.w-80');
444
+
445
+ resizeHandle.addEventListener('mousedown', (e) => {
446
+ e.preventDefault();
447
+
448
+ document.addEventListener('mousemove', resize);
449
+ document.addEventListener('mouseup', stopResize);
450
+ });
451
+
452
+ function resize(e) {
453
+ const newWidth = window.innerWidth - e.clientX;
454
+ if (newWidth > 300 && newWidth < 600) {
455
+ chatPanel.style.width = `${newWidth}px`;
456
+ }
457
+ }
458
+
459
+ function stopResize() {
460
+ document.removeEventListener('mousemove', resize);
461
+ }
462
+
463
+ // Helper function to show toast notifications
464
+ function showToast(message) {
465
+ const toast = document.createElement('div');
466
+ toast.className = 'fixed bottom-4 right-4 bg-gray-800 text-white px-4 py-2 rounded shadow-lg animate-fade-in';
467
+ toast.textContent = message;
468
+ document.body.appendChild(toast);
469
+
470
+ setTimeout(() => {
471
+ toast.classList.add('animate-fade-out');
472
+ setTimeout(() => toast.remove(), 500);
473
+ }, 3000);
474
+ }
475
+
476
+ // Track cursor position in editor
477
+ const codeEditor = document.getElementById('code-editor');
478
+ const cursorPosition = document.getElementById('cursor-position');
479
+
480
+ codeEditor.addEventListener('input', updateCursorPosition);
481
+ codeEditor.addEventListener('click', updateCursorPosition);
482
+ codeEditor.addEventListener('keydown', updateCursorPosition);
483
+
484
+ function updateCursorPosition() {
485
+ const text = codeEditor.value;
486
+ const cursorPos = codeEditor.selectionStart;
487
+
488
+ let line = 1;
489
+ let col = 1;
490
+
491
+ for (let i = 0; i < cursorPos; i++) {
492
+ if (text[i] === '\n') {
493
+ line++;
494
+ col = 1;
495
+ } else {
496
+ col++;
497
+ }
498
+ }
499
+
500
+ cursorPosition.textContent = `Ln ${line}, Col ${col}`;
501
+ }
502
+
503
+ // Initialize cursor position
504
+ updateCursorPosition();
505
+ </script>
506
+ <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=developerbayman/neat-python-ide-im-making-thought-it-was-gonna-help-me-with-python-and-did-this-in-html" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
507
+ </html>