-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
138 lines (126 loc) · 3.2 KB
/
index.html
File metadata and controls
138 lines (126 loc) · 3.2 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LiveChat Styled Chat</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(180deg, #e9e9eb 0%, #e0dfdf 100%);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
#chat-window {
width: 360px;
background-color: #ffffff;
border-radius: 12px;
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 0px 2px 6px rgba(19, 19, 23, 0.08);
}
#chat-box {
flex-grow: 1;
padding: 20px 15px;
overflow-y: auto;
background-color: #f6f6f7;
display: flex;
flex-direction: column;
gap: 8px;
}
.chat-message {
padding: 10px 14px;
border-radius: 16px;
max-width: 75%;
line-height: 1.4;
font-size: 14px;
word-wrap: break-word;
display: inline-block;
}
.chat-message.you {
background-color: #3668ff;
color: #ffffff;
align-self: flex-end;
border-bottom-right-radius: 4px;
box-shadow: 0px 2px 6px rgba(19, 19, 23, 0.08);
}
.chat-message.agent {
background-color: #ffffff;
color: black;
align-self: flex-start;
border-bottom-left-radius: 4px;
box-shadow: 0px 2px 6px rgba(19, 19, 23, 0.08);
}
.chat-message.system {
font-style: italic;
text-align: center;
align-self: center;
font-size: 13px;
color: black;
padding: 6px 12px;
border-radius: 10px;
max-width: 90%;
}
#controls {
display: flex;
align-items: center;
gap: 10px;
border-top: 1px solid #e0dfdf;
padding: 12px;
background-color: #ffffff;
}
#message-input {
flex: 1;
border: none;
border-radius: 12px;
outline: none;
}
.btn {
padding: 10px 5px;
border: none;
cursor: pointer;
border-radius: 12px;
width: 22%;
box-shadow: 0px 2px 6px rgba(19, 19, 23, 0.08);
}
#send-btn {
background-color: #242424;
color: white;
}
#close-btn {
background-color: #ffffff;
border: 1px solid #51484d;
color: rgb(0, 0, 0);
display: block;
}
</style>
</head>
<body>
<div id="chat-window">
<div id="chat-box"></div>
<div id="controls">
<input
type="text"
id="message-input"
placeholder="Type your message..."
/>
<button id="send-btn" class="btn">Send</button>
<button id="close-btn" class="btn">End chat</button>
</div>
</div>
<script src="app.js"></script>
<script>
document
.getElementById("message-input")
.addEventListener("keydown", function (e) {
if (e.key === "Enter") {
document.getElementById("send-btn").click();
}
});
</script>
</body>
</html>