-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
44 lines (42 loc) · 1.43 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.4.1.js"
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous"></script>
<script type="text/javascript" src="socket.io/socket.io.js"></script>
<script src="node_modules/socket.io-client/dist/socket.io.js"></script>
<link rel="stylesheet" type="text/css" href="/css/index.css">
<title>Home</title>
</head>
<body>
<table>
<div id="login-area">
<div id="login-text">
<h1>Login page</h1>
</div>
<div id="login-form-area">
<form id="login-form">
<input id="username" type="text" placeholder="Username" autocomplete="off">
<input id="login-submit" type="submit" value="Login">
</form>
</div>
</div>
</table>
<div class="chat-area"></div>
</body>
<script type="text/javascript">
var socket = io();
$("#login-form").submit(function(event) {
event.preventDefault();
if($("#username") == "" | $("#username").val() == " ") {
alert("Invalid username!");
} else {
$("#login-area").hide();
$("#chat-area").show();
}
});
</script>
</html>