forked from NamanTGG/AI-CHATBOT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTutorial.html
120 lines (118 loc) · 2.38 KB
/
Tutorial.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> ChatBot </title>
<style>
body{
margin: 0;
padding: 0;
width: 100%;
height:100vh;
overflow: hidden;
position: relative;
background-color: paleturquoise;
}
.box{
width: 490px;
height: 350px;
box-shadow: 5px 5px 20px #000;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border-radius: 20px;
}
.top{
width: 100%;
height: 80px;
background: cyan;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
}
.top h1{
margin: 0;
font-size: 30px;
color: crimson;
text-align: center;
padding-top: 10px;
font-family: sans-serif;
}
.mid{
width: 100%;
height: 150px;
background: yellow;
}
.mid .chat{
width: 100%;
}
.mid .chat h2{
margin: 0;
font-size: 30px;
color: #000;
padding:30px 20px;
text-align: center;
}
.mid .chat p{
margin: 0;
height: 30px;
font-size: 28px;
color: blue;
text-align: center;
background-color: yellow;
font-weight: 600;
letter-spacing: 0.04em;
}
.input{
height:100%;
width: 489px;
overflow: hidden;
}
.input input{
width: 100%;
height: 110px;
outline: none;
border: none;
padding-left: 30px;
padding-top:0;
font-family: monospace;
font-size: 50px;
background: lime;
}
</style>
</head>
<body>
<div class="box">
<div style="text-align: center;" class="top">
<h1>Send A Message !</h1>
</div>
<div class="mid">
<div class="chat">
<h2>Answers Are Below</h2>
<p id="chatLog">Let's Chat</p>
</div>
</div>
<div class="input">
<input type="text" id="userBox"onkeydown="if(event.keyCode == 13){ talk() }"placeholder="Type A Message">
</div>
</div>
<script>
function talk(){
var know ={
"Hi":"Hello",
"How Are You?":"Great !",
"Bye":"Have A Nice Day !",
"Hello":"Hi , Whats Up"
};
var user = document.getElementById('userBox').value;
document.getElementById('chatLog').innerHTML = user + "<br>";
if(user in know){
document.getElementById('chatLog').innerHTML = know[user] + "<br>";
}else{
document.getElementById('chatLog').innerHTML = "I do not understand .";
}
}
</script>
</body>
</html>