File size: 30,119 Bytes
4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 4946ffa 605d3e8 4946ffa f7de637 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 7bde1db 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 f7de637 4946ffa 605d3e8 f7de637 4946ffa 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 f7de637 605d3e8 4946ffa f7de637 605d3e8 f7de637 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 4946ffa 605d3e8 |
1 2 3 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 290 291 292 293 294 295 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 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 |
<!DOCTYPE html>
<html lang="fr" class="">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mariam AI - Assistant Personnel</title>
<!-- Tailwind CSS via CDN -->
<script src="https://cdn.tailwindcss.com?plugins=forms,typography"></script>
<!-- Font Awesome pour les icônes -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<!-- Favicon -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>✨</text></svg>">
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'],
mono: ['"JetBrains Mono"', 'monospace']
},
colors: {
primary: { 50: '#eff6ff', 100: '#dbeafe', 200: '#bfdbfe', 300: '#93c5fd', 400: '#60a5fa', 500: '#3b82f6', 600: '#2563eb', 700: '#1d4ed8', 800: '#1e40af', 900: '#1e3a8a' },
slate: { 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8', 500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', 950: '#020617' }
},
animation: {
'fade-in': 'fadeIn 0.5s ease-out forwards',
'fade-in-up': 'fadeInUp 0.5s ease-out forwards',
'pulse-subtle': 'pulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite',
},
keyframes: {
fadeIn: { '0%': { opacity: 0 }, '100%': { opacity: 1 } },
fadeInUp: { '0%': { opacity: 0, transform: 'translateY(10px)' }, '100%': { opacity: 1, transform: 'translateY(0)' } },
}
}
}
}
</script>
<style>
:root {
color-scheme: light;
}
:root.dark {
color-scheme: dark;
}
html, body {
height: 100%;
overflow: hidden; /* Prevent scrollbars on body due to fixed elements */
}
body {
font-family: 'Inter', sans-serif;
background: #f8fafc; /* light mode body bg */
color: #0f172a; /* light mode text */
}
.dark body {
background: #0f172a; /* dark mode body bg */
color: #f1f5f9; /* dark mode text */
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.dark ::-webkit-scrollbar-thumb:hover { background: #64748b; }
/* Layout */
.main-layout { display: flex; height: 100vh; }
/* sidebar width for mobile is w-64, for desktop min-w-[260px] */
.chat-container { display: flex; flex-direction: column; height: 100%; }
/* Welcome Screen */
.suggestion-card {
transition: all 0.2s ease-in-out;
border: 1px solid #e2e8f0; /* light: border-slate-200 */
}
.dark .suggestion-card { border-color: #334155; } /* dark: border-slate-700 */
.suggestion-card:hover {
transform: translateY(-4px);
box-shadow: 0 4px 10px rgba(0,0,0,0.05);
border-color: #93c5fd; /* light: border-primary-300 */
}
.dark .suggestion-card:hover {
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
border-color: #3b82f6; /* dark: border-primary-500 */
}
/* Messages */
.message-bubble {
max-width: 80%; /* Max width for bubbles on mobile and desktop */
padding: 0.75rem 1.125rem;
border-radius: 1.25rem;
animation: fadeInUp 0.4s ease-out;
}
.user-message .message-bubble {
background-color: #2563eb; /* primary-600 */
color: white;
border-bottom-right-radius: 0.25rem;
}
.assistant-message .message-bubble {
background-color: #ffffff; /* light: white */
color: #1e293b; /* light: slate-800 */
border: 1px solid #e2e8f0; /* light: slate-200 */
border-bottom-left-radius: 0.25rem;
}
.dark .assistant-message .message-bubble {
background-color: #1e293b; /* dark: slate-800 */
color: #e2e8f0; /* dark: slate-200 */
border-color: #334155; /* dark: slate-700 */
}
.assistant-avatar {
background: linear-gradient(135deg, #3b82f6, #9333ea);
}
/* Input Area */
.chat-input-area {
resize: none;
min-height: 52px; /* Fixed based on py-3 and text size */
max-height: 200px; /* Reduced max height slightly */
}
.toast {
animation: toast-in-out 5s ease-in-out forwards;
}
@keyframes toast-in-out {
0%, 100% { transform: translateY(200%); opacity: 0; }
10%, 90% { transform: translateY(0); opacity: 1; }
}
pre code.hljs{padding:1em;border-radius:.5rem}
.prose table{width:100%;border-collapse:collapse}.prose td,.prose th{border:1px solid #e2e8f0;padding:.5rem .75rem;text-align:left}.dark .prose td,.dark .prose th{border-color:#334155}.prose thead{background-color:#f8fafc;font-weight:600}.dark .prose thead{background-color:#1e293b}.prose tbody tr:nth-child(2n){background-color:#f8fafc}.dark .prose tbody tr:nth-child(2n){background-color:#1e293b}
</style>
</head>
<body class="antialiased">
<div class="main-layout bg-slate-50 dark:bg-slate-950">
<!-- Sidebar -->
<aside id="sidebar" class="fixed inset-y-0 left-0 z-40 w-64 bg-slate-100 dark:bg-slate-900/70 backdrop-blur-md dark:backdrop-blur-sm border-r border-slate-200 dark:border-slate-800 flex flex-col p-4 transform -translate-x-full transition-transform duration-300 ease-in-out md:relative md:translate-x-0 md:w-auto md:min-w-[260px] md:z-auto md:backdrop-blur-none">
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-2">
<img src="https://mariam-241.vercel.app/static/image/logoboma.png" alt="Logo" class="h-8">
<h1 class="text-xl font-bold text-slate-800 dark:text-slate-100">Mariam AI</h1>
</div>
<button id="close-sidebar-btn" class="p-1 rounded-md md:hidden text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200">
<i class="fa-solid fa-times text-xl"></i>
</button>
</div>
<button id="new-chat-btn" class="w-full flex items-center justify-center gap-2 px-4 py-2.5 mb-4 text-sm font-semibold text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:focus:ring-offset-slate-900">
<i class="fa-solid fa-plus"></i>
Nouvelle Conversation
</button>
<div class="flex-grow overflow-y-auto">
<!-- Future chat history list -->
</div>
<div class="border-t border-slate-200 dark:border-slate-800 pt-4 mt-auto space-y-2">
<button id="theme-toggle" class="w-full flex items-center gap-3 px-3 py-2 text-sm font-medium text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-800 rounded-md transition-colors">
<i class="fa-solid fa-sun w-4 text-center dark:hidden"></i>
<i class="fa-solid fa-moon w-4 text-center hidden dark:inline-block"></i>
<span>Changer de thème</span>
</button>
</div>
</aside>
<!-- Overlay for mobile sidebar -->
<div id="sidebar-overlay" class="fixed inset-0 z-30 bg-black/30 backdrop-blur-sm hidden md:hidden"></div>
<!-- Main Chat Area -->
<main class="flex-1 chat-container">
<!-- Chat Header -->
<header class="flex items-center justify-between p-3 sm:p-4 border-b border-slate-200 dark:border-slate-800">
<button id="sidebar-toggle" class="p-2 rounded-md md:hidden hover:bg-slate-100 dark:hover:bg-slate-800">
<i class="fa-solid fa-bars text-slate-600 dark:text-slate-400"></i>
</button>
<h2 class="text-base sm:text-lg font-semibold text-slate-700 dark:text-slate-300 mx-auto md:mx-0">Conversation Actuelle</h2>
<div class="flex items-center gap-2">
<label class="flex items-center cursor-pointer group">
<span class="mr-1.5 sm:mr-2 text-xs sm:text-sm font-medium text-slate-600 dark:text-slate-400">Web</span>
<div class="relative">
<input type="checkbox" id="web_search_toggle" class="sr-only peer">
<div class="w-9 h-5 sm:w-10 sm:h-5 bg-slate-300 dark:bg-slate-700 rounded-full peer peer-checked:after:translate-x-[calc(100%-2px)] peer-checked:after:border-white after:content-[''] after:absolute after:top-[1px] sm:after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary-500"></div>
</div>
</label>
</div>
</header>
<!-- Messages -->
<div id="chat-messages" class="flex-1 overflow-y-auto p-4 sm:p-6 space-y-4 sm:space-y-6">
<!-- Welcome Screen -->
<div id="welcome-screen" class="flex flex-col items-center justify-center h-full text-center animate-fade-in">
<div class="assistant-avatar w-16 h-16 sm:w-20 sm:h-20 rounded-full flex items-center justify-center mb-4 text-3xl sm:text-4xl text-white animate-pulse-subtle">✨</div>
<h1 class="text-2xl sm:text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2">Comment puis-je vous aider ?</h1>
<p class="text-slate-500 dark:text-slate-400 mb-8 sm:mb-10 max-w-md text-sm sm:text-base">Je suis Mariam, un assistant IA capable de répondre à vos questions, de générer du code, et bien plus encore.</p>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-3 sm:gap-4 w-full max-w-2xl">
<div class="suggestion-card bg-white dark:bg-slate-800 p-3 sm:p-4 rounded-lg cursor-pointer" data-prompt="Donne-moi 3 idées de recettes rapides pour le dîner de ce soir.">
<p class="font-semibold text-slate-700 dark:text-slate-200 text-sm sm:text-base">Idées de recettes</p>
<p class="text-xs sm:text-sm text-slate-500 dark:text-slate-400">Pour un repas rapide et délicieux</p>
</div>
<div class="suggestion-card bg-white dark:bg-slate-800 p-3 sm:p-4 rounded-lg cursor-pointer" data-prompt="Écris un e-mail professionnel pour demander un jour de congé.">
<p class="font-semibold text-slate-700 dark:text-slate-200 text-sm sm:text-base">Rédiger un e-mail</p>
<p class="text-xs sm:text-sm text-slate-500 dark:text-slate-400">Pour une demande de congé</p>
</div>
<div class="suggestion-card bg-white dark:bg-slate-800 p-3 sm:p-4 rounded-lg cursor-pointer" data-prompt="Explique le concept de 'machine learning' en termes simples.">
<p class="font-semibold text-slate-700 dark:text-slate-200 text-sm sm:text-base">Expliquer un concept</p>
<p class="text-xs sm:text-sm text-slate-500 dark:text-slate-400">Le machine learning pour les débutants</p>
</div>
<div class="suggestion-card bg-white dark:bg-slate-800 p-3 sm:p-4 rounded-lg cursor-pointer" data-prompt="Écris une fonction Python qui inverse une chaîne de caractères.">
<p class="font-semibold text-slate-700 dark:text-slate-200 text-sm sm:text-base">Générer du code</p>
<p class="text-xs sm:text-sm text-slate-500 dark:text-slate-400">Pour inverser une chaîne en Python</p>
</div>
</div>
</div>
<!-- Dynamic messages will be injected here -->
<div id="history-loading" class="text-center py-10 hidden">
<i class="fa-solid fa-spinner fa-spin text-2xl text-primary-500"></i>
<p class="mt-2 text-sm text-slate-500">Chargement de la conversation...</p>
</div>
<div id="loading-indicator" class="assistant-message flex items-start gap-3 hidden">
<div class="assistant-avatar w-8 h-8 sm:w-9 sm:h-9 rounded-full flex items-center justify-center flex-shrink-0 text-lg sm:text-xl text-white">✨</div>
<div class="message-bubble flex items-center gap-2">
<div class="h-2 w-2 bg-slate-400 rounded-full animate-bounce [animation-delay:-0.3s]"></div>
<div class="h-2 w-2 bg-slate-400 rounded-full animate-bounce [animation-delay:-0.15s]"></div>
<div class="h-2 w-2 bg-slate-400 rounded-full animate-bounce"></div>
</div>
</div>
</div>
<!-- Chat Input Area -->
<footer class="p-3 sm:p-4 bg-white/80 dark:bg-slate-900/80 backdrop-blur-sm">
<div class="max-w-4xl mx-auto">
<div id="preview-area" class="px-2 py-1.5 sm:px-4 sm:py-2 hidden"></div>
<form id="chat-form" class="relative">
<textarea id="prompt" name="prompt" rows="1" class="chat-input-area w-full bg-slate-100 dark:bg-slate-800 border-2 border-transparent focus:border-primary-500 focus:ring-0 rounded-xl py-3 pl-10 pr-[48px] sm:pl-12 sm:pr-[56px] text-sm sm:text-base text-slate-800 dark:text-slate-100 transition-colors duration-200" placeholder="Envoyez un message..."></textarea>
<div class="absolute left-2 sm:left-3 top-1/2 -translate-y-1/2 flex items-center">
<label for="file_upload" class="cursor-pointer text-slate-500 hover:text-primary-500 transition-colors p-1">
<i class="fa-solid fa-paperclip text-base sm:text-lg"></i>
<input type="file" id="file_upload" name="file" class="hidden" accept=".txt,.pdf,.png,.jpg,.jpeg,.md,.py,.js,.html,.css,.json">
</label>
</div>
<button type="submit" id="send-button" class="absolute right-2 sm:right-3 top-1/2 -translate-y-1/2 w-8 h-8 sm:w-9 sm:h-9 bg-primary-600 text-white rounded-full flex items-center justify-center hover:bg-primary-700 disabled:bg-slate-300 dark:disabled:bg-slate-700 disabled:cursor-not-allowed transition-all">
<i class="fa-solid fa-arrow-up text-sm sm:text-base"></i>
</button>
</form>
<p class="text-xs text-center text-slate-400 dark:text-slate-500 mt-2">
Mariam AI peut faire des erreurs. Vérifiez les informations importantes.
</p>
</div>
</footer>
</main>
</div>
<!-- Toast/Error Notification Area -->
<div id="toast-container" class="fixed bottom-4 right-4 sm:bottom-5 sm:right-5 z-50 w-[calc(100%-2rem)] max-w-xs sm:max-w-sm"></div>
<script>
</script>
</body>
</html> |