Spaces:
Running
Running
Update index.html
Browse files- index.html +66 -17
index.html
CHANGED
@@ -1,19 +1,68 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
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>AI ChatBot</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
background-color: #f4f4f4;
|
11 |
+
}
|
12 |
+
#chat-container {
|
13 |
+
width: 80%;
|
14 |
+
margin: auto;
|
15 |
+
margin-top: 50px;
|
16 |
+
padding: 20px;
|
17 |
+
border: 1px solid #ccc;
|
18 |
+
background-color: #fff;
|
19 |
+
position: relative;
|
20 |
+
overflow: auto;
|
21 |
+
height: 400px;
|
22 |
+
}
|
23 |
+
.user, .bot {
|
24 |
+
padding: 10px;
|
25 |
+
margin: 10px;
|
26 |
+
border-radius: 5px;
|
27 |
+
}
|
28 |
+
.user {
|
29 |
+
background-color: #e0e0e0;
|
30 |
+
text-align: right;
|
31 |
+
}
|
32 |
+
.bot {
|
33 |
+
background-color: #d1f5d3;
|
34 |
+
}
|
35 |
+
#input-container {
|
36 |
+
margin-top: 20px;
|
37 |
+
}
|
38 |
+
</style>
|
39 |
+
</head>
|
40 |
+
<body>
|
41 |
+
<div id="chat-container"></div>
|
42 |
+
<div id="input-container">
|
43 |
+
<input type="text" id="user-input" style="width:80%">
|
44 |
+
<button onclick="sendMessage()">Send</button>
|
45 |
+
</div>
|
46 |
+
<script>
|
47 |
+
function appendMessage(who, text) {
|
48 |
+
const div = document.createElement('div');
|
49 |
+
div.className = who;
|
50 |
+
div.textContent = text;
|
51 |
+
document.getElementById('chat-container').appendChild(div);
|
52 |
+
}
|
53 |
+
|
54 |
+
function sendMessage() {
|
55 |
+
const input = document.getElementById('user-input');
|
56 |
+
const text = input.value;
|
57 |
+
input.value = '';
|
58 |
+
|
59 |
+
// Append user message to chat
|
60 |
+
appendMessage('user', text);
|
61 |
+
|
62 |
+
// TODO: Call your AI model to get a response and append to chat
|
63 |
+
const response = 'AI response goes here'; // Replace with actual response
|
64 |
+
appendMessage('bot', response);
|
65 |
+
}
|
66 |
+
</script>
|
67 |
+
</body>
|
68 |
</html>
|