euychrue commited on
Commit
d1f45a6
·
verified ·
1 Parent(s): ebf5502

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +542 -19
index.html CHANGED
@@ -1,19 +1,542 @@
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="he" dir="rtl">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>צ'אאט בינה מל מלאכותית - ס סגנון צברי</title>
7
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
8
+ <style>
9
+ :root {
10
+ --primary-color: #0056b3;
11
+ --secondary-color: #ffd700;
12
+ --accent-color: #d40000;
13
+ --bg-color: #f5f5f5;
14
+ --chat-bg: #ffffff;
15
+ --text-color: #333;
16
+ --user-bubble: #e3f2fd;
17
+ --ai-bubble: #f1f1f1;
18
+ }
19
+
20
+ * {
21
+ margin: 0;
22
+ padding: 0;
23
+ box-sizing: border-box;
24
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
25
+ }
26
+
27
+ body {
28
+ background-color: var(--bg-color);
29
+ color: var(--text-color);
30
+ direction: rtl;
31
+ }
32
+
33
+ .header {
34
+ background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
35
+ color: white;
36
+ padding: 1rem;
37
+ text-align: center;
38
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
39
+ position: relative;
40
+ }
41
+
42
+ .header h1 {
43
+ font-size: 1.8rem;
44
+ margin-bottom: 0.5rem;
45
+ font-weight: bold;
46
+ }
47
+
48
+ .header p {
49
+ font-size: 0.9rem;
50
+ opacity: 0.9;
51
+ }
52
+
53
+ .header a {
54
+ position: absolute;
55
+ left: 1rem;
56
+ top: 50%;
57
+ transform: translateY(-50%);
58
+ color: white;
59
+ text-decoration: none;
60
+ font-size: 0.8rem;
61
+ }
62
+
63
+ .container {
64
+ max-width: 1000px;
65
+ margin: 0 auto;
66
+ padding: 1rem;
67
+ }
68
+
69
+ .chat-container {
70
+ background-color: var(--chat-bg);
71
+ border-radius: 10px;
72
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
73
+ overflow: hidden;
74
+ height: 70vh;
75
+ display: flex;
76
+ flex-direction: column;
77
+ }
78
+
79
+ .chat-messages {
80
+ flex: 1;
81
+ padding: 1rem;
82
+ overflow-y: auto;
83
+ display: flex;
84
+ flex-direction: column;
85
+ gap: 1rem;
86
+ }
87
+
88
+ .message {
89
+ max-width: 80%;
90
+ padding: 0.8rem 1rem;
91
+ border-radius: 15px;
92
+ line-height: 1.4;
93
+ position: relative;
94
+ animation: fadeIn 0.3s ease;
95
+ }
96
+
97
+ @keyframes fadeIn {
98
+ from { opacity: 0; transform: translateY(10px); }
99
+ to { opacity: 1; transform: translateY(0); }
100
+ }
101
+
102
+ .user-message {
103
+ align-self: flex-end;
104
+ background-color: var(--user-bubble);
105
+ border-bottom-right-radius: 5px;
106
+ color: #000;
107
+ font-weight: 500;
108
+ }
109
+
110
+ .ai-message {
111
+ align-self: flex-start;
112
+ background-color: var(--ai-bubble);
113
+ border-bottom-left-radius: 5px;
114
+ color: #000;
115
+ font-weight: bold;
116
+ }
117
+
118
+ .ai-message::before {
119
+ content: "🤖";
120
+ margin-left: 5px;
121
+ }
122
+
123
+ .user-message::before {
124
+ content: "👤";
125
+ margin-right: 5px;
126
+ }
127
+
128
+ .input-area {
129
+ display: flex;
130
+ padding: 1rem;
131
+ background-color: #fff;
132
+ border-top: 1px solid #eee;
133
+ gap: 0.5rem;
134
+ }
135
+
136
+ .input-area input {
137
+ flex: 1;
138
+ padding: 0.8rem 1rem;
139
+ border: 1px solid #ddd;
140
+ border-radius: 25px;
141
+ font-size: 1rem;
142
+ outline: none;
143
+ transition: border 0.3s;
144
+ }
145
+
146
+ .input-area input:focus {
147
+ border-color: var(--primary-color);
148
+ }
149
+
150
+ .input-area button {
151
+ background-color: var(--primary-color);
152
+ color: white;
153
+ border: none;
154
+ border-radius: 25px;
155
+ padding: 0 1.5rem;
156
+ cursor: pointer;
157
+ font-weight: bold;
158
+ transition: background 0.3s;
159
+ }
160
+
161
+ .input-area button:hover {
162
+ background-color: #003d82;
163
+ }
164
+
165
+ .file-upload {
166
+ position: relative;
167
+ width: 40px;
168
+ height: 40px;
169
+ display: flex;
170
+ align-items: center;
171
+ justify-content: center;
172
+ border-radius: 50%;
173
+ background-color: var(--secondary-color);
174
+ color: #333;
175
+ cursor: pointer;
176
+ }
177
+
178
+ .file-upload input {
179
+ position: absolute;
180
+ width: 100%;
181
+ height: 100%;
182
+ opacity: 0;
183
+ cursor: pointer;
184
+ }
185
+
186
+ .typing-indicator {
187
+ display: flex;
188
+ align-items: center;
189
+ gap: 5px;
190
+ padding: 0.5rem 1rem;
191
+ background-color: var(--ai-bubble);
192
+ border-radius: 15px;
193
+ align-self: flex-start;
194
+ margin-bottom: 0.5rem;
195
+ display: none;
196
+ }
197
+
198
+ .typing-dot {
199
+ width: 8px;
200
+ height: 8px;
201
+ background-color: #666;
202
+ border-radius: 50%;
203
+ animation: typingAnimation 1.4s infinite ease-in-out;
204
+ }
205
+
206
+ .typing-dot:nth-child(1) {
207
+ animation-delay: 0s;
208
+ }
209
+
210
+ .typing-dot:nth-child(2) {
211
+ animation-delay: 0.2s;
212
+ }
213
+
214
+ .typing-dot:nth-child(3) {
215
+ animation-delay: 0.4s;
216
+ }
217
+
218
+ @keyframes typingAnimation {
219
+ 0%, 60%, 100% { transform: translateY(0); }
220
+ 30% { transform: translateY(-5px); }
221
+ }
222
+
223
+ .uploaded-file {
224
+ display: inline-block;
225
+ margin-top: 0.5rem;
226
+ padding: 0.5rem;
227
+ background-color: rgba(0, 0, 0, 0.05);
228
+ border-radius: 5px;
229
+ font-size: 0.8rem;
230
+ }
231
+
232
+ .uploaded-file i {
233
+ margin-left: 5px;
234
+ }
235
+
236
+ .uploaded-image {
237
+ max-width: 200px;
238
+ max-height: 200px;
239
+ border-radius: 10px;
240
+ margin-top: 0.5rem;
241
+ cursor: pointer;
242
+ transition: transform 0.2s;
243
+ }
244
+
245
+ .uploaded-image:hover {
246
+ transform: scale(1.05);
247
+ }
248
+
249
+ @media (max-width: 768px) {
250
+ .chat-container {
251
+ height: 80vh;
252
+ }
253
+
254
+ .message {
255
+ max-width: 90%;
256
+ }
257
+
258
+ .input-area {
259
+ flex-direction: row;
260
+ align-items: center;
261
+ }
262
+
263
+ .file-upload {
264
+ width: 35px;
265
+ height: 35px;
266
+ }
267
+ }
268
+
269
+ /* Israeli style additions */
270
+ .ai-message {
271
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
272
+ font-weight: bold;
273
+ }
274
+
275
+ .bold-text {
276
+ font-weight: bold;
277
+ }
278
+
279
+ .punctuation {
280
+ color: var(--accent-color);
281
+ font-weight: bold;
282
+ }
283
+
284
+ .israeli-slang {
285
+ color: var(--primary-color);
286
+ font-style: italic;
287
+ }
288
+ </style>
289
+ </head>
290
+ <body>
291
+ <div class="header">
292
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">Built with anycoder</a>
293
+ <h1>צ'אט בינה מלאכותית ב בסגנון צברי! 🤖💬</h1>
294
+ <p>ששאל כל שאלה ו וקבל תשובה ב בסגנון ישראלי נוועז!</p>
295
+ </div>
296
+
297
+ <div class="container">
298
+ <div class="chat-container">
299
+ <div class="chat-messages" id="chat-messages">
300
+ <div class="ai-message">
301
+ <span class="bold-text">היי חבר! 👋</span> <span class="punctuation">!</span><br>
302
+ אני הבוט הצברי שלך, מו מוכן לע לעזור עם כל מה שא שאתה צריך <span class="israeli-slang">(גם אם זה קצת משוגע...)</span>.<br>
303
+ <span class="punctuation">??</span> <span class="bold-text">מה הבררנז'ה</span>
304
+ </div>
305
+ </div>
306
+
307
+ <div class="typing-indicator" id="typing-indicator">
308
+ <div class="typing-dot"></div>
309
+ <div class="typing-dot"></div>
310
+ <div class="typing-dot"></div>
311
+ </div>
312
+
313
+ <div class="input-area">
314
+ <div class="file-upload" title="העלאת קובובץ או תמונה">
315
+ <i class="fas fa-paperclip"></i>
316
+ <input type="file" id="file-input" accept=".txt,.pdf,.doc,.docx,.jpg,.jpeg,.png,.gif">
317
+ </div>
318
+ <input type="text" id="user-input" placeholder="כתוב כאן את ההודעה של שלך..." autocomplete="off">
319
+ <button id="send-button"><i class="fas fa-paper-plane"></i> של שלח</button>
320
+ </div>
321
+ </div>
322
+ </div>
323
+
324
+ <script>
325
+ document.addEventListener('DOMContentLoaded', function() {
326
+ const chatMessages = document.getElementById('chat-messages');
327
+ const userInput = document.getElementById('user-input');
328
+ const sendButton = document.getElementById('send-button');
329
+ const fileInput = document.getElementById('file-input');
330
+ const typingIndicator = document.getElementById('typing-indicator');
331
+
332
+ // Sample Israeli-style responses
333
+ const israeliResponses = [
334
+ "וואי אחי, איזה שאלה! 😎 ה הנה הת התשובה שלי:",
335
+ "תשמע, זה לא פ פשוט אבל א אנסה להסביר:",
336
+ "יאללה בוא נ נדבר על זה...",
337
+ "חחח, איזה כיף ש ששאלת! אז כ ככה:",
338
+ "וואו, שאלה מטורפת! ה הנה מה שאני חושב:",
339
+ "תראה, אני א אגיד לך את הא האמת...",
340
+ "בום! ה הנה הת התשובה של שלך:",
341
+ "נו טוב, בוא נ נטפל ב בזה...",
342
+ "סבבה, אני על זה! ה הנה מה שמ שמצאתי:",
343
+ "אוקיי, בוא ניגש לע לעניין..."
344
+ ];
345
+
346
+ // Sample Israeli slang words to sprinkle in responses
347
+ const israeliSlang = [
348
+ "אאחי", "סבבה", "יאללה", "חחח", "וואי", "נו", "תראה", "ברנז'ה",
349
+ "ממטורף", "כיף", "פצצה", "אש", "סתם", "חמוד", "מגניב", "פאדיחה"
350
+ ];
351
+
352
+ // Function to add punctuation for Israeli style
353
+ function addPunctuation(text) {
354
+ const punctuations = ["!", "?", "...", "!!", "??"];
355
+ // 30% chance to add punctuation at end
356
+ if (Math.random() < 0.3) {
357
+ return text + punctuations[Math.floor(Math.random() * punctuations.length)];
358
+ }
359
+ return text;
360
+ }
361
+
362
+ // Function to add bold text randomly
363
+ function addBold(text) {
364
+ const words = text.split(' ');
365
+ // 20% chance to make a word bold
366
+ return words.map(word =>
367
+ Math.random() < 0.2 ? `<span class="bold-text">${word}</span>` : word
368
+ ).join(' ');
369
+ }
370
+
371
+ // Function to add slang randomly
372
+ function addSlang(text) {
373
+ // 15% chance to add slang
374
+ if (Math.random() < 0.15) {
375
+ const slang = israeliSlang[Math.floor(Math.random() * israeliSlang.length)];
376
+ const positions = [
377
+ ` ${slang}, `,
378
+ ` ${slang}... `,
379
+ ` (${slang}) `,
380
+ ` - ${slang} - `
381
+ ];
382
+ const position = positions[Math.floor(Math.random() * positions.length)];
383
+ const insertAt = Math.floor(Math.random() * text.length);
384
+ return text.slice(0, insertAt) + position + text.slice(insertAt);
385
+ }
386
+ return text;
387
+ }
388
+
389
+ // Function to generate AI response
390
+ function generateAIResponse(userMessage, fileContent = null) {
391
+ let response = israeliResponses[Math.floor(Math.random() * israeliResponses.length)];
392
+
393
+ if (fileContent) {
394
+ response += `<br><span class="punctuation">!!</span> ראיתי את הקובובץ שה שהעלת <span class="israeli-slang">(ממגניב)</span>`;
395
+ }
396
+
397
+ // Generate some "intelligent" response based on user input
398
+ const inputWords = userMessage.split(' ');
399
+ if (inputWords.length > 3) {
400
+ response += `<br>לגבי "${inputWords.slice(0, 3).join(' ')}...", אני חושב ש`;
401
+
402
+ const opinions = [
403
+ "זה מ ממש מע מעניין!",
404
+ "צריך לחשוב על זה יותר לעומומק.",
405
+ "יש לי כמה ר רעיונות לגבי זה.",
406
+ "זה נושא חשוב ש שצריך ל לבדוק.",
407
+ "אני מס מסכים איתך לגמרי!",
408
+ "יש לי נקודת מב מבט קצת שונה...",
409
+ "זה משהו שכולם צריכים לדעת.",
410
+ "אאני לא בטוח שאני מסכים עם זה.",
411
+ "וואו, מעולם לא חשבתי על זה כ ככה!",
412
+ "זה נושא ש שדורש עוד מחקר."
413
+ ];
414
+
415
+ response += opinions[Math.floor(Math.random() * opinions.length)];
416
+ } else {
417
+ response += "<br>" + [
418
+ "אייזה כיף שא שאתה פה!",
419
+ "מה עוד מע מעניין אותך לדעת?",
420
+ "יש ל לך עוד שאלות בש בשבילי?",
421
+ "אאני פה לכל מה שא שאתה צריך!",
422
+ "ממשהו נוס נוסף שברצונונך ל לשאול?",
423
+ "אאני אוהב את הש השאלות שלך!",
424
+ "בוא נ נמשיך את השיחה המ המעניינת הזו!",
425
+ "יש לי כל כך הרבה מה להגיד על זה!",
426
+ "אתה מעלה נקודות מע מעניינות!",
427
+ "בוא נדבר עוד על הנושא הזה!"
428
+ ][Math.floor(Math.random() * 10)];
429
+ }
430
+
431
+ // Add some random facts
432
+ if (Math.random() < 0.4) {
433
+ const facts = [
434
+ "<br><br>דרך א אגב, ידעת ש-90% מהישראלים אוהבים חומווס?",
435
+ "<br><br>אאגב, מ מחקר חדש מר מראה ש...",
436
+ "<br><br>קצת טריוויה: התל אביבי המ הממוצע שותה 3 ק קפה ביום!",
437
+ "<br><br>חשבת פעם על זה ש...",
438
+ "<br><br>משהו מע מעניין: רוב הא האנשים לא יודעים ש..."
439
+ ];
440
+ response += facts[Math.floor(Math.random() * facts.length)];
441
+ }
442
+
443
+ // Process the text with Israeli style
444
+ response = addPunctuation(response);
445
+ response = addBold(response);
446
+ response = addSlang(response);
447
+
448
+ return response;
449
+ }
450
+
451
+ // Function to add message to chat
452
+ function addMessage(content, isUser = false) {
453
+ const messageDiv = document.createElement('div');
454
+ messageDiv.className = `message ${isUser ? 'user-message' : 'ai-message'}`;
455
+
456
+ if (typeof content === 'string') {
457
+ messageDiv.innerHTML = content;
458
+ } else {
459
+ // Handle file content
460
+ if (content.type.startsWith('image/')) {
461
+ const reader = new FileReader();
462
+ reader.onload = function(e) {
463
+ messageDiv.innerHTML = `<div>${isUser ? 'אתה העלית ת תמונה:' : 'הנה הת התמונה של שלך:'}</div>
464
+ <img src="${e.target.result}" class="uploaded-image" alt="Uploaded image">`;
465
+ };
466
+ reader.readAsDataURL(content);
467
+ } else {
468
+ messageDiv.innerHTML = `<div class="uploaded-file">
469
+ <i class="fas fa-file-alt"></i> ${isUser ? 'העלית קובובץ:' : 'הנה הקובץ שלך:'} ${content.name}
470
+ </div>`;
471
+ }
472
+ }
473
+
474
+ chatMessages.appendChild(messageDiv);
475
+ chatMessages.scrollTop = chatMessages.scrollHeight;
476
+ }
477
+
478
+ // Function to simulate AI typing
479
+ function simulateTyping(callback) {
480
+ typingIndicator.style.display = 'flex';
481
+ chatMessages.scrollTop = chatMessages.scrollHeight;
482
+
483
+ // Random typing duration between 1-3 seconds
484
+ const duration = 1000 + Math.random() * 2000;
485
+
486
+ setTimeout(() => {
487
+ typingIndicator.style.display = 'none';
488
+ callback();
489
+ chatMessages.scrollTop = chatMessages.scrollHeight;
490
+ }, duration);
491
+ }
492
+
493
+ // Handle send button click
494
+ sendButton.addEventListener('click', sendMessage);
495
+
496
+ // Handle Enter key press
497
+ userInput.addEventListener('keypress', function(e) {
498
+ if (e.key === 'Enter') {
499
+ sendMessage();
500
+ }
501
+ });
502
+
503
+ // Handle file upload
504
+ fileInput.addEventListener('change', function(e) {
505
+ if (fileInput.files.length > 0) {
506
+ const file = fileInput.files[0];
507
+ addMessage(file, true);
508
+
509
+ // In a real app, you would process the file here
510
+ // For demo, we'll just show a response
511
+ simulateTyping(() => {
512
+ addMessage(generateAIResponse("קובץ שהועלה", true));
513
+ });
514
+
515
+ // Reset file input
516
+ fileInput.value = '';
517
+ }
518
+ });
519
+
520
+ // Function to send message
521
+ function sendMessage() {
522
+ const message = userInput.value.trim();
523
+ if (message) {
524
+ addMessage(message, true);
525
+ userInput.value = '';
526
+
527
+ simulateTyping(() => {
528
+ addMessage(generateAIResponse(message));
529
+ });
530
+ }
531
+ }
532
+
533
+ // Initial demo messages
534
+ setTimeout(() => {
535
+ simulateTyping(() => {
536
+ addMessage("אאני פה כדי לעזור לך עם כל מה שא שאתה צריך, <span class='bold-text'>בלי בעיות!</span> <span class='punctuation'>!!</span>");
537
+ });
538
+ }, 1500);
539
+ });
540
+ </script>
541
+ </body>
542
+ </html>