-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChatBox.html
More file actions
109 lines (98 loc) · 2.92 KB
/
ChatBox.html
File metadata and controls
109 lines (98 loc) · 2.92 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Chat Box</title>
<style>
body {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}
.chat-container {
width: 70%;
height: 70%;
max-width: 500px;
max-height: 500px;
border: 1px solid #ccc;
border-radius: 5px;
overflow: hidden;
display: flex;
flex-direction: column;
}
.message-container {
flex: 1;
overflow-y: scroll;
padding: 10px;
}
.message-card {
border: 1px solid #ccc;
border-radius: 5px;
padding: 10px;
margin: 10px;
max-width: 70%;
overflow-wrap: break-word;
}
.user-message {
background-color: #0084ff;
color: white;
float: right;
}
.received-message {
background-color: #f1f0f0;
float: left;
}
.input-container {
display: flex;
align-items: center;
padding: 10px;
background-color: #f7f7f7;
}
textarea {
flex: 1;
border-radius: 20px;
border: none;
padding: 10px;
}
input{
background-color: #0084ff;
color: white;
border: none;
border-radius: 20px;
padding: 10px;
margin-left: 10px;
cursor: pointer;
}
.clear {
clear: both;
}
</style>
</head>
<body>
<div class="chat-container">
<h1>Chat Box</h1>
<div class="message-container">
<div class="message-card user-message">Hi there!</div>
<div class="clear"></div>
<div class="message-card received-message">Hello! How can I help you today?</div>
<div class="clear"></div>
<div class="message-card user-message">I have a question about your product.</div>
<div class="clear"></div>
<div class="message-card received-message">Sure, what's your question?</div>
<div class="clear"></div>
<div class="message-card user-message">Can you tell me more about the features?</div>
<div class="clear"></div>
<div class="message-card received-message">Certainly! Our product has many great features, including...</div>
<div class="clear"></div>
<div class="message-card user-message">Thanks for your help!</div>
<div class="clear"></div>
<div class="message-card received-message">You're welcome! Let me know if you have any other questions.</div>
<div class="clear"></div>
</div>
<form class="input-container">
<textarea name="message">Type your message...</textarea>
<input type="submit" value="Send">
</form>
</div>
</body>
</html>