-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
executable file
·279 lines (277 loc) · 14.5 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<!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">
<link rel="shortcut icon" href="https://time2hack.com/favicon.png" type="image/png">
<link rel="icon" href="https://time2hack.com/favicon.png" type="image/png">
<title>Time to Hack: Simple Login with Firebase Web API</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="./style.css">
</head>
<body class="auth-false">
<div class="container">
<header class="clearfix">
<h1>Contact Book</h1>
<div class="userAuth unauthenticated pull-right">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#registerModal">Register</button>
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#loginModal">Login</button>
</div>
<div class="userAuth authenticated pull-right">
<div class="d-inline-block">
<span class="user-info" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img src="./user.svg" alt="User" class="rounded-circle" />
</span>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#updateInfoModal">Update Info</a>
<a class="dropdown-item" href="#" data-target="#forgotPasswordModal" data-toggle="modal" id="changePasswordTrigger">Change Password</a>
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#connectSocialAccountsModal">Connect Social Accounts</a>
</div>
</div>
<button type="button" class="btn btn-success" id="logout">Logout</button>
</div>
</header>
<hr/>
<main class="authenticated">
<center>
<div id="email-verification" class="d-none">
<div class="alert alert-danger" role="alert">
Email not verified! Please verify your email!<br/>To send verification email, <a href="#" id="send-verification">Click Here</a>
</div>
<div class="text-center">
<span class="d-inline-block alert alert-warning" role="alert">You can not Contacts until you verify your email!</span>
</div>
</div>
<button type="button" id="addContactModalTrigger" class="btn btn-primary" data-toggle="modal" data-target="#addContactModal">Add Contact</button>
</center>
<div id="contacts"></div>
</main>
</div>
<div class="row">
<div class="col-md-6">
<div><iframe src="//time2hack.com/ads.html" frameborder=0 width="100%" class="embed-responsive-item" align="center"></iframe></div>
</div>
<div class="col-md-6">
<div><iframe src="//time2hack.com/ads.html" frameborder=0 width="100%" class="embed-responsive-item" align="center"></iframe></div>
</div>
</div>
<div class="modal fade" id="registerModal" tabindex="-1" role="dialog" aria-labelledby="Register" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form id="registerForm" method="POST">
<div class="modal-header">
<h4 class="modal-title" id="registerModalLabel">Register</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="registerFirstName" class="control-label">First Name:</label>
<input type="text" class="form-control" id="registerFirstName">
</div>
<div class="form-group">
<label for="registerLastName" class="control-label">Last Name:</label>
<input type="text" class="form-control" id="registerLastName">
</div>
<div class="form-group">
<label for="registerEmail" class="control-label">Email:</label>
<input type="text" class="form-control" id="registerEmail">
</div>
<div class="form-group">
<label for="registerPassword" class="control-label">Password:</label>
<input type="password" class="form-control" id="registerPassword">
</div>
<div class="form-group">
<label for="registerConfirmPassword" class="control-label">Confirm Password:</label>
<input type="password" class="form-control" id="registerConfirmPassword">
</div>
<div class="form-group">
<label for="registerPhoto" class="control-label">Profile Picture:</label>
<input type="file" class="form-control" id="registerPhoto">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="doRegister">Register</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="loginModal" tabindex="-1" role="dialog" aria-label="Login" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form id="loginForm" method="POST">
<div class="modal-header">
<h4 class="modal-title" id="loginModalLabel">Login</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="recipient-name" class="control-label">Email:</label>
<input type="text" class="form-control" id="loginEmail">
</div>
<div class="form-group">
<label for="message-text" class="control-label">Password:</label>
<input type="password" class="form-control" id="loginPassword">
</div>
<div class="form-group">
<a data-target="#forgotPasswordModal" data-toggle="modal" data-dismiss="modal" href="#" id="forgotPasswordTrigger">Forgot Password?</a>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="doLogin">Login</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="forgotPasswordModal" tabindex="-1" role="dialog" aria-label="Forgot Password" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form id="forgotPasswordForm" method="POST">
<div class="modal-header">
<h4 class="modal-title auth-false" id="forgotPasswordModalLabel">Forgot Password</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="recipient-name" class="control-label">Email:</label>
<input type="text" name="email" class="form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" data-target="#loginModal" data-toggle="modal" class="btn btn-primary auth-false">Login</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Send Reset Link</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="addContactModal" tabindex="-1" role="dialog" aria-labelledby="Add Contact" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form method="POST" id="contactForm" name="contactForm">
<div class="modal-header">
<h4 class="modal-title" id="addContactModalLabel">Add Contact</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" name="name" id="name" required placeholder="Enter name">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email" required placeholder="Enter Email">
</div>
<h3>Location</h3>
<div class="form-group">
<label for="city">City</label>
<input type="text" class="form-control" name="city" id="city" placeholder="Enter City">
</div>
<div class="form-group">
<label for="email">State</label>
<input type="text" class="form-control" name="state" id="state" placeholder="Enter State">
</div>
<div class="form-group">
<label for="zip">Zip</label>
<input type="text" class="form-control" name="zip" id="zip" placeholder="Enter Zip Code">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary addValue">Submit</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="messageModal" tabindex="-1" role="dialog" aria-labelledby="Message" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="messageModalLabel">Message</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-footer">
<div class="pre-auth">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">Close</button>
<span class="">
<button type="submit" class="btn btn-primary" data-dismiss="modal" data-toggle="modal" data-target="#registerModal">Register</button>
<button type="submit" class="btn btn-success" data-dismiss="modal" data-toggle="modal" data-target="#loginModal">Login</button>
</span>
</div>
<div class="post-auth"></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="updateInfoModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<form id="updateForm" method="POST">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="messageModalLabel">Update Info</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="updateFirstName" class="control-label">First Name:</label>
<input type="text" class="form-control" name="firstName" id="updateFirstName">
</div>
<div class="form-group">
<label for="updateLastName" class="control-label">Last Name:</label>
<input type="text" class="form-control" name="lastName" id="updateLastName">
</div>
<div class="form-group">
<label for="updatePhoto" class="control-label">Profile Picture:</label>
<input type="file" class="form-control" name="photo" id="updatePhoto">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" id="doUpdate">Update</button>
</div>
</div>
</form>
</div>
</div>
<div class="modal fade" id="connectSocialAccountsModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<form id="connectSocialAccountsForm" method="POST">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Connect Social Accounts</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div class="form-group">
<button type="button" class="btn btn-primary linkSocial" id="linkFacebook" data-provider="Facebook"><i class="fa fa-facebook"></i> Connect Facebook</button>
</div>
<div class="form-group">
<button type="button" class="btn btn-primary linkSocial" id="linkTwitter" data-provider="Twitter"><i class="fa fa-twitter"></i> Connect Twitter</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-dark" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-database.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.0.0/firebase-storage.js"></script>
<!-- Contacts Store JavaScript -->
<script src="./functions.js"></script>
<script src="./script.js"></script>
</body>
</html>