Shabdobhedi
commited on
Commit
•
4d69714
1
Parent(s):
4b3d405
Update templates/chat.html
Browse files- templates/chat.html +80 -80
templates/chat.html
CHANGED
@@ -1,81 +1,81 @@
|
|
1 |
-
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
2 |
-
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
3 |
-
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
4 |
-
|
5 |
-
<!DOCTYPE html>
|
6 |
-
<html>
|
7 |
-
<head>
|
8 |
-
<title>Chatbot</title>
|
9 |
-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
10 |
-
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
11 |
-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
12 |
-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css')}}"/>
|
13 |
-
</head>
|
14 |
-
|
15 |
-
|
16 |
-
<body>
|
17 |
-
<div class="container-fluid h-100">
|
18 |
-
<div class="row justify-content-center h-100">
|
19 |
-
<div class="col-md-8 col-xl-6 chat">
|
20 |
-
<div class="card">
|
21 |
-
<div class="card-header msg_head">
|
22 |
-
<div class="d-flex bd-highlight">
|
23 |
-
<div class="img_cont">
|
24 |
-
<!-- <img src="https://i.ibb.co/fSNP7Rz/icons8-chatgpt-512.png" class="rounded-circle user_img"> -->
|
25 |
-
<img src="https://
|
26 |
-
<span class="online_icon"></span>
|
27 |
-
</div>
|
28 |
-
<div class="user_info">
|
29 |
-
<span>Medical Chatbot</span>
|
30 |
-
<p>Ask me anything!</p>
|
31 |
-
</div>
|
32 |
-
</div>
|
33 |
-
</div>
|
34 |
-
<div id="messageFormeight" class="card-body msg_card_body">
|
35 |
-
|
36 |
-
|
37 |
-
</div>
|
38 |
-
<div class="card-footer">
|
39 |
-
<form id="messageArea" class="input-group">
|
40 |
-
<input type="text" id="text" name="msg" placeholder="Type your message..." autocomplete="off" class="form-control type_msg" required/>
|
41 |
-
<div class="input-group-append">
|
42 |
-
<button type="submit" id="send" class="input-group-text send_btn"><i class="fas fa-location-arrow"></i></button>
|
43 |
-
</div>
|
44 |
-
</form>
|
45 |
-
</div>
|
46 |
-
</div>
|
47 |
-
</div>
|
48 |
-
</div>
|
49 |
-
</div>
|
50 |
-
|
51 |
-
<script>
|
52 |
-
$(document).ready(function() {
|
53 |
-
$("#messageArea").on("submit", function(event) {
|
54 |
-
const date = new Date();
|
55 |
-
const hour = date.getHours();
|
56 |
-
const minute = date.getMinutes();
|
57 |
-
const str_time = hour+":"+minute;
|
58 |
-
var rawText = $("#text").val();
|
59 |
-
|
60 |
-
var userHtml = '<div class="d-flex justify-content-end mb-4"><div class="msg_cotainer_send">' + rawText + '<span class="msg_time_send">'+ str_time + '</span></div><div class="img_cont_msg"><img src="https://i.ibb.co/d5b84Xw/Untitled-design.png" class="rounded-circle user_img_msg"></div></div>';
|
61 |
-
|
62 |
-
$("#text").val("");
|
63 |
-
$("#messageFormeight").append(userHtml);
|
64 |
-
|
65 |
-
$.ajax({
|
66 |
-
data: {
|
67 |
-
msg: rawText,
|
68 |
-
},
|
69 |
-
type: "POST",
|
70 |
-
url: "/get",
|
71 |
-
}).done(function(data) {
|
72 |
-
var botHtml = '<div class="d-flex justify-content-start mb-4"><div class="img_cont_msg"><img src="https://www.prdistribution.com/spirit/uploads/pressreleases/2019/newsreleases/d83341deb75c4c4f6b113f27b1e42cd8-chatbot-florence-already-helps-thousands-of-patients-to-remember-their-medication.png" class="rounded-circle user_img_msg"></div><div class="msg_cotainer">' + data + '<span class="msg_time">' + str_time + '</span></div></div>';
|
73 |
-
$("#messageFormeight").append($.parseHTML(botHtml));
|
74 |
-
});
|
75 |
-
event.preventDefault();
|
76 |
-
});
|
77 |
-
});
|
78 |
-
</script>
|
79 |
-
|
80 |
-
</body>
|
81 |
</html>
|
|
|
1 |
+
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
2 |
+
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
3 |
+
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
4 |
+
|
5 |
+
<!DOCTYPE html>
|
6 |
+
<html>
|
7 |
+
<head>
|
8 |
+
<title>Chatbot</title>
|
9 |
+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
10 |
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
|
11 |
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
12 |
+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='style.css')}}"/>
|
13 |
+
</head>
|
14 |
+
|
15 |
+
|
16 |
+
<body>
|
17 |
+
<div class="container-fluid h-100">
|
18 |
+
<div class="row justify-content-center h-100">
|
19 |
+
<div class="col-md-8 col-xl-6 chat">
|
20 |
+
<div class="card">
|
21 |
+
<div class="card-header msg_head">
|
22 |
+
<div class="d-flex bd-highlight">
|
23 |
+
<div class="img_cont">
|
24 |
+
<!-- <img src="https://i.ibb.co/fSNP7Rz/icons8-chatgpt-512.png" class="rounded-circle user_img"> -->
|
25 |
+
<img src="https://img.freepik.com/premium-vector/joyful-medical-adventures-animated-little-doctor-clipart_1080480-29634.jpg" class="rounded-circle user_img">
|
26 |
+
<span class="online_icon"></span>
|
27 |
+
</div>
|
28 |
+
<div class="user_info">
|
29 |
+
<span>Medical Chatbot</span>
|
30 |
+
<p>Ask me anything about The GALE ENCYCLOPEDIA of MEDICINE!</p>
|
31 |
+
</div>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
<div id="messageFormeight" class="card-body msg_card_body">
|
35 |
+
|
36 |
+
|
37 |
+
</div>
|
38 |
+
<div class="card-footer">
|
39 |
+
<form id="messageArea" class="input-group">
|
40 |
+
<input type="text" id="text" name="msg" placeholder="Type your message..." autocomplete="off" class="form-control type_msg" required/>
|
41 |
+
<div class="input-group-append">
|
42 |
+
<button type="submit" id="send" class="input-group-text send_btn"><i class="fas fa-location-arrow"></i></button>
|
43 |
+
</div>
|
44 |
+
</form>
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
|
51 |
+
<script>
|
52 |
+
$(document).ready(function() {
|
53 |
+
$("#messageArea").on("submit", function(event) {
|
54 |
+
const date = new Date();
|
55 |
+
const hour = date.getHours();
|
56 |
+
const minute = date.getMinutes();
|
57 |
+
const str_time = hour+":"+minute;
|
58 |
+
var rawText = $("#text").val();
|
59 |
+
|
60 |
+
var userHtml = '<div class="d-flex justify-content-end mb-4"><div class="msg_cotainer_send">' + rawText + '<span class="msg_time_send">'+ str_time + '</span></div><div class="img_cont_msg"><img src="https://i.ibb.co/d5b84Xw/Untitled-design.png" class="rounded-circle user_img_msg"></div></div>';
|
61 |
+
|
62 |
+
$("#text").val("");
|
63 |
+
$("#messageFormeight").append(userHtml);
|
64 |
+
|
65 |
+
$.ajax({
|
66 |
+
data: {
|
67 |
+
msg: rawText,
|
68 |
+
},
|
69 |
+
type: "POST",
|
70 |
+
url: "/get",
|
71 |
+
}).done(function(data) {
|
72 |
+
var botHtml = '<div class="d-flex justify-content-start mb-4"><div class="img_cont_msg"><img src="https://www.prdistribution.com/spirit/uploads/pressreleases/2019/newsreleases/d83341deb75c4c4f6b113f27b1e42cd8-chatbot-florence-already-helps-thousands-of-patients-to-remember-their-medication.png" class="rounded-circle user_img_msg"></div><div class="msg_cotainer">' + data + '<span class="msg_time">' + str_time + '</span></div></div>';
|
73 |
+
$("#messageFormeight").append($.parseHTML(botHtml));
|
74 |
+
});
|
75 |
+
event.preventDefault();
|
76 |
+
});
|
77 |
+
});
|
78 |
+
</script>
|
79 |
+
|
80 |
+
</body>
|
81 |
</html>
|