euychrue commited on
Commit
915327a
·
verified ·
1 Parent(s): ce433c1

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +588 -19
index.html CHANGED
@@ -1,19 +1,588 @@
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: #0056b3;
11
+ --secondary: #ffd700;
12
+ --accent: #d40000;
13
+ --bg: #f5f5f5;
14
+ --text: #333;
15
+ --bubble-user: #e3f2fd;
16
+ --bubble-ai: #ffffff;
17
+ --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
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);
29
+ color: var(--text);
30
+ direction: rtl;
31
+ }
32
+
33
+ .container {
34
+ max-width: 1000px;
35
+ margin: 0 auto;
36
+ padding: 20px;
37
+ display: flex;
38
+ flex-direction: column;
39
+ height: 100vh;
40
+ }
41
+
42
+ header {
43
+ display: flex;
44
+ justify-content: space-between;
45
+ align-items: center;
46
+ padding: 15px 0;
47
+ border-bottom: 2px solid var(--secondary);
48
+ margin-bottom: 20px;
49
+ }
50
+
51
+ .logo {
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 10px;
55
+ }
56
+
57
+ .logo img {
58
+ height: 40px;
59
+ }
60
+
61
+ .logo h1 {
62
+ font-size: 24px;
63
+ color: var(--primary);
64
+ font-weight: 700;
65
+ }
66
+
67
+ .tagline {
68
+ font-size: 14px;
69
+ color: var(--accent);
70
+ font-style: italic;
71
+ }
72
+
73
+ .chat-container {
74
+ flex: 1;
75
+ display: flex;
76
+ flex-direction: column;
77
+ background-color: white;
78
+ border-radius: 10px;
79
+ box-shadow: var(--shadow);
80
+ overflow: hidden;
81
+ }
82
+
83
+ .chat-header {
84
+ background-color: var(--primary);
85
+ color: white;
86
+ padding: 15px;
87
+ display: flex;
88
+ align-items: center;
89
+ gap: 10px;
90
+ }
91
+
92
+ .chat-header i {
93
+ font-size: 20px;
94
+ }
95
+
96
+ .chat-messages {
97
+ flex: 1;
98
+ padding: 20px;
99
+ overflow-y: auto;
100
+ display: flex;
101
+ flex-direction: column;
102
+ gap: 15px;
103
+ }
104
+
105
+ .message {
106
+ max-width: 80%;
107
+ padding: 12px 15px;
108
+ border-radius: 15px;
109
+ line-height: 1.4;
110
+ position: relative;
111
+ word-wrap: break-word;
112
+ }
113
+
114
+ .user-message {
115
+ align-self: flex-end;
116
+ background-color: var(--bubble-user);
117
+ border-bottom-right-radius: 0;
118
+ color: var(--text);
119
+ }
120
+
121
+ .ai-message {
122
+ align-self: flex-start;
123
+ background-color: var(--bubble-ai);
124
+ border-bottom-left-radius: 0;
125
+ box-shadow: var(--shadow);
126
+ }
127
+
128
+ .ai-message strong {
129
+ color: var(--accent);
130
+ }
131
+
132
+ .ai-message em {
133
+ font-style: italic;
134
+ color: var(--primary);
135
+ }
136
+
137
+ .chat-input {
138
+ display: flex;
139
+ padding: 15px;
140
+ background-color: #f0f0f0;
141
+ border-top: 1px solid #ddd;
142
+ }
143
+
144
+ .input-container {
145
+ flex: 1;
146
+ display: flex;
147
+ gap: 10px;
148
+ }
149
+
150
+ textarea {
151
+ flex: 1;
152
+ padding: 12px 15px;
153
+ border: 1px solid #ddd;
154
+ border-radius: 25px;
155
+ resize: none;
156
+ font-size: 16px;
157
+ height: 50px;
158
+ max-height: 150px;
159
+ outline: none;
160
+ transition: all 0.3s;
161
+ }
162
+
163
+ textarea:focus {
164
+ border-color: var(--primary);
165
+ box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2);
166
+ }
167
+
168
+ .send-btn {
169
+ background-color: var(--primary);
170
+ color: white;
171
+ border: none;
172
+ border-radius: 50%;
173
+ width: 50px;
174
+ height: 50px;
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: center;
178
+ cursor: pointer;
179
+ transition: all 0.3s;
180
+ }
181
+
182
+ .send-btn:hover {
183
+ background-color: #003d82;
184
+ }
185
+
186
+ .file-upload {
187
+ position: relative;
188
+ display: flex;
189
+ align-items: center;
190
+ justify-content: center;
191
+ }
192
+
193
+ .file-upload input {
194
+ position: absolute;
195
+ opacity: 0;
196
+ width: 50px;
197
+ height: 50px;
198
+ cursor: pointer;
199
+ }
200
+
201
+ .file-upload-btn {
202
+ background-color: var(--secondary);
203
+ color: var(--text);
204
+ border: none;
205
+ border-radius: 50%;
206
+ width: 50px;
207
+ height: 50px;
208
+ display: flex;
209
+ align-items: center;
210
+ justify-content: center;
211
+ cursor: pointer;
212
+ transition: all 0.3s;
213
+ }
214
+
215
+ .file-upload-btn:hover {
216
+ background-color: #e6c200;
217
+ }
218
+
219
+ .typing-indicator {
220
+ display: flex;
221
+ align-items: center;
222
+ gap: 5px;
223
+ padding: 10px 15px;
224
+ background-color: var(--bubble-ai);
225
+ border-radius: 15px;
226
+ align-self: flex-start;
227
+ box-shadow: var(--shadow);
228
+ margin-bottom: 15px;
229
+ }
230
+
231
+ .typing-dot {
232
+ width: 8px;
233
+ height: 8px;
234
+ background-color: #999;
235
+ border-radius: 50%;
236
+ animation: typing 1.4s infinite ease-in-out;
237
+ }
238
+
239
+ .typing-dot:nth-child(1) {
240
+ animation-delay: 0s;
241
+ }
242
+
243
+ .typing-dot:nth-child(2) {
244
+ animation-delay: 0.2s;
245
+ }
246
+
247
+ .typing-dot:nth-child(3) {
248
+ animation-delay: 0.4s;
249
+ }
250
+
251
+ @keyframes typing {
252
+ 0%, 60%, 100% {
253
+ transform: translateY(0);
254
+ }
255
+ 30% {
256
+ transform: translateY(-5px);
257
+ }
258
+ }
259
+
260
+ .file-preview {
261
+ display: flex;
262
+ flex-wrap: wrap;
263
+ gap: 10px;
264
+ margin-bottom: 10px;
265
+ }
266
+
267
+ .file-item {
268
+ display: flex;
269
+ align-items: center;
270
+ background-color: #f0f0f0;
271
+ padding: 5px 10px;
272
+ border-radius: 15px;
273
+ font-size: 14px;
274
+ gap: 5px;
275
+ }
276
+
277
+ .file-item i {
278
+ color: var(--primary);
279
+ }
280
+
281
+ .remove-file {
282
+ color: var(--accent);
283
+ cursor: pointer;
284
+ margin-right: 5px;
285
+ }
286
+
287
+ .credits {
288
+ text-align: center;
289
+ margin-top: 10px;
290
+ font-size: 12px;
291
+ color: #777;
292
+ }
293
+
294
+ .credits a {
295
+ color: var(--primary);
296
+ text-decoration: none;
297
+ }
298
+
299
+ @media (max-width: 768px) {
300
+ .container {
301
+ padding: 10px;
302
+ }
303
+
304
+ .logo h1 {
305
+ font-size: 20px;
306
+ }
307
+
308
+ .message {
309
+ max-width: 90%;
310
+ }
311
+
312
+ .chat-input {
313
+ padding: 10px;
314
+ }
315
+
316
+ textarea, .send-btn, .file-upload-btn {
317
+ height: 45px;
318
+ width: 45px;
319
+ }
320
+ }
321
+
322
+ /* Sabra style additions */
323
+ .ai-message::before {
324
+ content: "💪";
325
+ position: absolute;
326
+ left: -25px;
327
+ top: 0;
328
+ font-size: 20px;
329
+ }
330
+
331
+ .sabra-emoji {
332
+ font-size: 18px;
333
+ margin-left: 5px;
334
+ }
335
+ </style>
336
+ </head>
337
+ <body>
338
+ <div class="container">
339
+ <header>
340
+ <div class="logo">
341
+ <i class="fas fa-robot" style="font-size: 30px; color: var(--primary);"></i>
342
+ <h1>צ'אט בינה מלאכותית <span class="sabra-emoji">🇮🇱</span></h1>
343
+ </div>
344
+ <div class="tagline">עונה כמו צבר אמיתי!</div>
345
+ </header>
346
+
347
+ <div class="chat-container">
348
+ <div class="chat-header">
349
+ <i class="fas fa-comments"></i>
350
+ <span>צ'אט עם DeepSeek</span>
351
+ </div>
352
+
353
+ <div class="chat-messages" id="chat-messages">
354
+ <div class="message ai-message">
355
+ <strong>היי חבר! מה קורה? 😎</strong><br><br>
356
+ אני כאן כדי לעזור עם כל מה שאתה צריך, <em>בסגנון הכי ישראלי שיש!</em> 🏖️<br><br>
357
+ תשאל אותי מה שבא לך, ואני אענה לך <strong>בלי פילטרים ובלי נחמדות מזויפת</strong>... בדיוק כמו שצריך! 💪
358
+ </div>
359
+ </div>
360
+
361
+ <div class="file-preview" id="file-preview"></div>
362
+
363
+ <div class="chat-input">
364
+ <div class="input-container">
365
+ <div class="file-upload">
366
+ <input type="file" id="file-input" multiple>
367
+ <button class="file-upload-btn" title="העלאת קובץ">
368
+ <i class="fas fa-paperclip"></i>
369
+ </button>
370
+ </div>
371
+ <textarea id="message-input" placeholder="כתוב הודעה כאן..."></textarea>
372
+ <button class="send-btn" id="send-btn">
373
+ <i class="fas fa-paper-plane"></i>
374
+ </button>
375
+ </div>
376
+ </div>
377
+ </div>
378
+
379
+ <div class="credits">
380
+ <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">Built with anycoder</a>
381
+ </div>
382
+ </div>
383
+
384
+ <script>
385
+ document.addEventListener('DOMContentLoaded', function() {
386
+ const messageInput = document.getElementById('message-input');
387
+ const sendBtn = document.getElementById('send-btn');
388
+ const chatMessages = document.getElementById('chat-messages');
389
+ const fileInput = document.getElementById('file-input');
390
+ const filePreview = document.getElementById('file-preview');
391
+
392
+ let files = [];
393
+
394
+ // Auto-resize textarea
395
+ messageInput.addEventListener('input', function() {
396
+ this.style.height = 'auto';
397
+ this.style.height = (this.scrollHeight > 150 ? 150 : this.scrollHeight) + 'px';
398
+ });
399
+
400
+ // Send message on Enter (but allow Shift+Enter for new line)
401
+ messageInput.addEventListener('keydown', function(e) {
402
+ if (e.key === 'Enter' && !e.shiftKey) {
403
+ e.preventDefault();
404
+ sendMessage();
405
+ }
406
+ });
407
+
408
+ // Send message on button click
409
+ sendBtn.addEventListener('click', sendMessage);
410
+
411
+ // Handle file upload
412
+ fileInput.addEventListener('change', function() {
413
+ files = Array.from(this.files);
414
+ updateFilePreview();
415
+ });
416
+
417
+ function updateFilePreview() {
418
+ filePreview.innerHTML = '';
419
+
420
+ files.forEach((file, index) => {
421
+ const fileItem = document.createElement('div');
422
+ fileItem.className = 'file-item';
423
+
424
+ let iconClass;
425
+ if (file.type.startsWith('image/')) {
426
+ iconClass = 'fas fa-image';
427
+ } else if (file.type.startsWith('video/')) {
428
+ iconClass = 'fas fa-video';
429
+ } else if (file.type.startsWith('audio/')) {
430
+ iconClass = 'fas fa-music';
431
+ } else if (file.type.includes('pdf')) {
432
+ iconClass = 'fas fa-file-pdf';
433
+ } else if (file.type.includes('word') || file.type.includes('document')) {
434
+ iconClass = 'fas fa-file-word';
435
+ } else {
436
+ iconClass = 'fas fa-file';
437
+ }
438
+
439
+ fileItem.innerHTML = `
440
+ <i class="${iconClass}"></i>
441
+ <span>${file.name}</span>
442
+ <span class="remove-file" data-index="${index}">&times;</span>
443
+ `;
444
+
445
+ filePreview.appendChild(fileItem);
446
+ });
447
+
448
+ // Add event listeners to remove buttons
449
+ document.querySelectorAll('.remove-file').forEach(btn => {
450
+ btn.addEventListener('click', function() {
451
+ const index = parseInt(this.getAttribute('data-index'));
452
+ files.splice(index, 1);
453
+ updateFilePreview();
454
+ });
455
+ });
456
+ }
457
+
458
+ function sendMessage() {
459
+ const message = messageInput.value.trim();
460
+ if (message === '' && files.length === 0) return;
461
+
462
+ // Add user message to chat
463
+ addMessage(message, 'user');
464
+
465
+ // Show typing indicator
466
+ showTypingIndicator();
467
+
468
+ // Clear input
469
+ messageInput.value = '';
470
+ messageInput.style.height = '50px';
471
+
472
+ // Simulate AI response after delay
473
+ setTimeout(() => {
474
+ // Remove typing indicator
475
+ removeTypingIndicator();
476
+
477
+ // Add AI response
478
+ addMessage(generateSabraResponse(message), 'ai');
479
+
480
+ // Clear files
481
+ files = [];
482
+ updateFilePreview();
483
+
484
+ // Scroll to bottom
485
+ chatMessages.scrollTop = chatMessages.scrollHeight;
486
+ }, 1500 + Math.random() * 2000);
487
+
488
+ // Scroll to bottom
489
+ chatMessages.scrollTop = chatMessages.scrollHeight;
490
+ }
491
+
492
+ function addMessage(text, sender) {
493
+ const messageDiv = document.createElement('div');
494
+ messageDiv.className = `message ${sender}-message`;
495
+
496
+ if (sender === 'user') {
497
+ messageDiv.textContent = text;
498
+
499
+ // Add file info if available
500
+ if (files.length > 0) {
501
+ const fileInfo = document.createElement('div');
502
+ fileInfo.style.marginTop = '10px';
503
+ fileInfo.style.fontSize = '12px';
504
+ fileInfo.style.color = '#666';
505
+
506
+ files.forEach(file => {
507
+ const fileSpan = document.createElement('span');
508
+ fileSpan.style.display = 'block';
509
+ fileSpan.innerHTML = `<i class="fas fa-paperclip"></i> ${file.name}`;
510
+ fileInfo.appendChild(fileSpan);
511
+ });
512
+
513
+ messageDiv.appendChild(fileInfo);
514
+ }
515
+ } else {
516
+ // AI message with HTML content
517
+ messageDiv.innerHTML = text;
518
+ }
519
+
520
+ chatMessages.appendChild(messageDiv);
521
+ }
522
+
523
+ function showTypingIndicator() {
524
+ const typingDiv = document.createElement('div');
525
+ typingDiv.className = 'typing-indicator';
526
+ typingDiv.id = 'typing-indicator';
527
+ typingDiv.innerHTML = `
528
+ <div class="typing-dot"></div>
529
+ <div class="typing-dot"></div>
530
+ <div class="typing-dot"></div>
531
+ <span>כותב...</span>
532
+ `;
533
+
534
+ chatMessages.appendChild(typingDiv);
535
+ chatMessages.scrollTop = chatMessages.scrollHeight;
536
+ }
537
+
538
+ function removeTypingIndicator() {
539
+ const typingDiv = document.getElementById('typing-indicator');
540
+ if (typingDiv) {
541
+ typingDiv.remove();
542
+ }
543
+ }
544
+
545
+ function generateSabraResponse(userMessage) {
546
+ const responses = [
547
+ `<strong>יאללה חבר, שאלה טובה!</strong> 🚀<br><br>
548
+ אבל לפני שאני עונה, <em>אתה בטוח שאתה רוצה לדעת את זה?</em> כי אני לא עושה הנחות פה... 😎<br><br>
549
+ התשובה היא: <strong>זה תלוי</strong>! כמו כל דבר בחיים, לא? 🤷‍♂️`,
550
+
551
+ `<strong>וואו, איזה שאלה!</strong> 🔥<br><br>
552
+ אתה יודע מה? אני אענה לך <em>בלי סוכר</em>, כמו שצריך:<br><br>
553
+ <strong>זה לא כל כך פשוט כמו שזה נשמע</strong>, אבל אם תתעקש - תצליח! 💪<br><br>
554
+ <em>סימן שאלה?</em> 🧐`,
555
+
556
+ `<strong>שמע, אני אתן לך תשובה אמיתית</strong> ⚡<br><br>
557
+ לא כמו כל הבוטים המפונקים האלה...<br><br>
558
+ <em>האמת היא ש</em> <strong>${userMessage.toUpperCase()}</strong> <em>זה לא מה שחשוב פה</em>!<br><br>
559
+ מה שחשוב זה מה <strong>אתה</strong> חושב! 🧠<br><br>
560
+ <span class="sabra-emoji">🇮🇱</span>`,
561
+
562
+ `<strong>אה, השאלה הקלאסית הזאת...</strong> 😏<br><br>
563
+ תקשיב, אני אגיד לך משהו <em>שאף אחד לא מעז להגיד</em>:<br><br>
564
+ <strong>זה לא חשוב!</strong> 🎯<br><br>
565
+ מה שחשוב זה איך אתה משתמש במידע הזה! 💡<br><br>
566
+ <em>סימן קריאה!</em> ❗`,
567
+
568
+ `<strong>יאללה, בוא נדבר גלויות</strong> 🤙<br><br>
569
+ אני לא הולך לסבך לך את החיים עם תשובות מסובכות...<br><br>
570
+ <em>התשובה הפשוטה היא:</em> <strong>כן ולא בו זמנית</strong>! 🤯<br><br>
571
+ <span class="sabra-emoji">😅</span> <span class="sabra-emoji">🤪</span>`
572
+ ];
573
+
574
+ // Add file response if files were uploaded
575
+ if (files.length > 0) {
576
+ const fileNames = files.map(f => f.name).join(', ');
577
+ return `<strong>וואלה, שלחת לי קבצים!</strong> 📎<br><br>
578
+ <em>${fileNames}</em> - יפה מאוד! 👏<br><br>
579
+ עכשיו, לגבי השאלה שלך:<br><br>
580
+ ${responses[Math.floor(Math.random() * responses.length)]}`;
581
+ }
582
+
583
+ return responses[Math.floor(Math.random() * responses.length)];
584
+ }
585
+ });
586
+ </script>
587
+ </body>
588
+ </html>