Dmitriy commited on
OK, now add different languages: Russian, German, French, Ukrainian and Belarusian - Follow Up Deployment
Browse files- index.html +350 -418
index.html
CHANGED
|
@@ -3,471 +3,403 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<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 |
-
@keyframes
|
| 11 |
-
from { opacity: 0; transform: translateY(10px); }
|
| 12 |
-
to { opacity: 1; transform: translateY(0); }
|
| 13 |
-
}
|
| 14 |
-
|
| 15 |
-
@keyframes pulse {
|
| 16 |
0%, 100% { opacity: 1; }
|
| 17 |
-
50% { opacity: 0
|
| 18 |
-
}
|
| 19 |
-
|
| 20 |
-
.message-animation {
|
| 21 |
-
animation: fadeIn 0.3s ease-out forwards;
|
| 22 |
}
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
animation: pulse 1.5s infinite;
|
| 26 |
}
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
| 30 |
}
|
| 31 |
-
|
| 32 |
-
@media (max-width: 640px) {
|
| 33 |
-
.chat-container {
|
| 34 |
-
height: calc(100vh - 100px);
|
| 35 |
-
}
|
| 36 |
-
}
|
| 37 |
-
|
| 38 |
-
/* Custom scrollbar */
|
| 39 |
-
.messages-container::-webkit-scrollbar {
|
| 40 |
width: 6px;
|
| 41 |
}
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
background: rgba(255, 255, 255, 0.1);
|
| 45 |
-
}
|
| 46 |
-
|
| 47 |
-
.messages-container::-webkit-scrollbar-thumb {
|
| 48 |
-
background: #4f46e5;
|
| 49 |
border-radius: 3px;
|
| 50 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
</style>
|
| 52 |
</head>
|
| 53 |
-
<body class="bg-gray-900 text-
|
| 54 |
-
<
|
| 55 |
-
|
| 56 |
-
<
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
</div>
|
| 61 |
-
<
|
| 62 |
</div>
|
| 63 |
-
<div class="
|
| 64 |
-
|
| 65 |
-
<i class="fas fa-moon text-indigo-300"></i>
|
| 66 |
-
</button>
|
| 67 |
-
<div class="relative">
|
| 68 |
-
<button id="userMenu" class="flex items-center space-x-2 focus:outline-none">
|
| 69 |
-
<div class="w-8 h-8 rounded-full bg-gradient-to-br from-indigo-400 to-purple-500 flex items-center justify-center">
|
| 70 |
-
<span class="text-xs font-bold">ME</span>
|
| 71 |
-
</div>
|
| 72 |
-
</button>
|
| 73 |
-
</div>
|
| 74 |
</div>
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
<
|
| 83 |
-
|
| 84 |
-
<span class="text-xs font-bold">JD</span>
|
| 85 |
-
</div>
|
| 86 |
-
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-400 rounded-full border-2 border-gray-900"></div>
|
| 87 |
-
</div>
|
| 88 |
-
</div>
|
| 89 |
-
<div class="flex-shrink-0">
|
| 90 |
-
<div class="relative">
|
| 91 |
-
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-pink-500 to-red-500 flex items-center justify-center">
|
| 92 |
-
<span class="text-xs font-bold">AM</span>
|
| 93 |
-
</div>
|
| 94 |
-
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-400 rounded-full border-2 border-gray-900"></div>
|
| 95 |
-
</div>
|
| 96 |
-
</div>
|
| 97 |
-
<div class="flex-shrink-0">
|
| 98 |
-
<div class="relative">
|
| 99 |
-
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-yellow-400 to-orange-500 flex items-center justify-center">
|
| 100 |
-
<span class="text-xs font-bold">TS</span>
|
| 101 |
-
</div>
|
| 102 |
-
<div class="absolute bottom-0 right-0 w-3 h-3 bg-gray-400 rounded-full border-2 border-gray-900"></div>
|
| 103 |
-
</div>
|
| 104 |
-
</div>
|
| 105 |
-
<div class="flex-shrink-0">
|
| 106 |
-
<div class="relative">
|
| 107 |
-
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-blue-400 to-cyan-500 flex items-center justify-center">
|
| 108 |
-
<span class="text-xs font-bold">KT</span>
|
| 109 |
-
</div>
|
| 110 |
-
<div class="absolute bottom-0 right-0 w-3 h-3 bg-green-400 rounded-full border-2 border-gray-900"></div>
|
| 111 |
-
</div>
|
| 112 |
-
</div>
|
| 113 |
</div>
|
|
|
|
| 114 |
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
</div>
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
</div>
|
| 126 |
-
<div class="flex space-x-1">
|
| 127 |
-
<div class="w-2 h-2 bg-indigo-400 rounded-full typing-animation" style="animation-delay: 0s"></div>
|
| 128 |
-
<div class="w-2 h-2 bg-indigo-400 rounded-full typing-animation" style="animation-delay: 0.2s"></div>
|
| 129 |
-
<div class="w-2 h-2 bg-indigo-400 rounded-full typing-animation" style="animation-delay: 0.4s"></div>
|
| 130 |
-
</div>
|
| 131 |
-
<span class="text-gray-400 text-sm">is typing...</span>
|
| 132 |
-
</div>
|
| 133 |
-
|
| 134 |
-
<!-- Message Input -->
|
| 135 |
-
<div class="p-4 border-t border-gray-800">
|
| 136 |
-
<form id="messageForm" class="flex items-center space-x-2">
|
| 137 |
-
<div class="flex-1 relative">
|
| 138 |
-
<input
|
| 139 |
-
id="messageInput"
|
| 140 |
-
type="text"
|
| 141 |
-
placeholder="Type your message..."
|
| 142 |
-
class="w-full bg-gray-800 border border-gray-700 rounded-full py-3 px-4 pr-12 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent"
|
| 143 |
-
autocomplete="off"
|
| 144 |
-
>
|
| 145 |
-
<div class="absolute right-3 top-3 flex space-x-2">
|
| 146 |
-
<button type="button" class="text-gray-400 hover:text-indigo-400 transition emoji-trigger">
|
| 147 |
-
<i class="far fa-smile"></i>
|
| 148 |
-
</button>
|
| 149 |
-
<div class="hidden absolute bottom-14 right-0 w-64 h-64 bg-gray-800 rounded-lg shadow-xl overflow-y-auto p-2 emoji-picker">
|
| 150 |
-
<!-- Emojis will be inserted here by JavaScript -->
|
| 151 |
-
<div class="grid grid-cols-5 gap-2"></div>
|
| 152 |
-
</div>
|
| 153 |
-
<button type="button" class="text-gray-400 hover:text-indigo-400 transition" id="fileButton">
|
| 154 |
-
<i class="fas fa-paperclip"></i>
|
| 155 |
-
</button>
|
| 156 |
-
</div>
|
| 157 |
-
</div>
|
| 158 |
-
<button
|
| 159 |
-
type="submit"
|
| 160 |
-
class="w-12 h-12 rounded-full bg-gradient-to-br from-indigo-500 to-purple-600 flex items-center justify-center hover:from-indigo-600 hover:to-purple-700 transition transform hover:scale-105 focus:outline-none"
|
| 161 |
-
>
|
| 162 |
-
<i class="fas fa-paper-plane text-white"></i>
|
| 163 |
-
</button>
|
| 164 |
-
</form>
|
| 165 |
-
<input type="file" id="fileInput" class="hidden" accept=".gif,.jpeg,.jpg,.webp,.png,.zip,.txt" multiple>
|
| 166 |
</div>
|
|
|
|
| 167 |
</div>
|
| 168 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
</div>
|
| 170 |
|
| 171 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
document.addEventListener('DOMContentLoaded', function() {
|
| 173 |
-
|
| 174 |
-
const
|
| 175 |
-
const
|
| 176 |
-
const
|
| 177 |
-
const
|
| 178 |
-
const themeToggle = document.getElementById('themeToggle');
|
| 179 |
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
{ id: 1, name: "You", initials: "ME", color: "from-indigo-400 to-purple-500" },
|
| 183 |
-
{ id: 2, name: "John Doe", initials: "JD", color: "from-green-400 to-blue-500" },
|
| 184 |
-
{ id: 3, name: "Alice", initials: "AM", color: "from-pink-500 to-red-500" },
|
| 185 |
-
{ id: 4, name: "Tom", initials: "TS", color: "from-yellow-400 to-orange-500" }
|
| 186 |
-
];
|
| 187 |
|
| 188 |
-
//
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
];
|
| 197 |
-
|
| 198 |
-
// Display existing messages
|
| 199 |
-
renderMessages();
|
| 200 |
-
|
| 201 |
-
// Emoji handling
|
| 202 |
-
const emojiTrigger = document.querySelector('.emoji-trigger');
|
| 203 |
-
const emojiPicker = document.querySelector('.emoji-picker');
|
| 204 |
-
const emojiContainer = emojiPicker.querySelector('div');
|
| 205 |
-
|
| 206 |
-
// Common emojis
|
| 207 |
-
const emojis = ['😀', '😂', '😊', '🤔', '😎', '😍', '🥳', '😱', '🤯', '👋',
|
| 208 |
-
'👍', '👎', '❤️', '🔥', '🎉', '💯', '😢', '😡', '😴', '🤑'];
|
| 209 |
-
|
| 210 |
-
// Populate emoji picker
|
| 211 |
-
emojis.forEach(emoji => {
|
| 212 |
-
const emojiButton = document.createElement('button');
|
| 213 |
-
emojiButton.classList.add('emoji', 'text-2xl', 'hover:bg-gray-700', 'rounded',
|
| 214 |
-
'p-1', 'w-full', 'h-8', 'flex', 'items-center', 'justify-center');
|
| 215 |
-
emojiButton.textContent = emoji;
|
| 216 |
-
emojiButton.addEventListener('click', () => {
|
| 217 |
-
messageInput.value += emoji;
|
| 218 |
-
messageInput.focus();
|
| 219 |
-
emojiPicker.classList.add('hidden');
|
| 220 |
-
});
|
| 221 |
-
emojiContainer.appendChild(emojiButton);
|
| 222 |
-
});
|
| 223 |
-
|
| 224 |
-
// Toggle emoji picker
|
| 225 |
-
emojiTrigger.addEventListener('click', () => {
|
| 226 |
-
emojiPicker.classList.toggle('hidden');
|
| 227 |
-
// Position picker above input
|
| 228 |
-
emojiPicker.style.bottom = `${messageInput.offsetHeight + 16}px`;
|
| 229 |
-
});
|
| 230 |
-
|
| 231 |
-
// Hide emoji picker when clicking elsewhere
|
| 232 |
-
document.addEventListener('click', (e) => {
|
| 233 |
-
if (!emojiTrigger.contains(e.target) && !emojiPicker.contains(e.target)) {
|
| 234 |
-
emojiPicker.classList.add('hidden');
|
| 235 |
-
}
|
| 236 |
-
});
|
| 237 |
-
|
| 238 |
-
// File upload handling
|
| 239 |
-
const fileButton = document.getElementById('fileButton');
|
| 240 |
-
const fileInput = document.getElementById('fileInput');
|
| 241 |
-
|
| 242 |
-
fileButton.addEventListener('click', () => {
|
| 243 |
-
fileInput.click();
|
| 244 |
-
});
|
| 245 |
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
}
|
| 274 |
-
}
|
| 275 |
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
|
| 280 |
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
| 281 |
-
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
|
| 282 |
-
}
|
| 283 |
-
|
| 284 |
-
// Theme toggle
|
| 285 |
-
themeToggle.addEventListener('click', function() {
|
| 286 |
-
document.body.classList.toggle('bg-gray-100');
|
| 287 |
-
document.body.classList.toggle('text-gray-900');
|
| 288 |
-
document.body.classList.toggle('bg-gray-900');
|
| 289 |
-
document.body.classList.toggle('text-white');
|
| 290 |
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
const messageText = messageInput.value.trim();
|
| 301 |
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
// Save to localStorage
|
| 315 |
-
localStorage.setItem('chatMessages', JSON.stringify(messages));
|
| 316 |
-
|
| 317 |
-
// Clear input
|
| 318 |
-
messageInput.value = '';
|
| 319 |
-
|
| 320 |
-
// Render new message
|
| 321 |
-
renderMessage(newMessage);
|
| 322 |
-
|
| 323 |
-
// Scroll to bottom
|
| 324 |
-
scrollToBottom();
|
| 325 |
-
|
| 326 |
-
// Simulate reply after 1-3 seconds
|
| 327 |
-
setTimeout(() => {
|
| 328 |
-
simulateReply();
|
| 329 |
-
}, Math.random() * 2000 + 1000);
|
| 330 |
}
|
| 331 |
-
});
|
| 332 |
-
|
| 333 |
-
// Typing indicator
|
| 334 |
-
let typingTimeout;
|
| 335 |
-
messageInput.addEventListener('input', function() {
|
| 336 |
-
// Show typing indicator
|
| 337 |
-
typingIndicator.classList.remove('hidden');
|
| 338 |
|
| 339 |
-
//
|
| 340 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
|
| 342 |
-
//
|
| 343 |
-
|
| 344 |
-
typingIndicator.classList.add('hidden');
|
| 345 |
-
}, 2000);
|
| 346 |
-
});
|
| 347 |
-
|
| 348 |
-
// Render all messages
|
| 349 |
-
function renderMessages() {
|
| 350 |
-
messagesContainer.innerHTML = '';
|
| 351 |
-
messages.forEach(message => {
|
| 352 |
-
renderMessage(message);
|
| 353 |
-
});
|
| 354 |
-
scrollToBottom();
|
| 355 |
}
|
| 356 |
|
| 357 |
-
//
|
| 358 |
-
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
const messageElement = document.createElement('div');
|
| 363 |
-
messageElement.className = `message-animation flex ${isCurrentUser ? 'justify-end' : 'justify-start'}`;
|
| 364 |
|
| 365 |
-
|
| 366 |
-
if (
|
| 367 |
-
|
| 368 |
-
if (
|
| 369 |
-
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
|
|
|
|
|
|
|
|
|
| 377 |
} else {
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
<i class="fas fa-file-alt text-2xl"></i>
|
| 381 |
-
<div>
|
| 382 |
-
<p class="text-sm font-medium">${message.file.name}</p>
|
| 383 |
-
<p class="text-xs text-gray-400">${formatFileSize(message.file.size)}</p>
|
| 384 |
-
</div>
|
| 385 |
-
</div>
|
| 386 |
-
`;
|
| 387 |
}
|
|
|
|
| 388 |
}
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
messagesContainer.appendChild(messageElement);
|
| 409 |
-
}
|
| 410 |
|
| 411 |
-
//
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
"I agree with you.",
|
| 421 |
-
"Thanks for letting me know!",
|
| 422 |
-
"Have you seen the latest updates?",
|
| 423 |
-
"Let's meet up soon!"
|
| 424 |
-
];
|
| 425 |
-
|
| 426 |
-
const randomUser = users[Math.floor(Math.random() * (users.length - 1)) + 1];
|
| 427 |
-
const randomReply = replies[Math.floor(Math.random() * replies.length)];
|
| 428 |
-
|
| 429 |
-
// Show typing indicator
|
| 430 |
-
typingIndicator.classList.remove('hidden');
|
| 431 |
-
|
| 432 |
-
setTimeout(() => {
|
| 433 |
-
// Hide typing indicator
|
| 434 |
-
typingIndicator.classList.add('hidden');
|
| 435 |
-
|
| 436 |
-
// Create new message
|
| 437 |
-
const newMessage = {
|
| 438 |
-
id: messages.length + 1,
|
| 439 |
-
userId: randomUser.id,
|
| 440 |
-
text: randomReply,
|
| 441 |
-
timestamp: new Date().getTime()
|
| 442 |
-
};
|
| 443 |
-
|
| 444 |
-
// Add to messages array
|
| 445 |
-
messages.push(newMessage);
|
| 446 |
-
|
| 447 |
-
// Save to localStorage
|
| 448 |
-
localStorage.setItem('chatMessages', JSON.stringify(messages));
|
| 449 |
-
|
| 450 |
-
// Render new message
|
| 451 |
-
renderMessage(newMessage);
|
| 452 |
-
|
| 453 |
-
// Scroll to bottom
|
| 454 |
-
scrollToBottom();
|
| 455 |
-
}, 1500);
|
| 456 |
-
}
|
| 457 |
|
| 458 |
-
//
|
| 459 |
-
function
|
| 460 |
-
|
| 461 |
-
|
|
|
|
| 462 |
}
|
| 463 |
|
| 464 |
-
//
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
}
|
| 468 |
|
| 469 |
-
//
|
| 470 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 471 |
});
|
| 472 |
</script>
|
| 473 |
<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=pcudima/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Linux Terminal Emulator (Multi-language)</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 |
+
@keyframes blink {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
0%, 100% { opacity: 1; }
|
| 12 |
+
50% { opacity: 0; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
}
|
| 14 |
+
.cursor-blink {
|
| 15 |
+
animation: blink 1s step-end infinite;
|
|
|
|
| 16 |
}
|
| 17 |
+
.terminal-output {
|
| 18 |
+
height: calc(100% - 60px);
|
| 19 |
+
overflow-y: auto;
|
| 20 |
+
scrollbar-width: thin;
|
| 21 |
}
|
| 22 |
+
.terminal-output::-webkit-scrollbar {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
width: 6px;
|
| 24 |
}
|
| 25 |
+
.terminal-output::-webkit-scrollbar-thumb {
|
| 26 |
+
background-color: rgba(255,255,255,0.2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
border-radius: 3px;
|
| 28 |
}
|
| 29 |
+
.command-history {
|
| 30 |
+
max-height: 200px;
|
| 31 |
+
overflow-y: auto;
|
| 32 |
+
}
|
| 33 |
</style>
|
| 34 |
</head>
|
| 35 |
+
<body class="bg-gray-900 text-gray-100 h-screen flex flex-col">
|
| 36 |
+
<!-- Window Frame -->
|
| 37 |
+
<div class="bg-gray-800 rounded-t-lg shadow-lg flex flex-col h-full max-w-6xl mx-auto">
|
| 38 |
+
<!-- Title Bar -->
|
| 39 |
+
<div class="bg-gray-700 rounded-t-lg px-4 py-2 flex items-center justify-between">
|
| 40 |
+
<div class="flex items-center space-x-2">
|
| 41 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 42 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 43 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 44 |
</div>
|
| 45 |
+
<div class="text-sm font-mono">
|
| 46 |
+
user@linux-terminal: ~
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
</div>
|
| 48 |
+
<div class="flex items-center">
|
| 49 |
+
<select id="language-select" class="bg-gray-600 text-white text-xs rounded px-2 py-1">
|
| 50 |
+
<option value="en">English</option>
|
| 51 |
+
<option value="ru">Русский</option>
|
| 52 |
+
<option value="de">Deutsch</option>
|
| 53 |
+
<option value="fr">Français</option>
|
| 54 |
+
<option value="uk">Українська</option>
|
| 55 |
+
<option value="be">Беларуская</option>
|
| 56 |
+
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
</div>
|
| 58 |
+
</div>
|
| 59 |
|
| 60 |
+
<!-- Terminal Body -->
|
| 61 |
+
<div class="flex-1 flex flex-col p-4 overflow-hidden">
|
| 62 |
+
<!-- Terminal Output -->
|
| 63 |
+
<div class="terminal-output font-mono text-green-400 mb-4 space-y-2" id="terminal-output">
|
| 64 |
+
<div>Linux Terminal Emulator v1.0</div>
|
| 65 |
+
<div>Type 'help' to see available commands</div>
|
| 66 |
+
<div class="mt-4">user@linux-terminal:~$ <span class="text-white">Welcome to the Linux terminal emulator!</span></div>
|
| 67 |
+
</div>
|
| 68 |
|
| 69 |
+
<!-- Input Area -->
|
| 70 |
+
<div class="mt-auto">
|
| 71 |
+
<div class="flex items-center">
|
| 72 |
+
<span class="text-green-400 font-mono">user@linux-terminal:~$</span>
|
| 73 |
+
<div class="flex-1 ml-2 relative">
|
| 74 |
+
<input type="text" id="command-input"
|
| 75 |
+
class="bg-transparent border-none outline-none text-white font-mono w-full caret-green-400"
|
| 76 |
+
autofocus
|
| 77 |
+
placeholder="Type command...">
|
| 78 |
+
<span id="cursor" class="cursor-blink bg-green-400 w-2 h-5 absolute -ml-2"></span>
|
| 79 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
</div>
|
| 81 |
+
<div id="command-history" class="command-history hidden mt-2 bg-gray-800 rounded p-2 font-mono text-sm"></div>
|
| 82 |
</div>
|
| 83 |
</div>
|
| 84 |
+
|
| 85 |
+
<!-- Status Bar -->
|
| 86 |
+
<div class="bg-gray-700 px-4 py-1 text-xs font-mono flex justify-between">
|
| 87 |
+
<div>Bash</div>
|
| 88 |
+
<div id="time-display">00:00:00</div>
|
| 89 |
+
<div>UTF-8</div>
|
| 90 |
+
</div>
|
| 91 |
</div>
|
| 92 |
|
| 93 |
<script>
|
| 94 |
+
// Translation dictionary
|
| 95 |
+
const translations = {
|
| 96 |
+
en: {
|
| 97 |
+
welcomeTitle: "Linux Terminal Emulator v1.0",
|
| 98 |
+
helpPrompt: "Type 'help' to see available commands",
|
| 99 |
+
welcomeMessage: "Welcome to the Linux terminal emulator!",
|
| 100 |
+
helpText: `Available commands:
|
| 101 |
+
help - Show this help message
|
| 102 |
+
clear - Clear the terminal
|
| 103 |
+
ls - List directory contents
|
| 104 |
+
pwd - Print working directory
|
| 105 |
+
whoami - Show current user
|
| 106 |
+
date - Show current date and time
|
| 107 |
+
echo [text] - Display text
|
| 108 |
+
neofetch - Display system information
|
| 109 |
+
history - Show command history`,
|
| 110 |
+
lsOutput: "Desktop Documents Downloads Music Pictures Videos",
|
| 111 |
+
pwdOutput: "/home/user",
|
| 112 |
+
whoamiOutput: "user",
|
| 113 |
+
notFound: "Command not found: {cmd}. Type 'help' for available commands.",
|
| 114 |
+
noHistory: "No commands in history"
|
| 115 |
+
},
|
| 116 |
+
ru: {
|
| 117 |
+
welcomeTitle: "Эмулятор терминала Linux v1.0",
|
| 118 |
+
helpPrompt: "Введите 'help' для списка команд",
|
| 119 |
+
welcomeMessage: "Добро пожаловать в эмулятор терминала Linux!",
|
| 120 |
+
helpText: `Доступные команды:
|
| 121 |
+
help - Показать это сообщение
|
| 122 |
+
clear - Очистить терминал
|
| 123 |
+
ls - Список содержимого каталога
|
| 124 |
+
pwd - Текущий рабочий каталог
|
| 125 |
+
whoami - Текущий пользователь
|
| 126 |
+
date - Текущая дата и время
|
| 127 |
+
echo [текст] - Вывести текст
|
| 128 |
+
neofetch - Информация о системе
|
| 129 |
+
history - История команд`,
|
| 130 |
+
lsOutput: "РабочийСтол Документы Загрузки Музыка Изображения Видео",
|
| 131 |
+
pwdOutput: "/home/user",
|
| 132 |
+
whoamiOutput: "user",
|
| 133 |
+
notFound: "Команда не найдена: {cmd}. Введите 'help' для списка команд.",
|
| 134 |
+
noHistory: "Нет истории команд"
|
| 135 |
+
},
|
| 136 |
+
de: {
|
| 137 |
+
welcomeTitle: "Linux Terminal Emulator v1.0",
|
| 138 |
+
helpPrompt: "Geben Sie 'help' ein, um verfügbare Befehle zu sehen",
|
| 139 |
+
welcomeMessage: "Willkommen beim Linux Terminal Emulator!",
|
| 140 |
+
helpText: `Verfügbare Befehle:
|
| 141 |
+
help - Diese Hilfe anzeigen
|
| 142 |
+
clear - Terminal leeren
|
| 143 |
+
ls - Verzeichnisinhalt auflisten
|
| 144 |
+
pwd - Aktuelles Arbeitsverzeichnis
|
| 145 |
+
whoami - Aktueller Benutzer
|
| 146 |
+
date - Aktuelles Datum und Uhrzeit
|
| 147 |
+
echo [text] - Text anzeigen
|
| 148 |
+
neofetch - Systeminformationen
|
| 149 |
+
history - Befehlsverlauf`,
|
| 150 |
+
lsOutput: "Desktop Dokumente Downloads Musik Bilder Videos",
|
| 151 |
+
pwdOutput: "/home/user",
|
| 152 |
+
whoamiOutput: "user",
|
| 153 |
+
notFound: "Befehl nicht gefunden: {cmd}. Geben Sie 'help' für verfügbare Befehle ein.",
|
| 154 |
+
noHistory: "Kein Befehlsverlauf"
|
| 155 |
+
},
|
| 156 |
+
fr: {
|
| 157 |
+
welcomeTitle: "Émulateur de terminal Linux v1.0",
|
| 158 |
+
helpPrompt: "Tapez 'help' pour voir les commandes disponibles",
|
| 159 |
+
welcomeMessage: "Bienvenue dans l'émulateur de terminal Linux!",
|
| 160 |
+
helpText: `Commandes disponibles:
|
| 161 |
+
help - Afficher ce message d'aide
|
| 162 |
+
clear - Effacer le terminal
|
| 163 |
+
ls - Lister le contenu du répertoire
|
| 164 |
+
pwd - Répertoire de travail actuel
|
| 165 |
+
whoami - Utilisateur actuel
|
| 166 |
+
date - Date et heure actuelles
|
| 167 |
+
echo [texte] - Afficher du texte
|
| 168 |
+
neofetch - Informations système
|
| 169 |
+
history - Historique des commandes`,
|
| 170 |
+
lsOutput: "Bureau Documents Téléchargements Musique Images Vidéos",
|
| 171 |
+
pwdOutput: "/home/user",
|
| 172 |
+
whoamiOutput: "user",
|
| 173 |
+
notFound: "Commande non trouvée: {cmd}. Tapez 'help' pour les commandes disponibles.",
|
| 174 |
+
noHistory: "Pas d'historique de commandes"
|
| 175 |
+
},
|
| 176 |
+
uk: {
|
| 177 |
+
welcomeTitle: "Емулятор терміналу Linux v1.0",
|
| 178 |
+
helpPrompt: "Введіть 'help' для списку команд",
|
| 179 |
+
welcomeMessage: "Ласкаво просимо до емулятора терміналу Linux!",
|
| 180 |
+
helpText: `Доступні команди:
|
| 181 |
+
help - Показати це повідомлення
|
| 182 |
+
clear - Очистити термінал
|
| 183 |
+
ls - Список вмісту каталогу
|
| 184 |
+
pwd - Поточний робочий каталог
|
| 185 |
+
whoami - Поточний користувач
|
| 186 |
+
date - Поточна дата та час
|
| 187 |
+
echo [текст] - Вивести текст
|
| 188 |
+
neofetch - Інформація про систему
|
| 189 |
+
history - Історія команд`,
|
| 190 |
+
lsOutput: "РобочийСтіл Документи Завантаження Музика Зображення Відео",
|
| 191 |
+
pwdOutput: "/home/user",
|
| 192 |
+
whoamiOutput: "user",
|
| 193 |
+
notFound: "Команда не знайдена: {cmd}. Введіть 'help' для списку команд.",
|
| 194 |
+
noHistory: "Немає історії команд"
|
| 195 |
+
},
|
| 196 |
+
be: {
|
| 197 |
+
welcomeTitle: "Эмулятар тэрмінала Linux v1.0",
|
| 198 |
+
helpPrompt: "Увядзіце 'help' для спісу каманд",
|
| 199 |
+
welcomeMessage: "Сардэчна запрашаем у эмулятар тэрмінала Linux!",
|
| 200 |
+
helpText: `Даступныя каманды:
|
| 201 |
+
help - Паказаць гэта паведамленне
|
| 202 |
+
clear - Ачысціць тэрмінал
|
| 203 |
+
ls - Спіс змесціва каталога
|
| 204 |
+
pwd - Бягучы працоўны каталог
|
| 205 |
+
whoami - Бягучы карыстальнік
|
| 206 |
+
date - Бягучая дата і час
|
| 207 |
+
echo [тэкст] - Вывесці тэкст
|
| 208 |
+
neofetch - Інфармацыя пра сістэму
|
| 209 |
+
history - Гісторыя каманд`,
|
| 210 |
+
lsOutput: "ПрацоўныСтол Дакументы Спампаваныя Музыка Выявы Відэа",
|
| 211 |
+
pwdOutput: "/home/user",
|
| 212 |
+
whoamiOutput: "user",
|
| 213 |
+
notFound: "Каманда не знойдзена: {cmd}. Увядзіце 'help' для спісу каманд.",
|
| 214 |
+
noHistory: "Няма гісторыі каманд"
|
| 215 |
+
}
|
| 216 |
+
};
|
| 217 |
+
|
| 218 |
+
let currentLanguage = 'en';
|
| 219 |
+
|
| 220 |
+
function updateUITexts() {
|
| 221 |
+
const lang = translations[currentLanguage];
|
| 222 |
+
document.getElementById('welcome-title').textContent = lang.welcomeTitle;
|
| 223 |
+
document.getElementById('help-prompt').textContent = lang.helpPrompt;
|
| 224 |
+
document.getElementById('welcome-message').textContent = lang.welcomeMessage;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
document.addEventListener('DOMContentLoaded', function() {
|
| 228 |
+
const terminalOutput = document.getElementById('terminal-output');
|
| 229 |
+
const commandInput = document.getElementById('command-input');
|
| 230 |
+
const cursor = document.getElementById('cursor');
|
| 231 |
+
const commandHistory = document.getElementById('command-history');
|
| 232 |
+
const timeDisplay = document.getElementById('time-display');
|
|
|
|
| 233 |
|
| 234 |
+
let commandHistoryList = [];
|
| 235 |
+
let historyIndex = -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 236 |
|
| 237 |
+
// Update time
|
| 238 |
+
function updateTime() {
|
| 239 |
+
const now = new Date();
|
| 240 |
+
const timeString = now.toLocaleTimeString();
|
| 241 |
+
timeDisplay.textContent = timeString;
|
| 242 |
+
}
|
| 243 |
+
setInterval(updateTime, 1000);
|
| 244 |
+
updateTime();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
|
| 246 |
+
// Command processing
|
| 247 |
+
const commands = {
|
| 248 |
+
help: () => {
|
| 249 |
+
return translations[currentLanguage].helpText;
|
| 250 |
+
},
|
| 251 |
+
clear: () => {
|
| 252 |
+
terminalOutput.innerHTML = '';
|
| 253 |
+
return '';
|
| 254 |
+
},
|
| 255 |
+
ls: () => {
|
| 256 |
+
return translations[currentLanguage].lsOutput;
|
| 257 |
+
},
|
| 258 |
+
pwd: () => {
|
| 259 |
+
return translations[currentLanguage].pwdOutput;
|
| 260 |
+
},
|
| 261 |
+
whoami: () => {
|
| 262 |
+
return translations[currentLanguage].whoamiOutput;
|
| 263 |
+
},
|
| 264 |
+
date: () => {
|
| 265 |
+
return new Date().toString();
|
| 266 |
+
},
|
| 267 |
+
echo: (args) => {
|
| 268 |
+
return args.join(' ');
|
| 269 |
+
},
|
| 270 |
+
neofetch: () => {
|
| 271 |
+
return `
|
| 272 |
+
OS: Linux Terminal Emulator
|
| 273 |
+
Host: Web Browser
|
| 274 |
+
Kernel: 5.15.0-76-generic
|
| 275 |
+
Uptime: 2 hours, 15 mins
|
| 276 |
+
Shell: bash 5.0.17
|
| 277 |
+
Terminal: xterm-256color
|
| 278 |
+
CPU: Virtual CPU @ 2.5GHz
|
| 279 |
+
Memory: 1024MB / 2048MB
|
| 280 |
+
`.trim();
|
| 281 |
+
},
|
| 282 |
+
history: () => {
|
| 283 |
+
if (commandHistoryList.length === 0) return translations[currentLanguage].noHistory;
|
| 284 |
+
return commandHistoryList.map((cmd, i) => `${i + 1} ${cmd}`).join('\n');
|
| 285 |
}
|
| 286 |
+
};
|
| 287 |
|
| 288 |
+
// Process command
|
| 289 |
+
function processCommand(command) {
|
| 290 |
+
if (!command.trim()) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
+
// Add to history
|
| 293 |
+
commandHistoryList.push(command);
|
| 294 |
+
historyIndex = commandHistoryList.length;
|
| 295 |
+
|
| 296 |
+
// Create prompt line
|
| 297 |
+
const promptLine = document.createElement('div');
|
| 298 |
+
promptLine.className = 'text-green-400';
|
| 299 |
+
promptLine.textContent = `user@linux-terminal:~$ ${command}`;
|
| 300 |
+
terminalOutput.appendChild(promptLine);
|
|
|
|
| 301 |
|
| 302 |
+
// Parse command
|
| 303 |
+
const parts = command.split(' ');
|
| 304 |
+
const cmd = parts[0].toLowerCase();
|
| 305 |
+
const args = parts.slice(1);
|
| 306 |
+
|
| 307 |
+
// Process command
|
| 308 |
+
let output = '';
|
| 309 |
+
if (commands[cmd]) {
|
| 310 |
+
output = commands[cmd](args);
|
| 311 |
+
} else {
|
| 312 |
+
output = translations[currentLanguage].notFound.replace('{cmd}', cmd);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
|
| 315 |
+
// Display output
|
| 316 |
+
if (output) {
|
| 317 |
+
const outputElement = document.createElement('div');
|
| 318 |
+
outputElement.className = 'text-white';
|
| 319 |
+
outputElement.textContent = output;
|
| 320 |
+
terminalOutput.appendChild(outputElement);
|
| 321 |
+
}
|
| 322 |
|
| 323 |
+
// Scroll to bottom
|
| 324 |
+
terminalOutput.scrollTop = terminalOutput.scrollHeight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
}
|
| 326 |
|
| 327 |
+
// Input handling
|
| 328 |
+
commandInput.addEventListener('keydown', function(e) {
|
| 329 |
+
// Hide history when typing
|
| 330 |
+
commandHistory.classList.add('hidden');
|
|
|
|
|
|
|
|
|
|
| 331 |
|
| 332 |
+
// Up arrow - previous command
|
| 333 |
+
if (e.key === 'ArrowUp' && commandHistoryList.length > 0) {
|
| 334 |
+
e.preventDefault();
|
| 335 |
+
if (historyIndex > 0) historyIndex--;
|
| 336 |
+
if (historyIndex >= 0) {
|
| 337 |
+
commandInput.value = commandHistoryList[historyIndex];
|
| 338 |
+
moveCursorToEnd();
|
| 339 |
+
}
|
| 340 |
+
}
|
| 341 |
+
// Down arrow - next command
|
| 342 |
+
else if (e.key === 'ArrowDown' && commandHistoryList.length > 0) {
|
| 343 |
+
e.preventDefault();
|
| 344 |
+
if (historyIndex < commandHistoryList.length - 1) {
|
| 345 |
+
historyIndex++;
|
| 346 |
+
commandInput.value = commandHistoryList[historyIndex];
|
| 347 |
} else {
|
| 348 |
+
historyIndex = commandHistoryList.length;
|
| 349 |
+
commandInput.value = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
}
|
| 351 |
+
moveCursorToEnd();
|
| 352 |
}
|
| 353 |
+
// Tab - show history
|
| 354 |
+
else if (e.key === 'Tab') {
|
| 355 |
+
e.preventDefault();
|
| 356 |
+
if (commandHistoryList.length > 0) {
|
| 357 |
+
commandHistory.innerHTML = commandHistoryList.map(cmd =>
|
| 358 |
+
`<div class="py-1 px-2 hover:bg-gray-700 cursor-pointer">${cmd}</div>`
|
| 359 |
+
).join('');
|
| 360 |
+
commandHistory.classList.remove('hidden');
|
| 361 |
+
}
|
| 362 |
+
}
|
| 363 |
+
// Enter - execute command
|
| 364 |
+
else if (e.key === 'Enter') {
|
| 365 |
+
e.preventDefault();
|
| 366 |
+
const command = commandInput.value;
|
| 367 |
+
commandInput.value = '';
|
| 368 |
+
processCommand(command);
|
| 369 |
+
}
|
| 370 |
+
});
|
|
|
|
|
|
|
|
|
|
| 371 |
|
| 372 |
+
// Click on history item
|
| 373 |
+
commandHistory.addEventListener('click', function(e) {
|
| 374 |
+
if (e.target !== commandHistory) {
|
| 375 |
+
commandInput.value = e.target.textContent;
|
| 376 |
+
commandHistory.classList.add('hidden');
|
| 377 |
+
commandInput.focus();
|
| 378 |
+
moveCursorToEnd();
|
| 379 |
+
}
|
| 380 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
|
| 382 |
+
// Move cursor to end of input
|
| 383 |
+
function moveCursorToEnd() {
|
| 384 |
+
setTimeout(() => {
|
| 385 |
+
commandInput.selectionStart = commandInput.selectionEnd = commandInput.value.length;
|
| 386 |
+
}, 0);
|
| 387 |
}
|
| 388 |
|
| 389 |
+
// Focus input when clicking anywhere in terminal
|
| 390 |
+
document.querySelector('.terminal-output').addEventListener('click', function() {
|
| 391 |
+
commandInput.focus();
|
| 392 |
+
});
|
| 393 |
|
| 394 |
+
// Language change handler
|
| 395 |
+
document.getElementById('language-select').addEventListener('change', function() {
|
| 396 |
+
currentLanguage = this.value;
|
| 397 |
+
updateUITexts();
|
| 398 |
+
});
|
| 399 |
+
|
| 400 |
+
// Initial focus
|
| 401 |
+
commandInput.focus();
|
| 402 |
+
updateUITexts();
|
| 403 |
});
|
| 404 |
</script>
|
| 405 |
<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=pcudima/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|