-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
209 lines (176 loc) · 4.54 KB
/
index.php
File metadata and controls
209 lines (176 loc) · 4.54 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="stylesheet" href="style.css">
</head>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
background-color: #222;
}
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
/* flex-direction: column; To place welcome admin text above the card */
}
.card {
background-color: #fff;
padding: 30px;
border-radius: 5px;
width: 400px;
max-width: 100%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #000;
font-size: 24px;
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
/* .glow {
animation: glowing 2s infinite;
} */
@keyframes glowing {
0% {
color: #fff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
50% {
color: #bbb;
text-shadow: none;
}
100% {
color: #fff;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 5px;
color: #333;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
.username-icon {
position: absolute;
top: 43.7%;
right: 608px;
transform: translateY(-110%);
cursor: pointer;
height: 19px;
width: 20px;
}
.eye-icon {
position: absolute;
top: 55%;
right: 10px;
transform: translateY(-50%);
cursor: pointer;
height: 24px;
width: 26px;
}
button {
display: block;
width: 100%;
padding: 10px;
background-color: #222;
color: #fff;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #111;
}
.signup-link {
text-align: center;
margin-top: 20px;
color: #333;
}
.error-message {
color: red;
margin-top: 10px;
text-align: center;
}
.input-group {
position: relative;
}
/* Decrease the font size for the forgot password link */
.forgot-password-link {
font-size: 14px;
}
@media (max-width: 500px) {
.eye-icon {
top: calc(50% - 10px);
right: 5px;
}
.username-icon {
top: calc(50% - 10px);
right: 5px;
}
}
</style>
<body>
<div class="container">
<div class="card">
<h1 class="glow">Welcome Admin</h1><br>
<form action="login.php" method="POST" class="login-form">
<div class="form-group">
<label for="username">Enter Username</label>
<input type="text" id="username" name="username" required>
<img src="user.png" alt="Mail Icon" class="username-icon" id="username-icon">
</div>
<div class="form-group">
<label for="password">Enter Password</label>
<div class="input-group">
<input type="password" id="password" name="password" required>
<img src="eye_closed.png" alt="Eye Icon" class="eye-icon" id="eye-icon">
</div>
</div>
<div class="form-group">
<a href="forgot_password.php" class="forgot-password-link">Forgot Password?</a>
</div>
<div class="form-group">
<button type="submit" name="submit">Login</button>
</div>
</form>
<!-- Display error message if it exists -->
<?php if (isset($error_message)) { ?>
<div class="error-message"><?php echo $error_message; ?></div>
<?php } ?>
<div class="signup-link"> Don't have an account? <a href="signup.php">Sign Up</a>
</div>
</div>
</div>
<script>
var passwordInput = document.getElementById("password");
var eyeIcon = document.getElementById("eye-icon");
var isPasswordVisible = false;
var eyeClosedImg = "eye_closed.png";
var eyeOpenImg = "eye_open.png";
eyeIcon.addEventListener("click", function() {
isPasswordVisible = !isPasswordVisible;
passwordInput.type = isPasswordVisible ? "text" : "password";
eyeIcon.src = isPasswordVisible ? eyeOpenImg : eyeClosedImg;
});
</script>
</body>
</html>