Update templates/index.html
Browse files- templates/index.html +19 -6
templates/index.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<title>Hacker's Python Terminal</title>
|
7 |
<style>
|
8 |
body, html {
|
9 |
margin: 0;
|
@@ -90,6 +90,9 @@
|
|
90 |
border: none;
|
91 |
cursor: pointer;
|
92 |
}
|
|
|
|
|
|
|
93 |
@keyframes glitch {
|
94 |
0% {
|
95 |
text-shadow: 0.05em 0 0 #00fffc, -0.05em -0.025em 0 #fc00ff,
|
@@ -154,8 +157,12 @@
|
|
154 |
|
155 |
let currentEditingFile = '';
|
156 |
|
157 |
-
function addToOutput(text) {
|
158 |
-
|
|
|
|
|
|
|
|
|
159 |
outputDiv.scrollTop = outputDiv.scrollHeight;
|
160 |
}
|
161 |
|
@@ -170,7 +177,11 @@
|
|
170 |
})
|
171 |
.then(response => response.json())
|
172 |
.then(data => {
|
173 |
-
|
|
|
|
|
|
|
|
|
174 |
if (data.action === "edit") {
|
175 |
currentEditingFile = data.filename;
|
176 |
editorTextarea.value = '';
|
@@ -238,8 +249,9 @@
|
|
238 |
window.addEventListener('beforeunload', cleanup);
|
239 |
|
240 |
// Initial message
|
241 |
-
addToOutput("Welcome to the Hacker's Python Terminal. Type your commands below.");
|
242 |
addToOutput("Available commands:");
|
|
|
243 |
addToOutput("- show files: Display the file explorer");
|
244 |
addToOutput("- hide files: Hide the file explorer");
|
245 |
addToOutput("- new file <filename>: Create a new file");
|
@@ -251,4 +263,5 @@
|
|
251 |
addToOutput("- <python code>: Execute Python code");
|
252 |
</script>
|
253 |
</body>
|
254 |
-
</html>
|
|
|
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>AI-Powered Hacker's Python Terminal</title>
|
7 |
<style>
|
8 |
body, html {
|
9 |
margin: 0;
|
|
|
90 |
border: none;
|
91 |
cursor: pointer;
|
92 |
}
|
93 |
+
.ai-executed {
|
94 |
+
color: #ff00ff;
|
95 |
+
}
|
96 |
@keyframes glitch {
|
97 |
0% {
|
98 |
text-shadow: 0.05em 0 0 #00fffc, -0.05em -0.025em 0 #fc00ff,
|
|
|
157 |
|
158 |
let currentEditingFile = '';
|
159 |
|
160 |
+
function addToOutput(text, isAiExecuted = false) {
|
161 |
+
if (isAiExecuted) {
|
162 |
+
outputDiv.innerHTML += `<span class="ai-executed">${text}</span>\n`;
|
163 |
+
} else {
|
164 |
+
outputDiv.innerHTML += text + '\n';
|
165 |
+
}
|
166 |
outputDiv.scrollTop = outputDiv.scrollHeight;
|
167 |
}
|
168 |
|
|
|
177 |
})
|
178 |
.then(response => response.json())
|
179 |
.then(data => {
|
180 |
+
if (data.result.startsWith("AI Executed:")) {
|
181 |
+
addToOutput(data.result, true);
|
182 |
+
} else {
|
183 |
+
addToOutput(data.result);
|
184 |
+
}
|
185 |
if (data.action === "edit") {
|
186 |
currentEditingFile = data.filename;
|
187 |
editorTextarea.value = '';
|
|
|
249 |
window.addEventListener('beforeunload', cleanup);
|
250 |
|
251 |
// Initial message
|
252 |
+
addToOutput("Welcome to the AI-Powered Hacker's Python Terminal. Type your commands below.");
|
253 |
addToOutput("Available commands:");
|
254 |
+
addToOutput("- AI: <your request>: Use AI to understand and execute your command");
|
255 |
addToOutput("- show files: Display the file explorer");
|
256 |
addToOutput("- hide files: Hide the file explorer");
|
257 |
addToOutput("- new file <filename>: Create a new file");
|
|
|
263 |
addToOutput("- <python code>: Execute Python code");
|
264 |
</script>
|
265 |
</body>
|
266 |
+
</html>
|
267 |
+
|