This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mword-signup.html
181 lines (162 loc) · 4.07 KB
/
mword-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
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
---
layout: false
---
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>注册到 背单词</title>
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" src="/jquery.js"></script>
<script type="text/javascript" src="/av-min.js"></script>
<script type="text/javascript">
$(function () {
AV.init({
appId: "1KbhNSxDBKNOvAiGQEJqPE6B-gzGzoHsz",
appKey: "aWxGGJwdeWE7rmxyLWIbkuyT",
serverURLs: "https://1kbhnsxd.lc-cn-n1-shared.com"
})
var MW = AV
var currentUser = MW.User.current()
if (currentUser) {
window.location = "mword-user.html"
}
$("#submit").off("click").on("click", function () {
if ($("#username").val() != "" && $("#nickname").val() != "" && $("#password").val() != "" && $("#email").val() != "") {
var user = new MW.User()
user.setUsername($("#username").val())
user.set("nickname", $("#nickname").val())
user.setPassword($("#password").val())
user.setEmail($("#email").val())
$("#username").val("")
$("#nickname").val("")
$("#password").val("")
$("#email").val("")
user.signUp().then(function (user) {
alert("注册成功 请验证邮箱")
MW.User.logOut()
window.location = "mword-login.html"
}, function (error) {
alert(error)
})
}
})
})
</script>
<style type="text/css">
.form-bg {
padding: 2em 0;
}
.form-horizontal {
background: #fff;
padding-bottom: 40px;
border-radius: 15px;
text-align: center;
}
.form-horizontal .heading {
display: block;
font-size: 35px;
font-weight: 700;
padding: 35px 0;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 30px;
}
.form-horizontal .form-group {
padding: 0 40px;
margin: 0 0 25px 0;
position: relative;
}
.form-horizontal .form-control {
background: #f0f0f0;
border: none;
border-radius: 20px;
box-shadow: none;
padding: 0 20px 0 20px;
height: 40px;
transition: all 0.3s ease 0s;
}
.form-horizontal .form-control:focus {
background: #e0e0e0;
box-shadow: none;
outline: 0 none;
}
.form-horizontal .form-group i {
position: absolute;
top: 12px;
left: 60px;
font-size: 17px;
color: #c8c8c8;
transition: all 0.5s ease 0s;
}
.form-horizontal .form-control:focus+i {
color: #00b4ef;
}
.form-horizontal .btn {
width: 100%;
font-size: 14px;
color: #fff;
background: #00b4ef;
border-radius: 30px;
padding: 10px 25px;
border: none;
text-transform: capitalize;
transition: all 0.5s ease 0s;
}
@media only screen and (max-width: 479px) {
.form-horizontal .form-group {
padding: 0 25px;
}
.form-horizontal .form-group i {
left: 45px;
}
.form-horizontal .btn {
padding: 10px 20px;
}
}
body {
background-image: linear-gradient(45deg, #7A88FF, #7AFFAF);
display: flex;
display: -webkit-flex;
align-items: center;
}
html {
height: 100%;
}
.container {
width: 90%;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-offset-3 col-md-6">
<form class="form-horizontal">
<span class="heading">注册</span>
<div class="form-group">
<input type="text" class="form-control" id="username" placeholder="用户名">
</div>
<div class="form-group">
<input type="text" class="form-control" id="nickname" placeholder="昵称">
</div>
<div class="form-group">
<input type="email" class="form-control" id="email" placeholder="电子邮件">
</div>
<div class="form-group">
<input type="password" class="form-control" id="password" placeholder="密码">
</div>
<div class="form-group">
<button type="button" class="btn btn-default" id="submit">注册</button>
</div>
<div class="form-group">
<span>已有账号?<a href="mword-login.html">登录</a></span>
</div>
<div class="form-group">
<span>返回到 <a href="mword.html">背单词</a></span>
</div>
</form>
</div>
</div>
</div>
</body>
</html>