File size: 1,304 Bytes
3c50af6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Chat with Be Max</title>
  <style>
    body { font-family: Arial; background: #f5f5f5; padding: 20px; }
    #chatbox { width: 100%; height: 300px; border: 1px solid #ccc; padding: 10px; overflow-y: scroll; background: #fff; }
    #input { width: 80%; padding: 10px; }
    #send { padding: 10px; }
  </style>
</head>
<body>
  <h2>🤖 Chat with Be Max</h2>
  <div id="chatbox"></div>
  <input id="input" placeholder="Write your symptoms...">
  <button id="send">Send</button>

  <script>
    const chatbox = document.getElementById("chatbox");
    const input = document.getElementById("input");
    const send = document.getElementById("send");

    send.onclick = () => {
      let msg = input.value.toLowerCase();
      chatbox.innerHTML += "<p><b>You:</b> " + msg + "</p>";
      
      let reply = "I'm not sure. Please consult a doctor.";

      if(msg.includes("fever") && msg.includes("cough")) reply = "It may be Influenza (Flu)";
      if(msg.includes("thirst") && msg.includes("urination")) reply = "It may be Diabetes";
      if(msg.includes("chest pain")) reply = "It may be a Heart Disease";

      chatbox.innerHTML += "<p><b>Be Max:</b> " + reply + "</p>";
      input.value = "";
    };
  </script>
</body>
</html>