Mxytyu commited on
Commit
605885b
·
verified ·
1 Parent(s): 442293c

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +284 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Chatting Page
3
- emoji: 🌖
4
- colorFrom: red
5
- colorTo: green
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: chatting-page
3
+ emoji: 🐳
4
+ colorFrom: yellow
5
+ colorTo: purple
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,284 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>Berwart AI</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 pulse {
11
+ 0%, 100% { opacity: 1; }
12
+ 50% { opacity: 0.5; }
13
+ }
14
+ .typing-indicator span {
15
+ animation: pulse 1.5s infinite;
16
+ }
17
+ .typing-indicator span:nth-child(2) {
18
+ animation-delay: 0.2s;
19
+ }
20
+ .typing-indicator span:nth-child(3) {
21
+ animation-delay: 0.4s;
22
+ }
23
+ .chat-container {
24
+ height: calc(100vh - 120px);
25
+ }
26
+ .message {
27
+ max-width: 85%;
28
+ }
29
+ @media (min-width: 768px) {
30
+ .message {
31
+ max-width: 70%;
32
+ }
33
+ }
34
+ .user-message {
35
+ border-radius: 18px 18px 0 18px;
36
+ }
37
+ .bot-message {
38
+ border-radius: 18px 18px 18px 0;
39
+ }
40
+ .gradient-bg {
41
+ background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
42
+ }
43
+ .message-input {
44
+ transition: all 0.2s;
45
+ }
46
+ .message-input:focus {
47
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
48
+ }
49
+ .logo-badge {
50
+ position: fixed;
51
+ top: 10px;
52
+ left: 10px;
53
+ z-index: 10;
54
+ }
55
+ </style>
56
+ </head>
57
+ <body class="bg-gray-50 font-sans">
58
+ <!-- Small floating logo badge -->
59
+ <div class="logo-badge">
60
+ <div class="flex items-center space-x-2 bg-white/90 backdrop-blur-sm p-2 rounded-full shadow-sm">
61
+ <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/65f468a2f5c466261a1a7de0/PqrFg6XNtSyhSBY1sdyMf.png"
62
+ alt="Berwart Logo"
63
+ class="h-8 w-8 rounded-full object-cover border-2 border-blue-100">
64
+ <span class="text-sm font-medium text-gray-700 pr-2 hidden sm:block">Berwart AI</span>
65
+ </div>
66
+ </div>
67
+
68
+ <div class="flex flex-col h-screen">
69
+ <!-- Chat Container -->
70
+ <div class="chat-container container mx-auto p-4 overflow-y-auto flex-1 pt-4">
71
+ <div class="space-y-4" id="chat-messages">
72
+ <!-- Welcome message -->
73
+ <div class="flex">
74
+ <div class="message bot-message bg-white p-4 shadow-sm">
75
+ <div class="flex items-start space-x-3">
76
+ <div class="flex-shrink-0">
77
+ <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/65f468a2f5c466261a1a7de0/PqrFg6XNtSyhSBY1sdyMf.png"
78
+ alt="Berwart AI"
79
+ class="h-9 w-9 rounded-full">
80
+ </div>
81
+ <div>
82
+ <p class="text-gray-700 mt-1">Hello! I'm here to help you with anything about Berwart. How can I assist you today?</p>
83
+ <div class="mt-3 flex flex-wrap gap-2">
84
+ <button class="suggestion-btn text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded-full hover:bg-blue-100 transition">
85
+ What services does Berwart offer?
86
+ </button>
87
+ <button class="suggestion-btn text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded-full hover:bg-blue-100 transition">
88
+ How can I contact support?
89
+ </button>
90
+ <button class="suggestion-btn text-xs bg-blue-50 text-blue-600 px-3 py-1.5 rounded-full hover:bg-blue-100 transition">
91
+ Tell me about your company
92
+ </button>
93
+ </div>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </div>
99
+ </div>
100
+
101
+ <!-- Input Area -->
102
+ <div class="bg-white border-t border-gray-200 p-4">
103
+ <div class="container mx-auto">
104
+ <div class="flex items-center space-x-2">
105
+ <button class="p-3 text-gray-500 hover:text-gray-700 rounded-full hover:bg-gray-100 transition hidden sm:block">
106
+ <i class="fas fa-paperclip"></i>
107
+ </button>
108
+ <div class="flex-1 relative">
109
+ <textarea id="message-input"
110
+ class="message-input w-full border border-gray-200 rounded-full py-3 px-4 pr-12 focus:outline-none focus:ring-0 focus:border-blue-300 resize-none bg-gray-50"
111
+ placeholder="Type your message..."
112
+ rows="1"></textarea>
113
+ <button class="absolute right-3 bottom-3 text-gray-500 hover:text-blue-500 transition hidden sm:block">
114
+ <i class="far fa-smile"></i>
115
+ </button>
116
+ </div>
117
+ <button id="send-btn" class="p-3 bg-blue-600 text-white rounded-full hover:bg-blue-700 transition">
118
+ <i class="fas fa-paper-plane"></i>
119
+ </button>
120
+ </div>
121
+ <div class="mt-2 text-xs text-gray-500 text-center">
122
+ Berwart AI may produce inaccurate information. Verify important details.
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+
128
+ <script>
129
+ document.addEventListener('DOMContentLoaded', function() {
130
+ const messageInput = document.getElementById('message-input');
131
+ const sendBtn = document.getElementById('send-btn');
132
+ const chatMessages = document.getElementById('chat-messages');
133
+ const suggestionBtns = document.querySelectorAll('.suggestion-btn');
134
+
135
+ // Auto-resize textarea
136
+ messageInput.addEventListener('input', function() {
137
+ this.style.height = 'auto';
138
+ this.style.height = (this.scrollHeight) + 'px';
139
+ });
140
+
141
+ // Send message on Enter key (but allow Shift+Enter for new lines)
142
+ messageInput.addEventListener('keydown', function(e) {
143
+ if (e.key === 'Enter' && !e.shiftKey) {
144
+ e.preventDefault();
145
+ sendMessage();
146
+ }
147
+ });
148
+
149
+ // Send message on button click
150
+ sendBtn.addEventListener('click', sendMessage);
151
+
152
+ // Quick suggestion buttons
153
+ suggestionBtns.forEach(btn => {
154
+ btn.addEventListener('click', function() {
155
+ messageInput.value = this.textContent.trim();
156
+ messageInput.focus();
157
+ messageInput.style.height = 'auto';
158
+ messageInput.style.height = (messageInput.scrollHeight) + 'px';
159
+ });
160
+ });
161
+
162
+ function sendMessage() {
163
+ const message = messageInput.value.trim();
164
+ if (message === '') return;
165
+
166
+ // Add user message to chat
167
+ addMessage(message, 'user');
168
+ messageInput.value = '';
169
+ messageInput.style.height = 'auto';
170
+
171
+ // Show typing indicator
172
+ showTypingIndicator();
173
+
174
+ // Simulate AI response after a delay
175
+ setTimeout(() => {
176
+ removeTypingIndicator();
177
+ const response = getAIResponse(message);
178
+ addMessage(response, 'bot');
179
+ }, 800 + Math.random() * 1500); // Random delay between 0.8-2.3 seconds
180
+ }
181
+
182
+ function addMessage(text, sender) {
183
+ const messageDiv = document.createElement('div');
184
+ messageDiv.className = 'flex';
185
+ messageDiv.style.justifyContent = sender === 'user' ? 'flex-end' : 'flex-start';
186
+
187
+ const messageContent = `
188
+ <div class="message ${sender}-message ${sender === 'user' ? 'bg-blue-600 text-white' : 'bg-white'} p-4 shadow-sm">
189
+ ${sender === 'bot' ? `
190
+ <div class="flex items-start space-x-3">
191
+ <div class="flex-shrink-0">
192
+ <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/65f468a2f5c466261a1a7de0/PqrFg6XNtSyhSBY1sdyMf.png"
193
+ alt="Berwart AI"
194
+ class="h-9 w-9 rounded-full">
195
+ </div>
196
+ <div>
197
+ <p class="text-gray-700">${text}</p>
198
+ </div>
199
+ </div>
200
+ ` : `
201
+ <div class="flex items-start space-x-3">
202
+ <div>
203
+ <p>${text}</p>
204
+ </div>
205
+ <div class="flex-shrink-0">
206
+ <div class="h-9 w-9 rounded-full bg-blue-500 text-white flex items-center justify-center">
207
+ <i class="fas fa-user"></i>
208
+ </div>
209
+ </div>
210
+ </div>
211
+ `}
212
+ </div>
213
+ `;
214
+
215
+ messageDiv.innerHTML = messageContent;
216
+ chatMessages.appendChild(messageDiv);
217
+ chatMessages.scrollTop = chatMessages.scrollHeight;
218
+ }
219
+
220
+ function showTypingIndicator() {
221
+ const typingDiv = document.createElement('div');
222
+ typingDiv.className = 'flex';
223
+ typingDiv.id = 'typing-indicator';
224
+
225
+ typingDiv.innerHTML = `
226
+ <div class="message bot-message bg-white p-4 shadow-sm">
227
+ <div class="flex items-start space-x-3">
228
+ <div class="flex-shrink-0">
229
+ <img src="https://cdn-avatars.huggingface.co/v1/production/uploads/65f468a2f5c466261a1a7de0/PqrFg6XNtSyhSBY1sdyMf.png"
230
+ alt="Berwart AI"
231
+ class="h-9 w-9 rounded-full">
232
+ </div>
233
+ <div>
234
+ <div class="typing-indicator flex space-x-1.5 items-center">
235
+ <span class="h-2.5 w-2.5 bg-gray-400 rounded-full"></span>
236
+ <span class="h-2.5 w-2.5 bg-gray-400 rounded-full"></span>
237
+ <span class="h-2.5 w-2.5 bg-gray-400 rounded-full"></span>
238
+ </div>
239
+ </div>
240
+ </div>
241
+ </div>
242
+ `;
243
+
244
+ chatMessages.appendChild(typingDiv);
245
+ chatMessages.scrollTop = chatMessages.scrollHeight;
246
+ }
247
+
248
+ function removeTypingIndicator() {
249
+ const typingIndicator = document.getElementById('typing-indicator');
250
+ if (typingIndicator) {
251
+ typingIndicator.remove();
252
+ }
253
+ }
254
+
255
+ // Enhanced AI response logic
256
+ function getAIResponse(message) {
257
+ const lowerMessage = message.toLowerCase();
258
+
259
+ if (lowerMessage.includes('hello') || lowerMessage.includes('hi') || lowerMessage.includes('hey')) {
260
+ return "Hello! 👋 I'm Berwart's AI assistant. How can I help you today?";
261
+ } else if (lowerMessage.includes('service') || lowerMessage.includes('offer') || lowerMessage.includes('provide')) {
262
+ return "Berwart specializes in AI-powered solutions for businesses:\n\n• AI Consulting & Strategy\n• Custom Machine Learning Models\n• Natural Language Processing\n• Computer Vision Systems\n• Predictive Analytics\n\nWe help companies transform their operations with cutting-edge AI technology.";
263
+ } else if (lowerMessage.includes('contact') || lowerMessage.includes('support') || lowerMessage.includes('help')) {
264
+ return "You can reach our team through:\n\n📧 Email: [email protected]\n📞 Phone: +1 (555) 123-4567\n📍 Office: 123 AI Avenue, Tech City\n\nOur support hours are Mon-Fri, 9AM-5PM (EST).";
265
+ } else if (lowerMessage.includes('company') || lowerMessage.includes('about') || lowerMessage.includes('berwart')) {
266
+ return "Berwart is an AI innovation leader founded in 2018. We're on a mission to democratize AI for businesses of all sizes. Our team of 150+ experts has delivered 300+ successful AI implementations across various industries.\n\nCore values:\n• Innovation\n• Integrity\n• Impact";
267
+ } else if (lowerMessage.includes('thank') || lowerMessage.includes('thanks')) {
268
+ return "You're very welcome! 😊 Let me know if there's anything else I can help with.";
269
+ } else if (lowerMessage.includes('price') || lowerMessage.includes('cost')) {
270
+ return "Our pricing depends on the scope and complexity of each project. We offer:\n\n• Custom quotes for enterprise solutions\n• Standard packages for common use cases\n• Pilot programs for testing AI feasibility\n\nWould you like me to connect you with our sales team for a personalized quote?";
271
+ } else {
272
+ const genericResponses = [
273
+ "I've noted your question about: " + message + ". Let me provide the most relevant information...",
274
+ "That's an interesting question about " + message.split(' ')[0] + ". Here's what I can share...",
275
+ "I want to make sure I understand correctly. Could you elaborate on what you mean by \"" + message + "\"?",
276
+ "I'm still learning about all aspects of Berwart's operations. Could you rephrase your question or try asking something different?"
277
+ ];
278
+ return genericResponses[Math.floor(Math.random() * genericResponses.length)];
279
+ }
280
+ }
281
+ });
282
+ </script>
283
+ <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=Mxytyu/chatting-page" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
284
+ </html>