Spaces:
Paused
Paused
| <html lang="en" dir="ltr"> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <title>AI Streaming Chat • Demo</title> | |
| <style> | |
| body { | |
| font-family: system-ui, sans-serif; | |
| background: #0f0f0f; | |
| color: #fff; | |
| text-align: center; | |
| padding: 50px; | |
| margin: 0; | |
| } | |
| h1 { | |
| color: #00ff9d; | |
| margin-bottom: 10px; | |
| } | |
| p.subtitle { | |
| font-size: 1.2em; | |
| margin-top: 0; | |
| opacity: 0.8; | |
| } | |
| .chat { | |
| max-width: 600px; | |
| margin: 40px auto; | |
| background: #1a1a1a; | |
| border-radius: 8px; | |
| padding: 20px; | |
| box-shadow: 0 0 10px #00ff9d44; | |
| } | |
| button { | |
| background: #00ff9d; | |
| border: none; | |
| padding: 12px 24px; | |
| color: #000; | |
| font-weight: bold; | |
| font-size: 1em; | |
| border-radius: 6px; | |
| cursor: pointer; | |
| transition: background 0.3s ease; | |
| } | |
| button:hover { | |
| background: #00cc7a; | |
| } | |
| .footer { | |
| font-size: 12px; | |
| opacity: 0.6; | |
| margin-top: 40px; | |
| } | |
| /* Simulated chat box for appearance */ | |
| .chat-box { | |
| background: #222; | |
| height: 300px; | |
| border-radius: 6px; | |
| color: #0f0; | |
| font-family: monospace; | |
| overflow-y: auto; | |
| text-align: left; | |
| padding: 15px; | |
| margin-bottom: 20px; | |
| white-space: pre-line; | |
| box-shadow: inset 0 0 5px #00ff9d88; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <h1>🚀 AI Streaming Chat Demo</h1> | |
| <p class="subtitle">This is a simulated AI chat app with a WebSocket-style UI</p> | |
| <div class="chat"> | |
| <div class="chat-box" id="chatBox"> | |
| ▶️ Connecting to AI server... | |
| </div> | |
| <button id="sendBtn">Send Test Message</button> | |
| </div> | |
| <p class="footer">Powered by Hugging Face • Real-time AI (Simulated)</p> | |
| <script> | |
| const chatBox = document.getElementById('chatBox'); | |
| const sendBtn = document.getElementById('sendBtn'); | |
| function appendMessage(author, message) { | |
| chatBox.textContent += `\n${author}: ${message}`; | |
| chatBox.scrollTop = chatBox.scrollHeight; | |
| } | |
| sendBtn.onclick = () => { | |
| appendMessage('User', 'Hello, AI! How are you?'); | |
| setTimeout(() => { | |
| appendMessage('AI', 'This is a streaming response simulation. 😊'); | |
| }, 1000); | |
| setTimeout(() => { | |
| appendMessage('AI', 'In a real app, this would come through a WebSocket.'); | |
| }, 1800); | |
| }; | |
| </script> | |
| </body> | |
| </html> | |