-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
158 lines (117 loc) · 3.01 KB
/
login.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
<!DOCTYPE html>
<html>
<head>
<title>MyPortfolio</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css" >
<link rel="stylesheet" type="text/css" media="all" href="css/font-awesome.min.css" />
<script src="js/jquery-1.2.1.min.js"></script>
</head>
<body>
<style>
body{
background-image: url(img/sutirta-budiman-kjOBqwMUnWw-unsplash.jpg) ;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
*{
box-sizing: border-box;
}
div{
display: flex;
flex-direction: column;
margin-left:15%;
margin-top: 5%;
padding: 20px;
width: 66.66666667%;
box-shadow: 0 2px 0 4px rgba(209, 156, 9, 0.1);
}
@media screen and (max-width: 600px) {
div{
width: 100%;
margin-left: 0;
}
}
label{
margin-bottom: 5px;
padding: 4px;
}
p:not(.after-login){
text-align: center;
font-size: 22px;
}
p.after-login{
color: white;
font-size: 17px;
}
p.after-login a{
color: white;
font-size: 17px;
}
input{
margin-bottom: 15px;
width: 100%;
}
.form-control{
padding:10px;
border: 1px solid gainsboro;
}
button{
width: 16%;
padding: 5px;
background-color: #367fa9;
color: #fff;
border-color: #204d74;
cursor: pointer;
}
button a{
color: #fff;
}
span.help-block{
color: red;
font-size: 12px;
margin-bottom: 12px;
}
</style>
<script type="text/javascript">
</script>
<div class="">
<label>Username</label>
<input type="text" placeholder="Enter your username" maxlength="10" class="form-control" id="user" name="username">
<span class="help-block" id="userErr"></span>
<br>
<label>Password</label>
<input type="password" placeholder="Enter your password" class="form-control" name="password" id="pass">
<span class="help-block" id="passErr"></span>
<br>
<button class="btn-control" onclick="validate();">Login</button>
<p class="after-login">Don't have an account?<a href="">Sign up now </a> </p>
<p class="after-login">Forgot password ? <a href="">Reset now </a> </p>
</div>
<script>
function validate(){
var username = document.getElementById("user").value;
var password = document.getElementById("pass").value;
if(username == ""){
document.getElementById("userErr").textContent = "Username cannot be empty";
username = false;
//alert(typeof(username))
}else{
username = true;
}
if(password == ""){
document.getElementById("passErr").textContent = "Please enter your password";
password = false;
//alert(typeof(username))
}else{
password = true;
}
if(username && password == true){
window.location="real.html";
}
}
</script>
</body>
</html>