Create template/home.html
Browse files- template/home.html +94 -0
template/home.html
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Chat Interface</title>
|
7 |
+
<style>
|
8 |
+
body, html {
|
9 |
+
height: 100%;
|
10 |
+
margin: 0;
|
11 |
+
font-family: Arial, sans-serif;
|
12 |
+
}
|
13 |
+
.chat-container {
|
14 |
+
display: flex;
|
15 |
+
flex-direction: column;
|
16 |
+
height: 100%;
|
17 |
+
}
|
18 |
+
.header {
|
19 |
+
background-color: #056ca8;
|
20 |
+
color: white;
|
21 |
+
padding: 10px;
|
22 |
+
text-align: center;
|
23 |
+
}
|
24 |
+
.messages {
|
25 |
+
flex: 1;
|
26 |
+
padding: 10px;
|
27 |
+
overflow-y: auto;
|
28 |
+
background-color: #f2f2f2;
|
29 |
+
}
|
30 |
+
.message {
|
31 |
+
margin-bottom: 15px;
|
32 |
+
padding: 5px;
|
33 |
+
border-radius: 10px;
|
34 |
+
background-color: #fff;
|
35 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
36 |
+
}
|
37 |
+
.user-message {
|
38 |
+
background-color: #e7f5ff; /* Light blue for the user */
|
39 |
+
}
|
40 |
+
.bot-message {
|
41 |
+
background-color: #e6ffe6; /* Light purple for the bot */
|
42 |
+
}
|
43 |
+
.input-form {
|
44 |
+
padding: 10px;
|
45 |
+
background-color: #ddd;
|
46 |
+
}
|
47 |
+
.input-field {
|
48 |
+
width: 100%;
|
49 |
+
padding: 10px;
|
50 |
+
margin-bottom: 10px;
|
51 |
+
border: 1px solid #ccc;
|
52 |
+
border-radius: 5px;
|
53 |
+
}
|
54 |
+
.send-button {
|
55 |
+
width: 100%;
|
56 |
+
padding: 10px;
|
57 |
+
background-color: #056ca8;
|
58 |
+
color: white;
|
59 |
+
border: none;
|
60 |
+
border-radius: 5px;
|
61 |
+
cursor: pointer;
|
62 |
+
}
|
63 |
+
.send-button:hover {
|
64 |
+
background-color: #da6a01;
|
65 |
+
}
|
66 |
+
</style>
|
67 |
+
</head>
|
68 |
+
<body>
|
69 |
+
|
70 |
+
<div class="chat-container">
|
71 |
+
<div class="header">
|
72 |
+
<h2>Chat Application</h2>
|
73 |
+
</div>
|
74 |
+
|
75 |
+
<div class="messages" id="messageArea">
|
76 |
+
<!-- Dynamically insert messages here -->
|
77 |
+
{% for message in messages %}
|
78 |
+
{% if message.sender == "user" %}
|
79 |
+
<div class="message user-message">{{ message.text }}</div>
|
80 |
+
{% else %}
|
81 |
+
<div class="message bot-message">{{ message.text }}</div>
|
82 |
+
{% endif %}
|
83 |
+
{% endfor %}
|
84 |
+
</div>
|
85 |
+
|
86 |
+
<form class="input-form" action="/post_message" method="POST">
|
87 |
+
<input type="text" name="message" class="input-field" placeholder="Type your message here..." required>
|
88 |
+
<button type="submit" class="send-button">Send</button>
|
89 |
+
</form>
|
90 |
+
|
91 |
+
</div>
|
92 |
+
|
93 |
+
</body>
|
94 |
+
</html>
|