forked from yogeshswdev/html5_CSS_JavaScript_JQuery_start
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.html
More file actions
93 lines (78 loc) · 3.26 KB
/
Copy pathchat.html
File metadata and controls
93 lines (78 loc) · 3.26 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat Bot</title>
<link rel="stylesheet" href="chat.css">
<link rel="stylesheet" href="contact.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<nav>
<!--input type="checkbox" id="check">
<label for="check" class="checkbtn">
<i class="fas fa-bars"></i>
</label-->
<label class="logo">Chat</label>
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li><a href="contact1.html">Contact</a></li>
<li><a href="join.html">Join Us</a></li>
<li><a href="https://forms.gle/vJGSHEzD4Prx2uEM9">Feedback</a></li>
</ul>
</nav>
<!-- CHAT BAR BLOCK -->
<div class="chat-bar-collapsible">
<button id="chat-button" type="button" class="collapsible">Chat with us!
<i id="chat-icon" style="color: #fff;" class="fa fa-fw fa-comments-o"></i>
</button>
<div class="content">
<div class="full-chat-block">
<!-- Message Container -->
<div class="outer-container">
<div class="chat-container">
<!-- Messages -->
<div id="chatbox">
<h5 id="chat-timestamp"></h5>
<p id="botStarterMessage" class="botText"><span>Loading...</span></p>
</div>
<!-- User input box -->
<div class="chat-bar-input-block">
<div id="userInput">
<input id="textInput" class="input-box" type="text" name="msg"
placeholder="Tap 'Enter' to send a message">
<p></p>
</div>
<div class="chat-bar-icons">
<i id="chat-icon" style="color: #333;" class="fa fa-fw fa-send"
onclick="sendButton()"></i>
</div>
</div>
<div id="chat-bar-bottom">
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
let input = document.querySelector(".input-box");
let button = document.querySelector(".fa fa-fw fa-send");
button.disabled = true; //setting button state to disabled
input.addEventListener("change", stateHandle);
function stateHandle() {
if (document.querySelector(".input-box").value === "") {
button.disabled = true; //button remains disabled
} else {
button.disabled = false; //button is enabled
}
}</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="responses.js"></script>
<script src="chat.js"></script>
</html>