-
Notifications
You must be signed in to change notification settings - Fork 5
/
郭锦荣-20281175.html
171 lines (155 loc) · 4.43 KB
/
郭锦荣-20281175.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>sign in</title>
</head>
<style>
.first {
background-color: red;
height: 50px;
}
.second {
background-color: blue;
border: 5px solid darkblue;
height: 700px;
width: 500px;
margin: auto ;
}
.second_fr{
background-color: gray;
height: 500px;
width: 450px;
margin: auto;
margin-top: 100px;
}
.second_pi{
border: 1px solid darkblue;
height: 100px;
width: 450px;
}
.second_pi2{
display: grid;
grid-template-columns: 150px 150px 150px;
}
.sec_1{
border: 1px solid darkblue;
height: 100px;
width: 150px;
}
.sec_11{
font-size: x-large;
margin-top: 30%;
}
.sec_21{
margin-top: 7.5%;
}
.sec_22{
height: 50px;
width: 400px;
margin-top: 20px;
}
.sec_31{
background-image: url(null.jpg);
display: inline-block;
height: 17px;
width: 17px;
background-size: 14px 14px;
}
.sec_32{
border: 1px solid darkblue;
margin-top: 60px;
margin-left: 20px;
width: 250px;
}
.sec_41{
width: 400px;
background-color: yellow;
font-size: x-large;
margin-left: 25px;
}
.sec_42{
margin-left: 200px;
margin-bottom: 0%;
}
</style>
<body>
<div class="first">
<img src="null.jpg" style="width: 30px;height: 30px;" alt="">
</div>
<div class="second">
<div class="second_fr">
<div class="second_pi second_pi2">
<div class="sec_1">
<div class="sec_11" id="d1">
账号登录
</div>
<div class="sec_12">
</div>
</div>
<div class="sec_1">
<div class="sec_11" id="d2">
验证码登录
</div>
<div class="sec_12">
</div>
</div>
</div>
<div class="second_pi">
<img src="login1.png" class="sec_21" alt="">
<input type="text" class="sec_22" id="1" value="输入用户名">
</div>
<div class="second_pi">
<img src="login2.png" class="sec_21" alt="">
<input type="text" class="sec_22" id="2" value="输入密码">
</div>
<div class="second_pi">
<a href="null.jpg" style="color: black;margin-left: 330px;">忘记账号/密码</a>
<div class="sec_32" >
<span class="sec_31"></span>已阅并同意
<a href="null.jpg" style="color: black;">《隐私协议》</a>
</div>
</div>
<div class="second_pi">
<button class="sec_41" id="3">
登录
</button>
<a href="null.jpg" class="sec_42">注册</a>
</div>
</div>
</div>
</body>
<script>
var user={
username:"admin",
userpassword:123456
}
function click(){
var m=document.getElementById("1")
var n=document.getElementById("2")
if(m.value == user.username && n.value==user.userpassword)
{window.alert("登录成功")
console.log(m)}
else window.alert("登录失败")
}
function click1(){
const in1=document.getElementById('1')
const in2=document.getElementById('2')
in1.setAttribute('value','输入用户名')
in2.setAttribute('value','输入密码')
}
function click2(){
const in1=document.getElementById('1')
const in2=document.getElementById('2')
in1.setAttribute('value','输入手机号')
in2.setAttribute('value','输入验证码')
}
const dom = document.getElementById('3');
dom.addEventListener('click', click);
const d1=document.getElementById('d1')
const d2=document.getElementById('d2')
d1.addEventListener('click',click1)
d2.addEventListener('click',click2)
</script>
</html>