File size: 23,315 Bytes
8d41005 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 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 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hugging Face Coding Assistant</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.message-animation {
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.typing-indicator::after {
content: '...';
animation: typing 1.5s infinite;
}
@keyframes typing {
0% { content: '.'; }
33% { content: '..'; }
66% { content: '...'; }
}
.code-block {
font-family: 'Courier New', monospace;
background-color: #2d3748;
color: #f7fafc;
border-radius: 0.375rem;
padding: 1rem;
overflow-x: auto;
}
.copy-btn {
transition: all 0.2s ease;
}
.copy-btn:hover {
background-color: #4a5568;
}
</style>
</head>
<body class="bg-gray-100 min-h-screen flex flex-col">
<!-- Header -->
<header class="bg-purple-700 text-white shadow-lg">
<div class="container mx-auto px-4 py-3 flex items-center justify-between">
<div class="flex items-center space-x-2">
<i class="fas fa-robot text-2xl"></i>
<h1 class="text-xl md:text-2xl font-bold">Hugging Face Coding Assistant</h1>
</div>
<div class="flex items-center space-x-4">
<button id="theme-toggle" class="p-2 rounded-full hover:bg-purple-600 transition">
<i class="fas fa-moon"></i>
</button>
<button id="clear-chat" class="px-3 py-1 bg-purple-600 rounded hover:bg-purple-500 transition">
<i class="fas fa-trash-alt mr-1"></i> Clear
</button>
</div>
</div>
</header>
<!-- Main Content -->
<main class="flex-1 container mx-auto px-4 py-6 flex flex-col md:flex-row gap-6">
<!-- Sidebar -->
<aside class="w-full md:w-64 bg-white rounded-lg shadow-md p-4 h-fit sticky top-6">
<div class="mb-6">
<h2 class="text-lg font-semibold text-gray-800 mb-2 flex items-center">
<i class="fas fa-cog mr-2 text-purple-600"></i> Quick Actions
</h2>
<div class="space-y-2">
<button class="quick-action-btn" data-prompt="Explain Python functions">
<i class="fas fa-code mr-2"></i> Python Help
</button>
<button class="quick-action-btn" data-prompt="Show me JavaScript array methods">
<i class="fab fa-js-square mr-2"></i> JavaScript Help
</button>
<button class="quick-action-btn" data-prompt="How to use Hugging Face models?">
<i class="fas fa-brain mr-2"></i> HF Models
</button>
<button class="quick-action-btn" data-prompt="Git commands cheat sheet">
<i class="fab fa-git-alt mr-2"></i> Git Help
</button>
</div>
</div>
<div>
<h2 class="text-lg font-semibold text-gray-800 mb-2 flex items-center">
<i class="fas fa-history mr-2 text-purple-600"></i> Recent Topics
</h2>
<div id="recent-topics" class="space-y-1">
<!-- Will be populated by JavaScript -->
</div>
</div>
</aside>
<!-- Chat Area -->
<section class="flex-1 flex flex-col bg-white rounded-lg shadow-md overflow-hidden">
<!-- Messages Container -->
<div id="messages" class="flex-1 p-4 overflow-y-auto space-y-4">
<!-- Welcome Message -->
<div class="message-animation bg-purple-100 rounded-lg p-4">
<div class="flex items-start">
<div class="flex-shrink-0 bg-purple-600 text-white rounded-full w-8 h-8 flex items-center justify-center mr-3">
<i class="fas fa-robot"></i>
</div>
<div>
<h3 class="font-semibold text-purple-800">Hugging Face Assistant</h3>
<p class="text-gray-700 mt-1">Hello! I'm your Hugging Face coding assistant. I can help with programming questions, explain concepts, debug code, and guide you through Hugging Face tools. What would you like to learn today?</p>
<div class="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-2">
<button class="suggestion-btn">Explain Python decorators</button>
<button class="suggestion-btn">How to fine-tune a model?</button>
<button class="suggestion-btn">Show React component example</button>
<button class="suggestion-btn">Debug this JavaScript code</button>
</div>
</div>
</div>
</div>
</div>
<!-- Input Area -->
<div class="border-t border-gray-200 p-4 bg-gray-50">
<form id="chat-form" class="flex items-center space-x-2">
<div class="flex-1 relative">
<input
id="user-input"
type="text"
placeholder="Ask me anything about coding or Hugging Face..."
class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
autocomplete="off"
>
<button type="button" id="voice-btn" class="absolute right-3 top-3 text-gray-400 hover:text-purple-600">
<i class="fas fa-microphone"></i>
</button>
</div>
<button type="submit" class="bg-purple-600 hover:bg-purple-700 text-white px-4 py-3 rounded-lg transition">
<i class="fas fa-paper-plane"></i>
</button>
</form>
<div class="mt-2 flex flex-wrap gap-2">
<span class="text-xs text-gray-500">Try:</span>
<button class="text-xs text-purple-600 hover:text-purple-800" data-prompt="How to use transformers library?">transformers</button>
<button class="text-xs text-purple-600 hover:text-purple-800" data-prompt="Explain async/await in JavaScript">async/await</button>
<button class="text-xs text-purple-600 hover:text-purple-800" data-prompt="Show pandas dataframe example">pandas</button>
<button class="text-xs text-purple-600 hover:text-purple-800" data-prompt="What is a neural network?">neural network</button>
</div>
</div>
</section>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-4">
<div class="container mx-auto px-4 text-center text-sm">
<p>Hugging Face Coding Assistant - Powered by AI models</p>
<p class="mt-1 text-gray-400">This is a demo interface. Not affiliated with Hugging Face.</p>
</div>
</footer>
<script>
</script>
<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=bditto5/hugging-face-code-assistant" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |