-
Notifications
You must be signed in to change notification settings - Fork 5
/
张昕_20281199.html
400 lines (353 loc) · 12.2 KB
/
张昕_20281199.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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
<!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.0">
<title>Zx1n-ShellScripts</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
}
body {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
background-color: #ecf0f3;
color: #a0a5a8;
}
.shell {
position: relative;
width: 1000px;
min-width: 1000px;
min-height: 600px;
height: 600px;
padding: 25px;
background-color: #ecf0f3;
box-shadow: 10px 10px 10px #d1d9e6, -10px -10px 10px #f9f9f9;
border-radius: 12px;
overflow: hidden;
}
/* 设置响应式 */
@media (max-width: 1200px) {
.shell {
transform: scale(0.7);
}
}
@media (max-width: 1000px) {
.shell {
transform: scale(0.6);
}
}
@media (max-width: 800px) {
.shell {
transform: scale(0.5);
}
}
@media (max-width: 600px) {
.shell {
transform: scale(0.4);
}
}
.container {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
width: 600px;
height: 100%;
padding: 25px;
background-color: #ecf0f3;
transition: 1.25s;
}
.form {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 100%;
}
.form_input {
width: 350px;
height: 40px;
margin: 4px 0;
padding-left: 25px;
font-size: 13px;
letter-spacing: 0.15px;
border: none;
outline: none;
background-color: #ecf0f3;
transition: 0.25s ease;
border-radius: 8px;
box-shadow: inset 2px 2px 4px #d1d9e6, inset -2px -2px 4px #f9f9f9;
}
.form_input:focus {
box-shadow: inset 4px 4px 4px #d1d9e6, inset -4px -4px 4px #f9f9f9;
}
.form_span {
margin-top: 40px;
margin-bottom: 15px;
}
.form_link {
color: #181818;
font-size: 15px;
margin-top: 25px;
border-bottom: 1px solid #a0a5a8;
line-height: 2;
}
.title {
font-size: 34px;
font-weight: 700;
line-height: 3;
color: #181818;
letter-spacing: 10px;
}
.description {
font-size: 14px;
letter-spacing: 0.25px;
text-align: center;
line-height: 1.6;
}
.button {
width: 180px;
height: 50px;
border-radius: 25px;
margin-top: 50px;
font-weight: 700;
font-size: 14px;
letter-spacing: 1.15px;
background-color: #4B70E2;
color: #f9f9f9;
box-shadow: 8px 8px 16px #d1d9e6, -8px -8px 16px #f9f9f9;
border: none;
outline: none;
}
.a-container {
z-index: 100;
left: calc(100% - 600px);
}
.b-container {
left: calc(100% - 600px);
z-index: 0;
}
.switch {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 400px;
padding: 50px;
z-index: 200;
transition: 1.25s;
background-color: #ecf0f3;
overflow: hidden;
box-shadow: 4px 4px 10px #d1d9e6, -4px -4px 10px #d1d9e6;
}
.switch_circle {
position: absolute;
width: 500px;
height: 500px;
border-radius: 50%;
background-color: #ecf0f3;
box-shadow: inset 8px 8px 12px #b8bec7, inset -8px -8px 12px #fff;
bottom: -60%;
left: -60%;
transition: 1.25s;
}
.switch_circle-t {
top: -30%;
left: 60%;
width: 300px;
height: 300px;
}
.switch_container {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: absolute;
width: 400px;
padding: 50px 55px;
transition: 1.25s;
}
.switch_button {
cursor: pointer;
}
.switch_button:hover,
.submit:hover {
box-shadow: 6px 6px 10px #d1d9e6, -6px -6px 10px #f9f9f9;
transform: scale(0.985);
transition: 0.25s;
}
.switch_button:active,
.switch_button:focus {
box-shadow: 2px 2px 6px #d1d9e6, -2px -2px 6px #f9f9f9;
transform: scale(0.97);
transition: 0.25s;
}
.is-txr {
left: calc(100% - 400px);
transition: 1.25s;
transform-origin: left;
}
.is-txl {
left: 0;
transition: 1.25s;
transform-origin: right;
}
.is-z {
z-index: 200;
transition: 1.25s;
}
.is-hidden {
visibility: hidden;
opacity: 0;
position: absolute;
transition: 1.25s;
}
.is-gx {
animation: is-gx 1.25s;
}
@keyframes is-gx {
0%,
10%,
100% {
width: 400px;
}
30%,
50% {
width: 500px;
}
}
</style>
</head>
<body>
<div class="shell">
<div class="container a-container" id="a-container">
<form action="" method="" class="form" id="a-form">
<h2 class="form_title title">创建账号</h2>
<span class="form_span">填写相关方式注册新账号</span>
<input type="text" class="form_input" placeholder="Name">
<input type="text" class="form_input" placeholder="Email">
<input type="text" class="form_input" placeholder="phone number">
<input type="text" class="form_input" placeholder="Password">
<button class="form_button button submit">SIGN UP</button>
</form>
</div>
<div class="container b-container" id="b-container">
<form action="" method="" class="form" id="b-form">
<h1 class="form_title title">登入账号</h1>
<div class="form_icons">
<i class="iconfont icon-QQ"></i>
<i class="iconfont icon-weixin"></i>
<i class="iconfont icon-bilibili-line"></i>
</div>
<span class="form_span"><h2>选择登录方式</h2></span>
<input type="text" class="form_input" placeholder="Email/Phone Number">
<div class="form_checkbox">
<input type="checkbox" id="use-otp" name="use-otp">
<label for="use-otp">使用手机验证码登录</label>
</div>
<div id="otp-section" style="display: none;">
<input type="text" class="form_input" placeholder="验证码">
</div>
<div id="password-section">
<input type="password" class="form_input" placeholder="Password">
</div>
<a class="form_link">忘记密码?</a>
<button class="form_button button submit">SIGN IN</button>
</form>
</div>
<script>
const validUsername = '13993605605';
const validPassword = 'zx20020327';
const useOtpCheckbox = document.getElementById('use-otp');
const otpSection = document.getElementById('otp-section');
const passwordSection = document.getElementById('password-section');
const submitBtn = document.querySelector('#b-form .submit');
submitBtn.addEventListener('click', (event) => {
event.preventDefault(); // Prevent form submission
const enteredUsername = document.querySelector('#b-form input[type="text"]').value;
const enteredPassword = document.querySelector('#b-form input[type="password"]').value;
if (enteredUsername === validUsername && enteredPassword === validPassword) {
alert('登录成功!');
} else {
alert('用户名或密码错误!');
}
});
useOtpCheckbox.addEventListener('change', () => {
if (useOtpCheckbox.checked) {
otpSection.style.display = 'block';
passwordSection.style.display = 'none';
} else {
otpSection.style.display = 'none';
passwordSection.style.display = 'block';
}
});
</script>
<div class="switch" id="switch-cnt">
<div class="switch_circle"></div>
<div class="switch_circle switch_circle-t"></div>
<div class="switch_container" id="switch-c1">
<h2 class="switch_title title" style="letter-spacing: 0;">开始旅行吧!</h2>
<p class="switch_description description">“选择已有账号登陆”</p>
<p class="switch_description description">点击下方按钮,使用现有账号登陆</p>
<button class="switch_button button switch-btn">SIGN IN</button>
</div>
<div class="switch_container is-hidden" id="switch-c2">
<h2 class="switch_title title" style="letter-spacing: 0;">有朋自远方来!</h2>
<p class="switch_description description">点击下方按钮,注册新账号</p>
<p class="switch_description description">快来与我一起踏入新旅程吧</p>
<button class="switch_button button switch-btn">SIGN UP</button>
</div>
</div>
</div>
</body>
</html>
<script>
let switchCtn = document.querySelector("#switch-cnt");
let switchC1 = document.querySelector("#switch-c1");
let switchC2 = document.querySelector("#switch-c2");
let switchCircle = document.querySelectorAll(".switch_circle");
let switchBtn = document.querySelectorAll(".switch-btn");
let aContainer = document.querySelector("#a-container");
let bContainer = document.querySelector("#b-container");
let allButtons = document.querySelectorAll(".submit");
let getButtons = (e) => e.preventDefault()
let changeForm = (e) => {
// 修改类名
switchCtn.classList.add("is-gx");
setTimeout(function () {
switchCtn.classList.remove("is-gx");
}, 1500)
switchCtn.classList.toggle("is-txr");
switchCircle[0].classList.toggle("is-txr");
switchCircle[1].classList.toggle("is-txr");
switchC1.classList.toggle("is-hidden");
switchC2.classList.toggle("is-hidden");
aContainer.classList.toggle("is-txl");
bContainer.classList.toggle("is-txl");
bContainer.classList.toggle("is-z");
}
// 点击切换
let shell = (e) => {
for (var i = 0; i < allButtons.length; i++)
allButtons[i].addEventListener("click", getButtons);
for (var i = 0; i < switchBtn.length; i++)
switchBtn[i].addEventListener("click", changeForm)
}
window.addEventListener("load", shell);
</script>
</body>
</html>