-
Notifications
You must be signed in to change notification settings - Fork 13
/
signup.html
118 lines (118 loc) · 3.99 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Do you have an account?</title>
<script type="text/javascript" src="https://npmcdn.com/parse/dist/parse.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/Parking-Master/Simple-Alert@latest/simplealert.min.js"></script>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
background: #444;
}
input {
position: relative;
width: 50%;
height: 20px;
padding: 5px;
left: 50%;
margin-left: -25%;
margin-bottom: 50px;
outline: none !important;
border: 2px solid #25750a;
background: #333;
color: #25750a;
}
.swal-modal {
background: #444;
box-shadow: 0px 0px 10px 5px #ff4444;
}
.swal-modal *, .swal-text {
color: #ff4444 !important;
}
.swal-button {
background: #ff4444 !important;
color: #333 !important;
box-shadow: none !important;
outline: none !important;
}
* {
color: #333;
}
h1 {
text-align: center;
color: #333;
text-shadow: 0 2px #25750a;
margin-top: 100px;
}
button#submit {
position: relative;
color: #333;
background: #25750a;
height: 30px;
padding: 5px;
display: inline-flex;
text-align: center;
justify-content: center;
align-items: center;
border: none !important;
outline: none !important;
width: 50%;
left: 50%;
margin-left: -25%;
cursor: default;
transition: background 1s;
}
button#submit:hover {
background: #ff4444;
}
p {
margin-bottom: 100px;
}
a {
color: #25750a;
}
</style>
</head>
<body>
<h1 style="position:relative;width:50%;display:inline-flex;align-items:center;text-align:center;justify-content:center;left:50%;margin-left:-25%;">Sign up for <img src="favicon.ico" style="position:relative;width:4%;border-radius:100%;box-shadow:0 0 3.5px 2px #25750a" /></h1>
<p style="text-align:center">or <a href="login.html">Log in</a></p>
<label for="username" style="position:relative;left:50%;margin-left:-25%;">Username</label>
<br>
<input id="username" minlength="3" type="text" />
<br>
<label for="email" style="position:relative;left:50%;margin-left:-25%;">Email</label>
<br>
<input id="email" minlength="3" type="email" />
<br>
<label for="password" style="position:relative;left:50%;margin-left:-25%;">Password</label>
<br>
<input id="password" minlength="8" type="password" />
<br>
<button onclick="createParseUser()" id="submit">Submit</button>
<script>
Parse.initialize("qEK42aDtmQiBXmIoRdojDAYrKXGj5w4h2QnNRpYz","J4IK0gqf8rQS8G8Hg5LDbz0oEASJtRlUS2LPiRVg"),Parse.serverURL="https://parseapi.back4app.com/";
async function createParseUser() {
if (localStorage["perm-user"]) return swal({
title: "Error",
text: "Looks like you already have an account. We only allow 1 account per device."
}).then(() => location.replace("/"));
let user = new Parse.User();
user.set("username", document.getElementById("username").value);
user.set("email", document.getElementById("email").value);
user.set("password", document.getElementById("password").value);
try {
user = await user.save();
if (user !== null) {
swal("Success! You will need to log in now.").then(() => location.assign("login.html"));
localStorage.setItem("perm-user", user.get("username"));
}
} catch (error) {
error.code == 202 && swal("Error: A user already exists with that username.").then(() => {});
console.log(error);
}
}
</script>
</body>
</html>