Spaces:
Running
Running
Add 2 files
Browse files- README.md +7 -5
- index.html +258 -19
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: jeff-deepsite
|
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,258 @@
|
|
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>PyCraft - Python 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 |
+
<style>
|
10 |
+
.code-editor {
|
11 |
+
font-family: 'Fira Code', monospace;
|
12 |
+
tab-size: 4;
|
13 |
+
}
|
14 |
+
.line-numbers {
|
15 |
+
user-select: none;
|
16 |
+
text-align: right;
|
17 |
+
}
|
18 |
+
.python-keyword {
|
19 |
+
color: #ff79c6;
|
20 |
+
}
|
21 |
+
.python-builtin {
|
22 |
+
color: #8be9fd;
|
23 |
+
}
|
24 |
+
.python-string {
|
25 |
+
color: #f1fa8c;
|
26 |
+
}
|
27 |
+
.python-comment {
|
28 |
+
color: #6272a4;
|
29 |
+
}
|
30 |
+
.python-number {
|
31 |
+
color: #bd93f9;
|
32 |
+
}
|
33 |
+
.python-operator {
|
34 |
+
color: #ff5555;
|
35 |
+
}
|
36 |
+
.cursor-blink {
|
37 |
+
animation: blink 1s step-end infinite;
|
38 |
+
}
|
39 |
+
@keyframes blink {
|
40 |
+
from, to { opacity: 1; }
|
41 |
+
50% { opacity: 0; }
|
42 |
+
}
|
43 |
+
.terminal {
|
44 |
+
font-family: 'Courier New', monospace;
|
45 |
+
background-color: #1e1e1e;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
</head>
|
49 |
+
<body class="bg-gray-900 text-gray-100 min-h-screen">
|
50 |
+
<div class="container mx-auto px-4 py-8">
|
51 |
+
<!-- Header -->
|
52 |
+
<header class="flex justify-between items-center mb-6">
|
53 |
+
<div class="flex items-center space-x-2">
|
54 |
+
<i class="fab fa-python text-3xl text-blue-400"></i>
|
55 |
+
<h1 class="text-2xl font-bold bg-gradient-to-r from-blue-400 to-green-400 bg-clip-text text-transparent">PyCraft</h1>
|
56 |
+
</div>
|
57 |
+
<div class="flex space-x-4">
|
58 |
+
<button id="run-btn" class="px-4 py-2 bg-green-600 hover:bg-green-700 rounded-lg flex items-center space-x-2 transition-all">
|
59 |
+
<i class="fas fa-play"></i>
|
60 |
+
<span>Run (F5)</span>
|
61 |
+
</button>
|
62 |
+
<button class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center space-x-2 transition-all">
|
63 |
+
<i class="fas fa-save"></i>
|
64 |
+
<span>Save</span>
|
65 |
+
</button>
|
66 |
+
<button class="px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg flex items-center space-x-2 transition-all">
|
67 |
+
<i class="fas fa-cog"></i>
|
68 |
+
</button>
|
69 |
+
</div>
|
70 |
+
</header>
|
71 |
+
|
72 |
+
<!-- Main Editor Area -->
|
73 |
+
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
74 |
+
<!-- Code Editor -->
|
75 |
+
<div class="bg-gray-800 rounded-xl overflow-hidden shadow-2xl">
|
76 |
+
<div class="bg-gray-700 px-4 py-2 flex justify-between items-center">
|
77 |
+
<div class="flex space-x-2">
|
78 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
79 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
80 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
81 |
+
</div>
|
82 |
+
<div class="text-sm text-gray-400">main.py</div>
|
83 |
+
<div class="w-8"></div>
|
84 |
+
</div>
|
85 |
+
<div class="p-4">
|
86 |
+
<div class="code-editor flex h-96">
|
87 |
+
<div class="line-numbers w-10 pr-2 text-gray-500 select-none overflow-hidden">
|
88 |
+
<!-- Line numbers will be generated by JS -->
|
89 |
+
</div>
|
90 |
+
<textarea id="python-code" class="flex-1 bg-transparent outline-none resize-none text-white overflow-auto" spellcheck="false"># Welcome to PyCraft!
|
91 |
+
# Write your Python code here
|
92 |
+
|
93 |
+
def greet(name):
|
94 |
+
"""A simple greeting function"""
|
95 |
+
print(f"Hello, {name}!")
|
96 |
+
|
97 |
+
if __name__ == "__main__":
|
98 |
+
names = ["Alice", "Bob", "Charlie"]
|
99 |
+
for name in names:
|
100 |
+
greet(name)
|
101 |
+
|
102 |
+
# Try pressing F5 or the Run button</textarea>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<!-- Output Terminal -->
|
108 |
+
<div class="bg-gray-800 rounded-xl overflow-hidden shadow-2xl flex flex-col">
|
109 |
+
<div class="bg-gray-700 px-4 py-2 flex justify-between items-center">
|
110 |
+
<div class="flex items-center space-x-2">
|
111 |
+
<i class="fas fa-terminal text-green-400"></i>
|
112 |
+
<span class="text-sm">Terminal</span>
|
113 |
+
</div>
|
114 |
+
<button id="clear-terminal" class="text-gray-400 hover:text-white">
|
115 |
+
<i class="fas fa-trash-alt"></i>
|
116 |
+
</button>
|
117 |
+
</div>
|
118 |
+
<div class="terminal flex-1 p-4 overflow-y-auto" id="output-terminal">
|
119 |
+
<div class="text-green-400">PyCraft v1.0 - Python 3.x</div>
|
120 |
+
<div class="text-gray-400">Output will appear here...</div>
|
121 |
+
</div>
|
122 |
+
<div class="bg-gray-700 px-4 py-2 flex items-center">
|
123 |
+
<span class="text-green-400 mr-2">>>></span>
|
124 |
+
<input type="text" id="terminal-input" class="bg-transparent outline-none flex-1" placeholder="Enter Python commands...">
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
<!-- Features Section -->
|
130 |
+
<div class="mt-8 grid grid-cols-1 md:grid-cols-3 gap-6">
|
131 |
+
<div class="bg-gray-800 p-6 rounded-xl shadow-lg">
|
132 |
+
<div class="flex items-center mb-4">
|
133 |
+
<div class="bg-blue-500 p-2 rounded-lg mr-4">
|
134 |
+
<i class="fas fa-bolt text-white"></i>
|
135 |
+
</div>
|
136 |
+
<h3 class="text-xl font-semibold">Fast Execution</h3>
|
137 |
+
</div>
|
138 |
+
<p class="text-gray-400">Run your Python code instantly with our optimized execution engine. No setup required.</p>
|
139 |
+
</div>
|
140 |
+
<div class="bg-gray-800 p-6 rounded-xl shadow-lg">
|
141 |
+
<div class="flex items-center mb-4">
|
142 |
+
<div class="bg-purple-500 p-2 rounded-lg mr-4">
|
143 |
+
<i class="fas fa-code text-white"></i>
|
144 |
+
</div>
|
145 |
+
<h3 class="text-xl font-semibold">Syntax Highlighting</h3>
|
146 |
+
</div>
|
147 |
+
<p class="text-gray-400">Beautiful syntax highlighting that makes your code more readable and easier to debug.</p>
|
148 |
+
</div>
|
149 |
+
<div class="bg-gray-800 p-6 rounded-xl shadow-lg">
|
150 |
+
<div class="flex items-center mb-4">
|
151 |
+
<div class="bg-green-500 p-2 rounded-lg mr-4">
|
152 |
+
<i class="fas fa-terminal text-white"></i>
|
153 |
+
</div>
|
154 |
+
<h3 class="text-xl font-semibold">Interactive Terminal</h3>
|
155 |
+
</div>
|
156 |
+
<p class="text-gray-400">Experiment with Python commands in real-time using our interactive terminal.</p>
|
157 |
+
</div>
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
|
161 |
+
<script>
|
162 |
+
// Initialize the editor
|
163 |
+
document.addEventListener('DOMContentLoaded', function() {
|
164 |
+
const codeTextarea = document.getElementById('python-code');
|
165 |
+
const lineNumbers = document.querySelector('.line-numbers');
|
166 |
+
const outputTerminal = document.getElementById('output-terminal');
|
167 |
+
const runButton = document.getElementById('run-btn');
|
168 |
+
const clearTerminalButton = document.getElementById('clear-terminal');
|
169 |
+
const terminalInput = document.getElementById('terminal-input');
|
170 |
+
|
171 |
+
// Generate line numbers
|
172 |
+
function updateLineNumbers() {
|
173 |
+
const lines = codeTextarea.value.split('\n');
|
174 |
+
lineNumbers.innerHTML = lines.map((_, i) => `<div>${i + 1}</div>`).join('');
|
175 |
+
}
|
176 |
+
|
177 |
+
// Syntax highlighting (simplified)
|
178 |
+
function applySyntaxHighlighting() {
|
179 |
+
// This is a simplified version - a real implementation would use a proper parser
|
180 |
+
const code = codeTextarea.value;
|
181 |
+
// Highlighting would be applied here in a real implementation
|
182 |
+
}
|
183 |
+
|
184 |
+
// Run Python code
|
185 |
+
function runPythonCode() {
|
186 |
+
const code = codeTextarea.value;
|
187 |
+
outputTerminal.innerHTML += `<div class="text-blue-400">Running your code...</div>`;
|
188 |
+
|
189 |
+
// In a real implementation, this would send the code to a Python interpreter
|
190 |
+
// For this demo, we'll simulate execution with setTimeout
|
191 |
+
setTimeout(() => {
|
192 |
+
try {
|
193 |
+
// Simulate output
|
194 |
+
const mockOutput = `Hello, Alice!\nHello, Bob!\nHello, Charlie!\n`;
|
195 |
+
outputTerminal.innerHTML += `<div class="text-gray-100 whitespace-pre">${mockOutput}</div>`;
|
196 |
+
outputTerminal.innerHTML += `<div class="text-green-400">Program finished successfully.</div>`;
|
197 |
+
} catch (error) {
|
198 |
+
outputTerminal.innerHTML += `<div class="text-red-400">Error: ${error.message}</div>`;
|
199 |
+
}
|
200 |
+
outputTerminal.scrollTop = outputTerminal.scrollHeight;
|
201 |
+
}, 500);
|
202 |
+
}
|
203 |
+
|
204 |
+
// Clear terminal
|
205 |
+
function clearTerminal() {
|
206 |
+
outputTerminal.innerHTML = '<div class="text-green-400">PyCraft v1.0 - Python 3.x</div>';
|
207 |
+
}
|
208 |
+
|
209 |
+
// Handle terminal input
|
210 |
+
function handleTerminalInput() {
|
211 |
+
const command = terminalInput.value.trim();
|
212 |
+
if (command) {
|
213 |
+
outputTerminal.innerHTML += `<div class="text-yellow-400">>>> ${command}</div>`;
|
214 |
+
|
215 |
+
// Simulate command execution
|
216 |
+
setTimeout(() => {
|
217 |
+
if (command.includes('print')) {
|
218 |
+
outputTerminal.innerHTML += `<div class="text-gray-100">${command.replace('print', '').replace(/['"()]/g, '')}</div>`;
|
219 |
+
} else if (command === 'help') {
|
220 |
+
outputTerminal.innerHTML += `<div class="text-gray-100">Type Python commands to execute them interactively.</div>`;
|
221 |
+
} else {
|
222 |
+
outputTerminal.innerHTML += `<div class="text-gray-100">Command executed (simulated).</div>`;
|
223 |
+
}
|
224 |
+
outputTerminal.scrollTop = outputTerminal.scrollHeight;
|
225 |
+
}, 300);
|
226 |
+
}
|
227 |
+
terminalInput.value = '';
|
228 |
+
}
|
229 |
+
|
230 |
+
// Event listeners
|
231 |
+
codeTextarea.addEventListener('input', () => {
|
232 |
+
updateLineNumbers();
|
233 |
+
applySyntaxHighlighting();
|
234 |
+
});
|
235 |
+
|
236 |
+
runButton.addEventListener('click', runPythonCode);
|
237 |
+
clearTerminalButton.addEventListener('click', clearTerminal);
|
238 |
+
terminalInput.addEventListener('keydown', (e) => {
|
239 |
+
if (e.key === 'Enter') {
|
240 |
+
handleTerminalInput();
|
241 |
+
}
|
242 |
+
});
|
243 |
+
|
244 |
+
// Keyboard shortcut for running code (F5)
|
245 |
+
document.addEventListener('keydown', (e) => {
|
246 |
+
if (e.key === 'F5') {
|
247 |
+
e.preventDefault();
|
248 |
+
runPythonCode();
|
249 |
+
}
|
250 |
+
});
|
251 |
+
|
252 |
+
// Initialize
|
253 |
+
updateLineNumbers();
|
254 |
+
applySyntaxHighlighting();
|
255 |
+
});
|
256 |
+
</script>
|
257 |
+
<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=jeffgui/jeff-deepsite" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
258 |
+
</html>
|