forked from tutsplus/realtime-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
53 lines (52 loc) · 2.09 KB
/
login.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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="//code.jquery.com/jquery-1.11.1.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script>
$(function(){
if ($.cookie("realtime-chat-nickname")) {
window.location = "/chat"
} else {
$("#frm-login").submit(function(event) {
event.preventDefault();
if ($("#nickname").val() !== '') {
$.cookie("realtime-chat-nickname", $("#nickname").val());
window.location = "/chat";
}
})
}
})
</script>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<style type="text/css">
</style>
</head>
<body>
<div class="container" style="padding-top: 50px">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Choose a nickname to enter chat</h3>
</div>
<div class="panel-body">
<form role="form" id="frm-login">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="Enter Nickname" name="nickname" id="nickname" type="text" autofocus required="">
</div>
<button type="submit" class="btn btn-lg btn-success btn-block">Enter Chat</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>