Abmacode12 commited on
Commit
a01bd48
·
verified ·
1 Parent(s): a356dd3

Manual changes saved

Browse files
Files changed (1) hide show
  1. index.html +32 -1
index.html CHANGED
@@ -245,4 +245,35 @@
245
  feather.replace();
246
  </script>
247
  </body>
248
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  feather.replace();
246
  </script>
247
  </body>
248
+ </html>const input = document.getElementById("prompt");
249
+ const btnSend = document.getElementById("btnSend");
250
+ const chat = document.getElementById("chat");
251
+
252
+ function addMessage(author, text) {
253
+ const div = document.createElement("div");
254
+ div.className = "rounded-xl bg-white/5 border border-white/10 p-3 text-sm";
255
+ div.innerHTML = `<strong>${author}:</strong> ${text}`;
256
+ chat.appendChild(div);
257
+ chat.scrollTop = chat.scrollHeight;
258
+ }
259
+
260
+ function handleSend() {
261
+ const text = input.value.trim();
262
+ if (!text) return;
263
+
264
+ console.log("MESSAGE CAPTURED:", text);
265
+ addMessage("You", text);
266
+ input.value = "";
267
+
268
+ // Défense : backend absent
269
+ addMessage("System", "⚠️ Backend offline — aucune IA n'est connectée.");
270
+ }
271
+
272
+ btnSend.addEventListener("click", handleSend);
273
+
274
+ input.addEventListener("keydown", (e) => {
275
+ if (e.key === "Enter") {
276
+ e.preventDefault();
277
+ handleSend();
278
+ }
279
+ });