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