Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +6 -4
- index.html +255 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: pink
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: chrome
|
| 3 |
+
emoji: 🐳
|
| 4 |
colorFrom: pink
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,255 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AI Chatbot Interface</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 |
+
/* Custom scrollbar */
|
| 11 |
+
.chat-container::-webkit-scrollbar {
|
| 12 |
+
width: 8px;
|
| 13 |
+
}
|
| 14 |
+
.chat-container::-webkit-scrollbar-track {
|
| 15 |
+
background: #f1f1f1;
|
| 16 |
+
border-radius: 10px;
|
| 17 |
+
}
|
| 18 |
+
.chat-container::-webkit-scrollbar-thumb {
|
| 19 |
+
background: #cbd5e0;
|
| 20 |
+
border-radius: 10px;
|
| 21 |
+
}
|
| 22 |
+
.chat-container::-webkit-scrollbar-thumb:hover {
|
| 23 |
+
background: #a0aec0;
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
/* Animation for new messages */
|
| 27 |
+
@keyframes fadeIn {
|
| 28 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 29 |
+
to { opacity: 1; transform: translateY(0); }
|
| 30 |
+
}
|
| 31 |
+
.message {
|
| 32 |
+
animation: fadeIn 0.3s ease-out;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
/* Typing indicator animation */
|
| 36 |
+
@keyframes blink {
|
| 37 |
+
0%, 100% { opacity: 1; }
|
| 38 |
+
50% { opacity: 0.5; }
|
| 39 |
+
}
|
| 40 |
+
.typing-dot {
|
| 41 |
+
animation: blink 1.5s infinite;
|
| 42 |
+
}
|
| 43 |
+
.typing-dot:nth-child(2) {
|
| 44 |
+
animation-delay: 0.2s;
|
| 45 |
+
}
|
| 46 |
+
.typing-dot:nth-child(3) {
|
| 47 |
+
animation-delay: 0.4s;
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
</head>
|
| 51 |
+
<body class="bg-gray-100 min-h-screen flex flex-col">
|
| 52 |
+
<header class="bg-indigo-600 text-white shadow-md">
|
| 53 |
+
<div class="container mx-auto px-4 py-4 flex items-center justify-between">
|
| 54 |
+
<div class="flex items-center space-x-3">
|
| 55 |
+
<i class="fas fa-robot text-2xl"></i>
|
| 56 |
+
<h1 class="text-xl font-bold">AI Assistant</h1>
|
| 57 |
+
</div>
|
| 58 |
+
<div class="flex space-x-4">
|
| 59 |
+
<button class="p-2 rounded-full hover:bg-indigo-500 transition">
|
| 60 |
+
<i class="fas fa-cog"></i>
|
| 61 |
+
</button>
|
| 62 |
+
<button class="p-2 rounded-full hover:bg-indigo-500 transition">
|
| 63 |
+
<i class="fas fa-question-circle"></i>
|
| 64 |
+
</button>
|
| 65 |
+
</div>
|
| 66 |
+
</div>
|
| 67 |
+
</header>
|
| 68 |
+
|
| 69 |
+
<main class="flex-grow container mx-auto px-4 py-6 flex flex-col">
|
| 70 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden flex flex-col flex-grow max-w-4xl mx-auto w-full">
|
| 71 |
+
<!-- Chat messages container -->
|
| 72 |
+
<div class="chat-container flex-grow p-4 overflow-y-auto max-h-[70vh]">
|
| 73 |
+
<!-- Welcome message -->
|
| 74 |
+
<div class="message mb-4 flex">
|
| 75 |
+
<div class="flex-shrink-0 mr-3">
|
| 76 |
+
<div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center">
|
| 77 |
+
<i class="fas fa-robot"></i>
|
| 78 |
+
</div>
|
| 79 |
+
</div>
|
| 80 |
+
<div class="flex-grow">
|
| 81 |
+
<div class="bg-indigo-50 rounded-lg p-3 inline-block">
|
| 82 |
+
<p class="font-medium text-indigo-800">AI Assistant</p>
|
| 83 |
+
<p class="text-gray-700">Hello! I'm your AI assistant. How can I help you today?</p>
|
| 84 |
+
</div>
|
| 85 |
+
<p class="text-xs text-gray-500 mt-1">Today at <span id="current-time"></span></p>
|
| 86 |
+
</div>
|
| 87 |
+
</div>
|
| 88 |
+
|
| 89 |
+
<!-- Sample conversation -->
|
| 90 |
+
<div class="message mb-4 flex justify-end">
|
| 91 |
+
<div class="flex-grow max-w-xs md:max-w-md lg:max-w-lg">
|
| 92 |
+
<div class="bg-indigo-600 text-white rounded-lg p-3 inline-block float-right">
|
| 93 |
+
<p class="text-sm">What can you do?</p>
|
| 94 |
+
</div>
|
| 95 |
+
<p class="text-xs text-gray-500 mt-1 text-right">Just now</p>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
|
| 99 |
+
<div class="message mb-4 flex">
|
| 100 |
+
<div class="flex-shrink-0 mr-3">
|
| 101 |
+
<div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center">
|
| 102 |
+
<i class="fas fa-robot"></i>
|
| 103 |
+
</div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="flex-grow">
|
| 106 |
+
<div class="bg-indigo-50 rounded-lg p-3 inline-block">
|
| 107 |
+
<p class="font-medium text-indigo-800">AI Assistant</p>
|
| 108 |
+
<p class="text-gray-700">I can answer questions, help with programming (including C language), explain concepts, and assist with various topics. Try asking me something!</p>
|
| 109 |
+
</div>
|
| 110 |
+
<p class="text-xs text-gray-500 mt-1">Just now</p>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
|
| 114 |
+
<!-- Typing indicator (hidden by default) -->
|
| 115 |
+
<div id="typing-indicator" class="hidden mb-4 flex">
|
| 116 |
+
<div class="flex-shrink-0 mr-3">
|
| 117 |
+
<div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center">
|
| 118 |
+
<i class="fas fa-robot"></i>
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
<div class="flex items-center bg-indigo-50 rounded-lg p-3">
|
| 122 |
+
<div class="flex space-x-1 px-2">
|
| 123 |
+
<div class="typing-dot w-2 h-2 bg-gray-500 rounded-full"></div>
|
| 124 |
+
<div class="typing-dot w-2 h-2 bg-gray-500 rounded-full"></div>
|
| 125 |
+
<div class="typing-dot w-2 h-2 bg-gray-500 rounded-full"></div>
|
| 126 |
+
</div>
|
| 127 |
+
</div>
|
| 128 |
+
</div>
|
| 129 |
+
</div>
|
| 130 |
+
|
| 131 |
+
<!-- Input area -->
|
| 132 |
+
<div class="border-t border-gray-200 p-4 bg-gray-50">
|
| 133 |
+
<form id="chat-form" class="flex space-x-2">
|
| 134 |
+
<div class="flex-grow relative">
|
| 135 |
+
<input
|
| 136 |
+
type="text"
|
| 137 |
+
id="user-input"
|
| 138 |
+
placeholder="Type your message here..."
|
| 139 |
+
class="w-full px-4 py-3 rounded-full border border-gray-300 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:border-transparent"
|
| 140 |
+
autocomplete="off"
|
| 141 |
+
>
|
| 142 |
+
<button type="button" class="absolute right-3 top-3 text-gray-400 hover:text-indigo-600">
|
| 143 |
+
<i class="far fa-smile"></i>
|
| 144 |
+
</button>
|
| 145 |
+
</div>
|
| 146 |
+
<button
|
| 147 |
+
type="submit"
|
| 148 |
+
class="bg-indigo-600 text-white rounded-full w-12 h-12 flex items-center justify-center hover:bg-indigo-700 transition"
|
| 149 |
+
>
|
| 150 |
+
<i class="fas fa-paper-plane"></i>
|
| 151 |
+
</button>
|
| 152 |
+
</form>
|
| 153 |
+
<p class="text-xs text-gray-500 mt-2 text-center">This is a frontend demo. For C integration, you would need server-side processing.</p>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
</main>
|
| 157 |
+
|
| 158 |
+
<footer class="bg-white border-t border-gray-200 py-4">
|
| 159 |
+
<div class="container mx-auto px-4 text-center text-gray-500 text-sm">
|
| 160 |
+
<p>AI Chatbot Interface Demo | Not connected to actual C backend</p>
|
| 161 |
+
</div>
|
| 162 |
+
</footer>
|
| 163 |
+
|
| 164 |
+
<script>
|
| 165 |
+
// Display current time in welcome message
|
| 166 |
+
const now = new Date();
|
| 167 |
+
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
| 168 |
+
document.getElementById('current-time').textContent = timeString;
|
| 169 |
+
|
| 170 |
+
// Simple chat functionality
|
| 171 |
+
const chatForm = document.getElementById('chat-form');
|
| 172 |
+
const userInput = document.getElementById('user-input');
|
| 173 |
+
const chatContainer = document.querySelector('.chat-container');
|
| 174 |
+
const typingIndicator = document.getElementById('typing-indicator');
|
| 175 |
+
|
| 176 |
+
// Sample responses
|
| 177 |
+
const responses = [
|
| 178 |
+
"I understand you're asking about C programming. Would you like help with pointers, memory management, or something else?",
|
| 179 |
+
"That's an interesting question! Could you provide more details?",
|
| 180 |
+
"For C programming, remember to always initialize your variables and check for null pointers.",
|
| 181 |
+
"I can simulate what a C backend might respond with. In a real implementation, this would connect to your C program.",
|
| 182 |
+
"If this were connected to a C backend, it would process your input and return a response."
|
| 183 |
+
];
|
| 184 |
+
|
| 185 |
+
chatForm.addEventListener('submit', function(e) {
|
| 186 |
+
e.preventDefault();
|
| 187 |
+
const message = userInput.value.trim();
|
| 188 |
+
|
| 189 |
+
if (message) {
|
| 190 |
+
// Add user message to chat
|
| 191 |
+
addMessage(message, 'user');
|
| 192 |
+
userInput.value = '';
|
| 193 |
+
|
| 194 |
+
// Show typing indicator
|
| 195 |
+
typingIndicator.classList.remove('hidden');
|
| 196 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 197 |
+
|
| 198 |
+
// Simulate bot response after a delay
|
| 199 |
+
setTimeout(() => {
|
| 200 |
+
typingIndicator.classList.add('hidden');
|
| 201 |
+
const randomResponse = responses[Math.floor(Math.random() * responses.length)];
|
| 202 |
+
addMessage(randomResponse, 'bot');
|
| 203 |
+
}, 1000 + Math.random() * 2000); // Random delay between 1-3 seconds
|
| 204 |
+
}
|
| 205 |
+
});
|
| 206 |
+
|
| 207 |
+
function addMessage(text, sender) {
|
| 208 |
+
const now = new Date();
|
| 209 |
+
const timeString = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
| 210 |
+
|
| 211 |
+
if (sender === 'user') {
|
| 212 |
+
const messageHTML = `
|
| 213 |
+
<div class="message mb-4 flex justify-end">
|
| 214 |
+
<div class="flex-grow max-w-xs md:max-w-md lg:max-w-lg">
|
| 215 |
+
<div class="bg-indigo-600 text-white rounded-lg p-3 inline-block float-right">
|
| 216 |
+
<p class="text-sm">${text}</p>
|
| 217 |
+
</div>
|
| 218 |
+
<p class="text-xs text-gray-500 mt-1 text-right">${timeString}</p>
|
| 219 |
+
</div>
|
| 220 |
+
</div>
|
| 221 |
+
`;
|
| 222 |
+
chatContainer.insertAdjacentHTML('beforeend', messageHTML);
|
| 223 |
+
} else {
|
| 224 |
+
const messageHTML = `
|
| 225 |
+
<div class="message mb-4 flex">
|
| 226 |
+
<div class="flex-shrink-0 mr-3">
|
| 227 |
+
<div class="bg-indigo-100 text-indigo-800 rounded-full w-10 h-10 flex items-center justify-center">
|
| 228 |
+
<i class="fas fa-robot"></i>
|
| 229 |
+
</div>
|
| 230 |
+
</div>
|
| 231 |
+
<div class="flex-grow">
|
| 232 |
+
<div class="bg-indigo-50 rounded-lg p-3 inline-block">
|
| 233 |
+
<p class="font-medium text-indigo-800">AI Assistant</p>
|
| 234 |
+
<p class="text-gray-700">${text}</p>
|
| 235 |
+
</div>
|
| 236 |
+
<p class="text-xs text-gray-500 mt-1">${timeString}</p>
|
| 237 |
+
</div>
|
| 238 |
+
</div>
|
| 239 |
+
`;
|
| 240 |
+
chatContainer.insertAdjacentHTML('beforeend', messageHTML);
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 244 |
+
}
|
| 245 |
+
|
| 246 |
+
// Allow pressing Enter to submit (but Shift+Enter for new line)
|
| 247 |
+
userInput.addEventListener('keydown', function(e) {
|
| 248 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
| 249 |
+
e.preventDefault();
|
| 250 |
+
chatForm.dispatchEvent(new Event('submit'));
|
| 251 |
+
}
|
| 252 |
+
});
|
| 253 |
+
</script>
|
| 254 |
+
<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=kavyaganeshkumar/chrome" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 255 |
+
</html>
|