Spaces:
Running
Running
Add 3 files
Browse files- README.md +7 -5
- index.html +349 -19
- prompts.txt +1 -0
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: code-editor
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: purple
|
| 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,349 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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>Aesthetic Code Editor</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 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.15.2/ace.js"></script>
|
| 10 |
+
<style>
|
| 11 |
+
.editor-container {
|
| 12 |
+
height: calc(100vh - 60px);
|
| 13 |
+
}
|
| 14 |
+
.tab-active {
|
| 15 |
+
border-bottom: 2px solid #6366f1;
|
| 16 |
+
color: #6366f1;
|
| 17 |
+
}
|
| 18 |
+
.tab-inactive {
|
| 19 |
+
border-bottom: 2px solid transparent;
|
| 20 |
+
}
|
| 21 |
+
.sidebar-item:hover {
|
| 22 |
+
background-color: rgba(99, 102, 241, 0.1);
|
| 23 |
+
}
|
| 24 |
+
.sidebar-item.active {
|
| 25 |
+
background-color: rgba(99, 102, 241, 0.2);
|
| 26 |
+
border-left: 3px solid #6366f1;
|
| 27 |
+
}
|
| 28 |
+
#editor {
|
| 29 |
+
position: absolute;
|
| 30 |
+
top: 0;
|
| 31 |
+
right: 0;
|
| 32 |
+
bottom: 0;
|
| 33 |
+
left: 0;
|
| 34 |
+
font-size: 14px;
|
| 35 |
+
}
|
| 36 |
+
.gutter {
|
| 37 |
+
background-color: #1e1e2d;
|
| 38 |
+
background-repeat: no-repeat;
|
| 39 |
+
background-position: 50%;
|
| 40 |
+
}
|
| 41 |
+
.gutter.gutter-horizontal {
|
| 42 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
| 43 |
+
cursor: col-resize;
|
| 44 |
+
}
|
| 45 |
+
.gutter.gutter-vertical {
|
| 46 |
+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
|
| 47 |
+
cursor: row-resize;
|
| 48 |
+
}
|
| 49 |
+
.split {
|
| 50 |
+
-webkit-box-sizing: border-box;
|
| 51 |
+
-moz-box-sizing: border-box;
|
| 52 |
+
box-sizing: border-box;
|
| 53 |
+
}
|
| 54 |
+
</style>
|
| 55 |
+
</head>
|
| 56 |
+
<body class="bg-gray-900 text-gray-200 h-screen overflow-hidden">
|
| 57 |
+
<!-- Top Bar -->
|
| 58 |
+
<div class="bg-gray-800 h-12 flex items-center justify-between px-4 border-b border-gray-700">
|
| 59 |
+
<div class="flex items-center space-x-4">
|
| 60 |
+
<div class="flex items-center">
|
| 61 |
+
<i class="fas fa-code text-indigo-500 text-xl mr-2"></i>
|
| 62 |
+
<span class="font-bold text-lg">Aesthetic Editor</span>
|
| 63 |
+
</div>
|
| 64 |
+
<div class="hidden md:flex space-x-4 text-sm">
|
| 65 |
+
<button class="hover:text-indigo-400">File</button>
|
| 66 |
+
<button class="hover:text-indigo-400">Edit</button>
|
| 67 |
+
<button class="hover:text-indigo-400">View</button>
|
| 68 |
+
<button class="hover:text-indigo-400">Terminal</button>
|
| 69 |
+
<button class="hover:text-indigo-400">Help</button>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
<div class="flex items-center space-x-3">
|
| 73 |
+
<button class="bg-indigo-600 hover:bg-indigo-700 px-3 py-1 rounded text-sm">
|
| 74 |
+
<i class="fas fa-play mr-1"></i> Run
|
| 75 |
+
</button>
|
| 76 |
+
<button class="bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-sm">
|
| 77 |
+
<i class="fas fa-share-alt mr-1"></i> Share
|
| 78 |
+
</button>
|
| 79 |
+
<div class="h-6 w-6 rounded-full bg-indigo-500 flex items-center justify-center">
|
| 80 |
+
<i class="fas fa-user text-xs"></i>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<!-- Main Content -->
|
| 86 |
+
<div class="flex h-full">
|
| 87 |
+
<!-- Sidebar -->
|
| 88 |
+
<div class="w-16 bg-gray-800 border-r border-gray-700 flex flex-col items-center py-4">
|
| 89 |
+
<button class="sidebar-item active w-full py-3 flex items-center justify-center">
|
| 90 |
+
<i class="fas fa-file-code text-lg"></i>
|
| 91 |
+
</button>
|
| 92 |
+
<button class="sidebar-item w-full py-3 flex items-center justify-center">
|
| 93 |
+
<i class="fas fa-search text-lg"></i>
|
| 94 |
+
</button>
|
| 95 |
+
<button class="sidebar-item w-full py-3 flex items-center justify-center">
|
| 96 |
+
<i class="fas fa-code-branch text-lg"></i>
|
| 97 |
+
</button>
|
| 98 |
+
<button class="sidebar-item w-full py-3 flex items-center justify-center">
|
| 99 |
+
<i class="fas fa-cog text-lg"></i>
|
| 100 |
+
</button>
|
| 101 |
+
<div class="mt-auto">
|
| 102 |
+
<button class="sidebar-item w-full py-3 flex items-center justify-center">
|
| 103 |
+
<i class="fas fa-question-circle text-lg"></i>
|
| 104 |
+
</button>
|
| 105 |
+
</div>
|
| 106 |
+
</div>
|
| 107 |
+
|
| 108 |
+
<!-- File Explorer -->
|
| 109 |
+
<div class="w-48 bg-gray-800 border-r border-gray-700 hidden md:block">
|
| 110 |
+
<div class="p-3 border-b border-gray-700 flex justify-between items-center">
|
| 111 |
+
<span class="text-sm font-medium">EXPLORER</span>
|
| 112 |
+
<button class="text-gray-400 hover:text-white">
|
| 113 |
+
<i class="fas fa-ellipsis-h"></i>
|
| 114 |
+
</button>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="p-2">
|
| 117 |
+
<div class="flex items-center text-sm py-1 px-2 rounded hover:bg-gray-700 cursor-pointer">
|
| 118 |
+
<i class="fas fa-folder-open text-yellow-400 mr-2"></i>
|
| 119 |
+
<span>Project</span>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="ml-4 mt-1">
|
| 122 |
+
<div class="flex items-center text-sm py-1 px-2 rounded hover:bg-gray-700 cursor-pointer">
|
| 123 |
+
<i class="fas fa-file-code text-blue-400 mr-2"></i>
|
| 124 |
+
<span>index.html</span>
|
| 125 |
+
</div>
|
| 126 |
+
<div class="flex items-center text-sm py-1 px-2 rounded hover:bg-gray-700 cursor-pointer">
|
| 127 |
+
<i class="fas fa-file-code text-purple-400 mr-2"></i>
|
| 128 |
+
<span>styles.css</span>
|
| 129 |
+
</div>
|
| 130 |
+
<div class="flex items-center text-sm py-1 px-2 rounded hover:bg-gray-700 cursor-pointer">
|
| 131 |
+
<i class="fas fa-file-code text-green-400 mr-2"></i>
|
| 132 |
+
<span>app.js</span>
|
| 133 |
+
</div>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<!-- Editor Area -->
|
| 139 |
+
<div class="flex-1 flex flex-col">
|
| 140 |
+
<!-- Tabs -->
|
| 141 |
+
<div class="bg-gray-800 border-b border-gray-700 flex overflow-x-auto">
|
| 142 |
+
<div class="flex">
|
| 143 |
+
<div class="tab-active px-4 py-2 flex items-center text-sm">
|
| 144 |
+
<i class="fas fa-file-code text-blue-400 mr-2"></i>
|
| 145 |
+
<span>index.html</span>
|
| 146 |
+
<button class="ml-2 text-gray-400 hover:text-white">
|
| 147 |
+
<i class="fas fa-times"></i>
|
| 148 |
+
</button>
|
| 149 |
+
</div>
|
| 150 |
+
<div class="tab-inactive px-4 py-2 flex items-center text-sm text-gray-400 hover:text-gray-200">
|
| 151 |
+
<i class="fas fa-file-code text-purple-400 mr-2"></i>
|
| 152 |
+
<span>styles.css</span>
|
| 153 |
+
<button class="ml-2 text-gray-400 hover:text-white">
|
| 154 |
+
<i class="fas fa-times"></i>
|
| 155 |
+
</button>
|
| 156 |
+
</div>
|
| 157 |
+
<div class="tab-inactive px-4 py-2 flex items-center text-sm text-gray-400 hover:text-gray-200">
|
| 158 |
+
<i class="fas fa-file-code text-green-400 mr-2"></i>
|
| 159 |
+
<span>app.js</span>
|
| 160 |
+
<button class="ml-2 text-gray-400 hover:text-white">
|
| 161 |
+
<i class="fas fa-times"></i>
|
| 162 |
+
</button>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
<div class="ml-auto px-3 flex items-center">
|
| 166 |
+
<button class="text-gray-400 hover:text-white mx-1">
|
| 167 |
+
<i class="fas fa-save"></i>
|
| 168 |
+
</button>
|
| 169 |
+
<button class="text-gray-400 hover:text-white mx-1">
|
| 170 |
+
<i class="fas fa-ellipsis-v"></i>
|
| 171 |
+
</button>
|
| 172 |
+
</div>
|
| 173 |
+
</div>
|
| 174 |
+
|
| 175 |
+
<!-- Editor and Terminal -->
|
| 176 |
+
<div class="flex-1 flex flex-col">
|
| 177 |
+
<div class="editor-container relative">
|
| 178 |
+
<div id="editor"><!DOCTYPE html>
|
| 179 |
+
<html lang="en">
|
| 180 |
+
<head>
|
| 181 |
+
<meta charset="UTF-8">
|
| 182 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 183 |
+
<title>My Awesome Project</title>
|
| 184 |
+
<link rel="stylesheet" href="styles.css">
|
| 185 |
+
</head>
|
| 186 |
+
<body>
|
| 187 |
+
<div class="container">
|
| 188 |
+
<h1 class="text-gradient">Welcome to My Editor</h1>
|
| 189 |
+
<p>Start coding your amazing project here!</p>
|
| 190 |
+
<button id="mainBtn">Click Me</button>
|
| 191 |
+
</div>
|
| 192 |
+
<script src="app.js"></script>
|
| 193 |
+
</body>
|
| 194 |
+
</html></div>
|
| 195 |
+
</div>
|
| 196 |
+
|
| 197 |
+
<div class="gutter gutter-horizontal bg-gray-800 h-1 cursor-row-resize"></div>
|
| 198 |
+
|
| 199 |
+
<div class="bg-gray-800 h-1/3 flex flex-col">
|
| 200 |
+
<div class="bg-gray-800 border-t border-gray-700 px-3 py-1 flex items-center">
|
| 201 |
+
<span class="text-sm font-medium">TERMINAL</span>
|
| 202 |
+
<div class="ml-4 flex space-x-1">
|
| 203 |
+
<button class="text-xs px-2 py-1 rounded hover:bg-gray-700">Problems</button>
|
| 204 |
+
<button class="text-xs px-2 py-1 rounded hover:bg-gray-700">Output</button>
|
| 205 |
+
<button class="text-xs px-2 py-1 rounded hover:bg-gray-700">Debug Console</button>
|
| 206 |
+
<button class="text-xs px-2 py-1 rounded bg-gray-700">Terminal</button>
|
| 207 |
+
</div>
|
| 208 |
+
<button class="ml-auto text-gray-400 hover:text-white">
|
| 209 |
+
<i class="fas fa-times"></i>
|
| 210 |
+
</button>
|
| 211 |
+
</div>
|
| 212 |
+
<div class="flex-1 p-2 overflow-auto font-mono text-sm bg-gray-900">
|
| 213 |
+
<div class="text-green-400">$ npm start</div>
|
| 214 |
+
<div class="text-gray-400">Starting development server...</div>
|
| 215 |
+
<div class="text-gray-400">Compiled successfully!</div>
|
| 216 |
+
<div class="text-gray-400">You can now view my-app in the browser.</div>
|
| 217 |
+
<div class="mt-2">
|
| 218 |
+
<div class="text-blue-400"> Local: http://localhost:3000</div>
|
| 219 |
+
<div class="text-blue-400"> On Your Network: http://192.168.1.100:3000</div>
|
| 220 |
+
</div>
|
| 221 |
+
<div class="text-gray-400 mt-2">Note that the development build is not optimized.</div>
|
| 222 |
+
<div class="text-gray-400">To create a production build, use npm run build.</div>
|
| 223 |
+
<div class="mt-2 text-green-400">$</div>
|
| 224 |
+
</div>
|
| 225 |
+
</div>
|
| 226 |
+
</div>
|
| 227 |
+
</div>
|
| 228 |
+
</div>
|
| 229 |
+
|
| 230 |
+
<!-- Status Bar -->
|
| 231 |
+
<div class="bg-gray-800 h-6 flex items-center justify-between px-3 text-xs border-t border-gray-700">
|
| 232 |
+
<div class="flex items-center space-x-4">
|
| 233 |
+
<div class="flex items-center">
|
| 234 |
+
<i class="fas fa-code-branch text-gray-400 mr-1"></i>
|
| 235 |
+
<span class="text-gray-300">main*</span>
|
| 236 |
+
</div>
|
| 237 |
+
<div class="flex items-center">
|
| 238 |
+
<i class="fas fa-circle text-green-500 mr-1"></i>
|
| 239 |
+
<span class="text-gray-300">Prettier</span>
|
| 240 |
+
</div>
|
| 241 |
+
</div>
|
| 242 |
+
<div class="flex items-center space-x-4">
|
| 243 |
+
<div class="flex items-center">
|
| 244 |
+
<i class="fas fa-laptop-code text-gray-400 mr-1"></i>
|
| 245 |
+
<span class="text-gray-300">JavaScript</span>
|
| 246 |
+
</div>
|
| 247 |
+
<div class="flex items-center">
|
| 248 |
+
<i class="fas fa-clock text-gray-400 mr-1"></i>
|
| 249 |
+
<span class="text-gray-300">UTF-8</span>
|
| 250 |
+
</div>
|
| 251 |
+
<div class="flex items-center">
|
| 252 |
+
<i class="fas fa-terminal text-gray-400 mr-1"></i>
|
| 253 |
+
<span class="text-gray-300">LF</span>
|
| 254 |
+
</div>
|
| 255 |
+
<div class="flex items-center">
|
| 256 |
+
<span class="text-gray-300">Ln 10, Col 15</span>
|
| 257 |
+
</div>
|
| 258 |
+
</div>
|
| 259 |
+
</div>
|
| 260 |
+
|
| 261 |
+
<script>
|
| 262 |
+
// Initialize ACE Editor
|
| 263 |
+
const editor = ace.edit("editor");
|
| 264 |
+
editor.setTheme("ace/theme/tomorrow_night");
|
| 265 |
+
editor.session.setMode("ace/mode/html");
|
| 266 |
+
editor.setOptions({
|
| 267 |
+
fontSize: "13px",
|
| 268 |
+
enableBasicAutocompletion: true,
|
| 269 |
+
enableLiveAutocompletion: true,
|
| 270 |
+
showPrintMargin: false,
|
| 271 |
+
highlightActiveLine: true,
|
| 272 |
+
tabSize: 2
|
| 273 |
+
});
|
| 274 |
+
|
| 275 |
+
// Add gutter for resizing
|
| 276 |
+
function initGutter() {
|
| 277 |
+
const gutter = document.querySelector('.gutter');
|
| 278 |
+
const editorContainer = document.querySelector('.editor-container');
|
| 279 |
+
const terminal = document.querySelector('.bg-gray-800.h-1\\/3');
|
| 280 |
+
|
| 281 |
+
function drag(e) {
|
| 282 |
+
document.body.style.cursor = 'row-resize';
|
| 283 |
+
const editorHeight = e.clientY - editorContainer.getBoundingClientRect().top;
|
| 284 |
+
const terminalHeight = terminal.parentElement.offsetHeight - editorHeight - 1;
|
| 285 |
+
|
| 286 |
+
editorContainer.style.height = `${editorHeight}px`;
|
| 287 |
+
terminal.style.height = `${terminalHeight}px`;
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
function stopDrag() {
|
| 291 |
+
document.body.style.cursor = '';
|
| 292 |
+
document.removeEventListener('mousemove', drag);
|
| 293 |
+
document.removeEventListener('mouseup', stopDrag);
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
gutter.addEventListener('mousedown', (e) => {
|
| 297 |
+
e.preventDefault();
|
| 298 |
+
document.addEventListener('mousemove', drag);
|
| 299 |
+
document.addEventListener('mouseup', stopDrag);
|
| 300 |
+
});
|
| 301 |
+
}
|
| 302 |
+
|
| 303 |
+
// Initialize sidebar items
|
| 304 |
+
function initSidebar() {
|
| 305 |
+
const sidebarItems = document.querySelectorAll('.sidebar-item');
|
| 306 |
+
sidebarItems.forEach(item => {
|
| 307 |
+
item.addEventListener('click', () => {
|
| 308 |
+
sidebarItems.forEach(i => i.classList.remove('active'));
|
| 309 |
+
item.classList.add('active');
|
| 310 |
+
});
|
| 311 |
+
});
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
// Initialize tabs
|
| 315 |
+
function initTabs() {
|
| 316 |
+
const tabs = document.querySelectorAll('.tab-inactive, .tab-active');
|
| 317 |
+
tabs.forEach(tab => {
|
| 318 |
+
tab.addEventListener('click', (e) => {
|
| 319 |
+
if (e.target.classList.contains('fa-times')) return;
|
| 320 |
+
|
| 321 |
+
tabs.forEach(t => {
|
| 322 |
+
t.classList.remove('tab-active');
|
| 323 |
+
t.classList.add('tab-inactive');
|
| 324 |
+
});
|
| 325 |
+
tab.classList.remove('tab-inactive');
|
| 326 |
+
tab.classList.add('tab-active');
|
| 327 |
+
|
| 328 |
+
// Change editor mode based on file type
|
| 329 |
+
const fileName = tab.querySelector('span').textContent;
|
| 330 |
+
if (fileName.endsWith('.html')) {
|
| 331 |
+
editor.session.setMode("ace/mode/html");
|
| 332 |
+
} else if (fileName.endsWith('.css')) {
|
| 333 |
+
editor.session.setMode("ace/mode/css");
|
| 334 |
+
} else if (fileName.endsWith('.js')) {
|
| 335 |
+
editor.session.setMode("ace/mode/javascript");
|
| 336 |
+
}
|
| 337 |
+
});
|
| 338 |
+
});
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
// Initialize everything when DOM is loaded
|
| 342 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 343 |
+
initGutter();
|
| 344 |
+
initSidebar();
|
| 345 |
+
initTabs();
|
| 346 |
+
});
|
| 347 |
+
</script>
|
| 348 |
+
<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=Utkarsh65447/code-editor" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 349 |
+
</html>
|
prompts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
i want to make a online code editor like cursor with asthetic UI
|