Download chat.html from moazelgen/undefined: direct link, hf CLI and curl.
- Browser
- Download file 5.03 kB
-
https://huggingface.co/spaces/moazelgen/undefined/resolve/main/chat.html
- Command line
-
hf download hf://spaces/moazelgen/undefined/chat.html
-
curl -L -o chat.html https://huggingface.co/spaces/moazelgen/undefined/resolve/main/chat.html
5.03 kB
| <html lang="en" class="scroll-smooth"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Cosmic Chatter</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap'); | |
| body { | |
| font-family: 'Space Grotesk', sans-serif; | |
| } | |
| .gradient-text { | |
| background: linear-gradient(90deg, #0ea5e9 0%, #8b5cf6 100%); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| } | |
| .chat-bubble { | |
| animation: fadeIn 0.3s ease-in-out; | |
| } | |
| @keyframes fadeIn { | |
| from { opacity: 0; transform: translateY(10px); } | |
| to { opacity: 1; transform: translateY(0); } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-900 text-white min-h-screen"> | |
| <div class="max-w-3xl mx-auto p-4"> | |
| <header class="py-6 border-b border-gray-700"> | |
| <h1 class="text-3xl font-bold gradient-text">المحادثة الكونية</h1> | |
| <p class="text-gray-400">رفيقك في المحادثات بين النجوم</p> | |
| </header> | |
| <div id="chat-container" class="h-[70vh] overflow-y-auto py-4 space-y-4"> | |
| <div class="chat-bubble bg-gray-800 p-4 rounded-lg max-w-[80%]"> | |
| <div class="flex items-center mb-2"> | |
| <div class="w-8 h-8 rounded-full bg-primary-500 flex items-center justify-center mr-2"> | |
| <i data-feather="star" class="w-4 h-4"></i> | |
| </div> | |
| <span class="font-bold">كوزمو</span> | |
| </div> | |
| <p class="text-gray-200">مرحباً أيها المسافر الفضائي! 🌌 كيف يمكنني مساعدتك اليوم؟</p> | |
| </div> | |
| </div> | |
| <div class="mt-4 flex gap-2"> | |
| <input type="text" id="user-input" placeholder="اكتب رسالتك هنا..." | |
| class="flex-1 bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 focus:outline-none focus:ring-2 focus:ring-primary-500"> | |
| <button id="send-btn" class="bg-primary-600 hover:bg-primary-700 px-6 py-3 rounded-lg font-medium transition-all"> | |
| <i data-feather="send"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <script> | |
| feather.replace(); | |
| const chatContainer = document.getElementById('chat-container'); | |
| const userInput = document.getElementById('user-input'); | |
| const sendBtn = document.getElementById('send-btn'); | |
| function addMessage(sender, text, isUser = false) { | |
| const bubble = document.createElement('div'); | |
| bubble.className = `chat-bubble bg-gray-800 p-4 rounded-lg max-w-[80%] ${isUser ? 'ml-auto bg-primary-900/30' : ''}`; | |
| if (!isUser) { | |
| bubble.innerHTML = ` | |
| <div class="flex items-center mb-2"> | |
| <div class="w-8 h-8 rounded-full bg-primary-500 flex items-center justify-center mr-2"> | |
| <i data-feather="star" class="w-4 h-4"></i> | |
| </div> | |
| <span class="font-bold">Cosmo</span> | |
| </div> | |
| `; | |
| } | |
| const textElement = document.createElement('p'); | |
| textElement.className = 'text-gray-200'; | |
| textElement.textContent = text; | |
| bubble.appendChild(textElement); | |
| chatContainer.appendChild(bubble); | |
| chatContainer.scrollTop = chatContainer.scrollHeight; | |
| feather.replace(); | |
| } | |
| sendBtn.addEventListener('click', () => { | |
| const message = userInput.value.trim(); | |
| if (message) { | |
| addMessage('You', message, true); | |
| userInput.value = ''; | |
| // Simulate bot response | |
| setTimeout(() => { | |
| const responses = [ | |
| "مثير للاهتمام! أخبرني المزيد عن ذلك.", | |
| "من منظوري الكوني، هذا مثير للاهتمام حقاً!", | |
| "أنا أحلل ذلك من خلال قاعدة بيانات النجوم الخاصة بي...", | |
| "دعني أستشير قاعدة المعرفة المجرية الخاصة بي...", | |
| "✨ هذا يذكرني بمجرة أندروميدا!" | |
| ]; | |
| addMessage('Cosmo', responses[Math.floor(Math.random() * responses.length)]); | |
| }, 1000); | |
| } | |
| }); | |
| userInput.addEventListener('keypress', (e) => { | |
| if (e.key === 'Enter') { | |
| sendBtn.click(); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |