MaxLeft commited on
Commit
edddafb
·
verified ·
1 Parent(s): 2369fdf

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +439 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Catgpt
3
- emoji: 📉
4
- colorFrom: red
5
- colorTo: gray
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: catgpt
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: blue
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,439 @@
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>Cat GPT - The Purr-fect AI for Felines</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 float {
11
+ 0% { transform: translateY(0px); }
12
+ 50% { transform: translateY(-10px); }
13
+ 100% { transform: translateY(0px); }
14
+ }
15
+ .floating {
16
+ animation: float 3s ease-in-out infinite;
17
+ }
18
+ .cat-ears {
19
+ position: relative;
20
+ }
21
+ .cat-ears::before, .cat-ears::after {
22
+ content: '';
23
+ position: absolute;
24
+ top: -20px;
25
+ width: 0;
26
+ height: 0;
27
+ border-style: solid;
28
+ }
29
+ .cat-ears::before {
30
+ left: 10px;
31
+ border-width: 0 15px 20px 15px;
32
+ border-color: transparent transparent #f97316 transparent;
33
+ }
34
+ .cat-ears::after {
35
+ right: 10px;
36
+ border-width: 0 15px 20px 15px;
37
+ border-color: transparent transparent #f97316 transparent;
38
+ }
39
+ .typing-indicator::after {
40
+ content: '...';
41
+ position: absolute;
42
+ animation: blink 1.5s infinite;
43
+ }
44
+ @keyframes blink {
45
+ 0%, 100% { opacity: 1; }
46
+ 50% { opacity: 0.5; }
47
+ }
48
+ .message-tail {
49
+ position: relative;
50
+ }
51
+ .message-tail::after {
52
+ content: '';
53
+ position: absolute;
54
+ bottom: 0;
55
+ left: -10px;
56
+ width: 0;
57
+ height: 0;
58
+ border-style: solid;
59
+ border-width: 0 0 15px 15px;
60
+ border-color: transparent transparent #fef3c7 transparent;
61
+ }
62
+ .cat-scroll::-webkit-scrollbar {
63
+ width: 8px;
64
+ }
65
+ .cat-scroll::-webkit-scrollbar-track {
66
+ background: #ffedd5;
67
+ border-radius: 10px;
68
+ }
69
+ .cat-scroll::-webkit-scrollbar-thumb {
70
+ background: #f59e0b;
71
+ border-radius: 10px;
72
+ }
73
+ </style>
74
+ </head>
75
+ <body class="bg-amber-50 min-h-screen">
76
+ <div class="container mx-auto px-4 py-8 max-w-4xl">
77
+ <!-- Header with cat ears -->
78
+ <header class="cat-ears bg-orange-500 text-white rounded-t-2xl p-6 text-center relative">
79
+ <h1 class="text-4xl font-bold mb-2">Cat GPT</h1>
80
+ <p class="text-amber-100">The purr-fect AI companion for your feline friend</p>
81
+ <div class="absolute top-4 right-4">
82
+ <span class="bg-amber-200 text-amber-800 text-xs font-semibold px-2.5 py-0.5 rounded-full">BETA</span>
83
+ </div>
84
+ </header>
85
+
86
+ <!-- Chat container -->
87
+ <div class="bg-white rounded-b-2xl shadow-lg overflow-hidden">
88
+ <!-- Chat messages area -->
89
+ <div id="chat-messages" class="cat-scroll h-96 p-4 overflow-y-auto space-y-4">
90
+ <!-- Welcome message -->
91
+ <div class="flex justify-start">
92
+ <div class="flex-shrink-0 h-10 w-10 rounded-full bg-amber-200 flex items-center justify-center">
93
+ <i class="fas fa-cat text-amber-700"></i>
94
+ </div>
95
+ <div class="ml-3 message-tail">
96
+ <div class="bg-amber-100 rounded-lg py-2 px-4">
97
+ <p class="text-sm text-gray-800">Meow! Welcome to Cat GPT! I'm your feline AI assistant. You can talk to me in English or meows! <span class="text-xs text-amber-600">(Sometimes I respond in meows too!)</span></p>
98
+ </div>
99
+ <p class="text-xs text-gray-500 mt-1">Just now</p>
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ <!-- Input area -->
105
+ <div class="border-t border-amber-200 p-4 bg-amber-50">
106
+ <div class="flex items-center">
107
+ <div class="flex-grow relative">
108
+ <input
109
+ id="user-input"
110
+ type="text"
111
+ placeholder="Type your message or meow here..."
112
+ class="w-full px-4 py-3 rounded-full border-2 border-amber-200 focus:border-amber-400 focus:outline-none bg-white text-gray-800 pr-12"
113
+ >
114
+ <button
115
+ id="meow-btn"
116
+ class="absolute right-3 top-1/2 transform -translate-y-1/2 bg-amber-200 hover:bg-amber-300 text-amber-800 rounded-full p-2 transition"
117
+ title="Insert random meow"
118
+ >
119
+ <i class="fas fa-paw"></i>
120
+ </button>
121
+ </div>
122
+ <button
123
+ id="send-btn"
124
+ class="ml-3 bg-orange-500 hover:bg-orange-600 text-white rounded-full p-3 transition transform hover:scale-105"
125
+ >
126
+ <i class="fas fa-paper-plane"></i>
127
+ </button>
128
+ </div>
129
+ <div class="mt-2 flex justify-between items-center">
130
+ <div class="text-xs text-amber-600">
131
+ <span id="meow-counter">0 meows today</span>
132
+ </div>
133
+ <button
134
+ id="translate-btn"
135
+ class="text-xs bg-amber-200 hover:bg-amber-300 text-amber-800 px-2 py-1 rounded-full flex items-center"
136
+ >
137
+ <i class="fas fa-language mr-1"></i> Toggle Translation
138
+ </button>
139
+ </div>
140
+ </div>
141
+ </div>
142
+
143
+ <!-- Fun cat facts footer -->
144
+ <div class="mt-8 bg-white rounded-xl shadow-md p-4">
145
+ <div class="flex items-center">
146
+ <div class="flex-shrink-0 h-8 w-8 rounded-full bg-amber-200 flex items-center justify-center">
147
+ <i class="fas fa-info-circle text-amber-700 text-sm"></i>
148
+ </div>
149
+ <div class="ml-3">
150
+ <p class="text-sm text-gray-800" id="cat-fact">Did you know? Cats have a specialized collarbone that allows them to always land on their feet!</p>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <!-- Floating cat decoration -->
156
+ <div class="fixed bottom-4 right-4 floating">
157
+ <div class="bg-orange-400 rounded-full p-3 shadow-lg">
158
+ <i class="fas fa-cat text-white text-2xl"></i>
159
+ </div>
160
+ </div>
161
+ </div>
162
+
163
+ <script>
164
+ document.addEventListener('DOMContentLoaded', function() {
165
+ const chatMessages = document.getElementById('chat-messages');
166
+ const userInput = document.getElementById('user-input');
167
+ const sendBtn = document.getElementById('send-btn');
168
+ const meowBtn = document.getElementById('meow-btn');
169
+ const translateBtn = document.getElementById('translate-btn');
170
+ const meowCounter = document.getElementById('meow-counter');
171
+ const catFact = document.getElementById('cat-fact');
172
+
173
+ let meowCount = 0;
174
+ let translateMode = false;
175
+ let isTyping = false;
176
+
177
+ // Cat facts array
178
+ const catFacts = [
179
+ "Cats spend 70% of their lives sleeping. That's 16 hours a day!",
180
+ "A cat's nose has a unique pattern, much like a human fingerprint.",
181
+ "Cats can rotate their ears 180 degrees to better locate sounds.",
182
+ "The oldest known pet cat existed 9,500 years ago in Cyprus.",
183
+ "Cats walk like camels and giraffes - they move both right feet first, then both left feet.",
184
+ "A cat's purr vibrates at a frequency of 25 to 150 Hertz, which can promote healing!",
185
+ "Cats have whiskers on the backs of their front legs as well as their faces.",
186
+ "The world's richest cat is worth $13 million after inheriting from his owner."
187
+ ];
188
+
189
+ // Meow variations
190
+ const meows = [
191
+ "Meow", "Mrow", "Mrrp", "Mew", "Prrt", "Meee", "Mao", "Mrao",
192
+ "Meowww", "Mrow?", "Mew?", "Meow!", "Mreee", "Mrrr", "Mewww", "Miau"
193
+ ];
194
+
195
+ // Cat responses (some in meows, some in English)
196
+ const catResponses = [
197
+ "Purr... I'm listening. Tell me more.",
198
+ "Meow meow mrow! (Translation: That sounds fascinating!)",
199
+ "I would chase that thought if it were a red dot!",
200
+ "Mew mew prrt. (Translation: I need more treats to process that.)",
201
+ "Have you considered taking a nap? It solves most problems.",
202
+ "Mrrp? (Translation: Can you explain that in simpler terms?)",
203
+ "I'm just a cat, but even I know that's a great idea!",
204
+ "Meowwwww! (Translation: That reminds me of the time I knocked over a vase!)",
205
+ "Is this about food? It's always about food.",
206
+ "Prrt prrt! (Translation: You're my favorite human!)",
207
+ "I could help, but I'm currently busy napping.",
208
+ "Mrow mrow meow? (Translation: Did you see that bird outside?)",
209
+ "Let me think about it... after this nap.",
210
+ "Meow! (Translation: Absolutely!)",
211
+ "Mew... (Translation: I'm not so sure about that.)",
212
+ "That sounds like a problem for Future Cat. Right now I'm busy."
213
+ ];
214
+
215
+ // Random cat fact generator
216
+ function showRandomCatFact() {
217
+ const randomFact = catFacts[Math.floor(Math.random() * catFacts.length)];
218
+ catFact.textContent = `Did you know? ${randomFact}`;
219
+ }
220
+
221
+ // Show a new cat fact every 15 seconds
222
+ showRandomCatFact();
223
+ setInterval(showRandomCatFact, 15000);
224
+
225
+ // Add a message to the chat
226
+ function addMessage(content, isUser = false) {
227
+ const messageDiv = document.createElement('div');
228
+ messageDiv.className = `flex ${isUser ? 'justify-end' : 'justify-start'}`;
229
+
230
+ const avatar = document.createElement('div');
231
+ avatar.className = `flex-shrink-0 h-10 w-10 rounded-full ${isUser ? 'bg-orange-200' : 'bg-amber-200'} flex items-center justify-center`;
232
+
233
+ const avatarIcon = document.createElement('i');
234
+ avatarIcon.className = `fas ${isUser ? 'fa-user' : 'fa-cat'} ${isUser ? 'text-orange-700' : 'text-amber-700'}`;
235
+ avatar.appendChild(avatarIcon);
236
+
237
+ const messageContent = document.createElement('div');
238
+ messageContent.className = `${isUser ? 'mr-3' : 'ml-3'} ${!isUser ? 'message-tail' : ''}`;
239
+
240
+ const messageBubble = document.createElement('div');
241
+ messageBubble.className = `rounded-lg py-2 px-4 ${isUser ? 'bg-orange-100' : 'bg-amber-100'}`;
242
+
243
+ const messageText = document.createElement('p');
244
+ messageText.className = `text-sm ${isUser ? 'text-gray-800' : 'text-gray-800'}`;
245
+ messageText.textContent = content;
246
+
247
+ const messageTime = document.createElement('p');
248
+ messageTime.className = `text-xs text-gray-500 mt-1`;
249
+
250
+ // Format current time
251
+ const now = new Date();
252
+ const hours = now.getHours().toString().padStart(2, '0');
253
+ const minutes = now.getMinutes().toString().padStart(2, '0');
254
+ messageTime.textContent = `${hours}:${minutes}`;
255
+
256
+ messageBubble.appendChild(messageText);
257
+ messageContent.appendChild(messageBubble);
258
+ messageContent.appendChild(messageTime);
259
+
260
+ if (isUser) {
261
+ messageDiv.appendChild(messageContent);
262
+ messageDiv.appendChild(avatar);
263
+ } else {
264
+ messageDiv.appendChild(avatar);
265
+ messageDiv.appendChild(messageContent);
266
+ }
267
+
268
+ chatMessages.appendChild(messageDiv);
269
+ chatMessages.scrollTop = chatMessages.scrollHeight;
270
+ }
271
+
272
+ // Generate a random meow
273
+ function generateMeow() {
274
+ const meowCount = Math.floor(Math.random() * 3) + 1;
275
+ let meow = '';
276
+
277
+ for (let i = 0; i < meowCount; i++) {
278
+ const randomMeow = meows[Math.floor(Math.random() * meows.length)];
279
+ meow += randomMeow;
280
+
281
+ // Add space or punctuation
282
+ if (i < meowCount - 1) {
283
+ meow += ' ';
284
+ } else {
285
+ // 30% chance to end with ?
286
+ if (Math.random() < 0.3) {
287
+ meow += '?';
288
+ }
289
+ // 30% chance to end with !
290
+ else if (Math.random() < 0.3) {
291
+ meow += '!';
292
+ }
293
+ // 20% chance to end with ...
294
+ else if (Math.random() < 0.2) {
295
+ meow += '...';
296
+ }
297
+ }
298
+ }
299
+
300
+ return meow;
301
+ }
302
+
303
+ // Get a cat response
304
+ function getCatResponse(userMessage) {
305
+ // Check if message contains meows
306
+ const isMeow = /meow|mew|mrow|miau|prrt|mrrp/i.test(userMessage);
307
+
308
+ // 40% chance to respond with meows if user sent meows
309
+ if (isMeow && Math.random() < 0.4) {
310
+ return generateMeow();
311
+ }
312
+ // 20% chance to respond with meows for any message
313
+ else if (Math.random() < 0.2) {
314
+ return generateMeow();
315
+ }
316
+ // Otherwise respond with a random cat response
317
+ else {
318
+ return catResponses[Math.floor(Math.random() * catResponses.length)];
319
+ }
320
+ }
321
+
322
+ // Simulate typing indicator
323
+ function showTypingIndicator() {
324
+ if (isTyping) return;
325
+
326
+ isTyping = true;
327
+
328
+ const typingDiv = document.createElement('div');
329
+ typingDiv.className = 'flex justify-start';
330
+
331
+ const avatar = document.createElement('div');
332
+ avatar.className = 'flex-shrink-0 h-10 w-10 rounded-full bg-amber-200 flex items-center justify-center';
333
+
334
+ const avatarIcon = document.createElement('i');
335
+ avatarIcon.className = 'fas fa-cat text-amber-700';
336
+ avatar.appendChild(avatarIcon);
337
+
338
+ const typingContent = document.createElement('div');
339
+ typingContent.className = 'ml-3 message-tail';
340
+
341
+ const typingBubble = document.createElement('div');
342
+ typingBubble.className = 'bg-amber-100 rounded-lg py-2 px-4 typing-indicator';
343
+ typingBubble.id = 'typing-indicator';
344
+
345
+ typingContent.appendChild(typingBubble);
346
+
347
+ typingDiv.appendChild(avatar);
348
+ typingDiv.appendChild(typingContent);
349
+
350
+ chatMessages.appendChild(typingDiv);
351
+ chatMessages.scrollTop = chatMessages.scrollHeight;
352
+ }
353
+
354
+ // Hide typing indicator
355
+ function hideTypingIndicator() {
356
+ const indicator = document.getElementById('typing-indicator');
357
+ if (indicator) {
358
+ indicator.parentElement.parentElement.remove();
359
+ }
360
+ isTyping = false;
361
+ }
362
+
363
+ // Process user input
364
+ function processInput() {
365
+ const message = userInput.value.trim();
366
+ if (message === '') return;
367
+
368
+ // Check if message is a meow
369
+ const isMeow = /meow|mew|mrow|miau|prrt|mrrp/i.test(message);
370
+ if (isMeow) {
371
+ meowCount++;
372
+ meowCounter.textContent = `${meowCount} meow${meowCount !== 1 ? 's' : ''} today`;
373
+ }
374
+
375
+ addMessage(message, true);
376
+ userInput.value = '';
377
+
378
+ // Show typing indicator
379
+ showTypingIndicator();
380
+
381
+ // Simulate AI thinking time (1-3 seconds)
382
+ const thinkingTime = Math.random() * 2000 + 1000;
383
+
384
+ setTimeout(() => {
385
+ hideTypingIndicator();
386
+
387
+ // Get cat response
388
+ const response = getCatResponse(message);
389
+
390
+ // If in translate mode and response is meows, show translation
391
+ if (translateMode && /meow|mew|mrow|miau|prrt|mrrp/i.test(response)) {
392
+ // Find translation in responses array
393
+ const translatedResponse = catResponses.find(r =>
394
+ r.toLowerCase().includes(response.toLowerCase()) &&
395
+ r.includes('Translation:')
396
+ );
397
+
398
+ if (translatedResponse) {
399
+ addMessage(response);
400
+ // Show translation after a delay
401
+ setTimeout(() => {
402
+ addMessage(translatedResponse.match(/\(Translation: (.*?)\)/)[1]);
403
+ }, 1000);
404
+ } else {
405
+ addMessage(response);
406
+ }
407
+ } else {
408
+ addMessage(response);
409
+ }
410
+ }, thinkingTime);
411
+ }
412
+
413
+ // Event listeners
414
+ sendBtn.addEventListener('click', processInput);
415
+
416
+ userInput.addEventListener('keypress', function(e) {
417
+ if (e.key === 'Enter') {
418
+ processInput();
419
+ }
420
+ });
421
+
422
+ meowBtn.addEventListener('click', function() {
423
+ const randomMeow = generateMeow();
424
+ const currentInput = userInput.value;
425
+ userInput.value = currentInput ? `${currentInput} ${randomMeow}` : randomMeow;
426
+ userInput.focus();
427
+ });
428
+
429
+ translateBtn.addEventListener('click', function() {
430
+ translateMode = !translateMode;
431
+ translateBtn.classList.toggle('bg-amber-300');
432
+ translateBtn.innerHTML = translateMode
433
+ ? '<i class="fas fa-language mr-1"></i> Translation ON'
434
+ : '<i class="fas fa-language mr-1"></i> Translation OFF';
435
+ });
436
+ });
437
+ </script>
438
+ <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=MaxLeft/catgpt" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
439
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Give me a website called "Cat GPT" which is a joke version of chat GPT but specfically made for cats. It should be playful and fun. Sometimes the chat should only respond in meows. It should understand meows. Sometimes it should respond in english. Sometimes meows.