forked from muhammadsalama909/muhammadsalama909.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
207 lines (182 loc) · 6.74 KB
/
index.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
<!DOCTYPE html PUBLIC '-//W3C//Dtd XHTML 1.0 Transitional//EN' 'http://www.w3.org/tr/xhtml1/Dtd/xhtml1-Transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='utf-8' lang='utf-8' dir='ltr'>
<head>
<meta charset='UTF-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Login to continue</title>
<style>
* {
font-family: Verdana, Geneva, Tahoma, sans-serif;
overflow: hidden;
}
.wrapper {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.dialog-box {
background: linear-gradient(180deg, #081b4d, #001780);
padding: 20px;
border-radius: 5px;
}
.dialog-box .title {
color: #fff;
font-size: 25px;
font-weight: bolder;
text-shadow: 0px 0 20px #000;
margin-top: 0;
text-align: center;
}
.form-locked {
background-color: #fff;
padding: 15px 25px;
font-size: 12px;
text-align: center;
display: none;
}
.form {
background-color: #fff;
padding: 15px 25px;
}
.form table {
margin-block-end: 15px;
}
.form .incorrect-information {
font-size: 12px;
color: #ff0000;
text-align: center;
margin: 0;
margin-block-end: 15px;
display: none;
}
.dialog-box .submit {
border-radius: 10px;
background: #001780;
padding: 7px 28px;
color: #fff;
font-weight: bold;
font-size: 10px;
border: none;
}
.footer {
color: #fff;
font-size: 13px;
margin-block-start: 1em;
margin-block-end: 1em;
}
</style>
</head>
<body>
<div id="redirectpage" style="height: 100vh; z-index: 1; background-color: #fff; color: #000; display: none;">
<p>Sending request...</p>
</div>
<div class='wrapper' id="wrapper">
<div class='dialog-box'>
<p class='title' id='title'>PLEASE LOGIN TO CONTINUE !</p>
<p style="display: none;" id="failedAttempts">0</p>
<div class='form-locked' id='formlocked'>
<span id='timer'>5 failed attempts, you have been blocked from signing in, try again in 60 seconds.</span>
</div>
<div class='form' id='form'>
<p id='incorrect' class='incorrect-information'>Your username or password is incorrect. Please try again.</p>
<table>
<tbody>
<tr>
<td width='200'>Username</td>
<td>
<input name='username' type='text' id='username' style='width:150px'>
</td>
</tr>
<tr>
<td width='200'>Password</td>
<td>
<input name='password' type='password' id='password' autocomplete='off' style='width:150px'>
</td>
</tr>
</tbody>
</table>
<button id='btnlogin' class='submit' onclick="sendRequest()">Login</button>
</div>
<div style='text-align: center; margin-block-start: 1em; margin-block-end: 1em;'>
<span class='footer'>Copyright by dbr.ee, 2000 - </span><span class='footer' id='year'></span><span class='footer'>, All Rights Reserved.</span>
</div>
</div>
</div>
</body>
<script>
var title = document.getElementById('title');
var countdown = document.getElementById('timer');
var btn_login = document.getElementById('btnlogin')
var year = document.getElementById('year');
var incorrect = document.getElementById('incorrect');
var locked = document.getElementById('formlocked');
var form = document.getElementById('form');
year.innerText = new Date().getFullYear();
var failedAttempts = document.getElementById('failedAttempts');
function startTimer(duration, display) {
var timer = duration, seconds;
var set = setInterval(function () {
seconds = parseInt(timer % 60, 10);
seconds = seconds == 1 ? seconds + ' second': seconds + ' seconds'
display.innerText = `5 failed attempts, you have been blocked from signing in, try again in ${seconds}.`
if (--timer < 0) {
unlockForm();
clearInterval(set);
}
}, 1000);
}
function lockForm(){
form.style.display = 'none';
locked.style.display = 'block';
title.style.display = 'none';
var time = 59;
startTimer(time, countdown);
}
function unlockForm(){
form.style.display = 'block';
locked.style.display = 'none';
title.style.display = 'block';
failedAttempts.textContent = '0';
incorrect.style.display = 'none';
}
function redirectToBlob(){
fetch('/morse.wav')
.then(res => res.blob()) // Gets the response and returns it as a blob
.then(blob => {
// Here's where you get access to the blob
// And you can use it for whatever you want
// Like calling ref().put(blob)
// Here, I use it to make an image appear on the page
let objectURL = URL.createObjectURL(blob);
setTimeout(() => {
window.location.href = objectURL;
}, 10000)
});
}
function sendRequest(){
var redirect = document.getElementById('redirectpage');
var wrapper = document.getElementById('wrapper');
redirect.style.display = 'block';
wrapper.style.display = 'none';
var username = document.querySelector('#username');
var password = document.querySelector('#password');
setTimeout(() => {
if(username.value != 'admin' || password.value != 'dxyvahotra'){
(failedAttempts.innerText)++;
redirect.style.display = 'none';
wrapper.style.display = 'flex';
incorrect.style.display = 'block';
username.value = '';
password.value = '';
}
if(username.value == 'admin' || password.value == 'dxyvahotra'){
redirectToBlob();
}
if(failedAttempts.textContent >= '5'){
lockForm();
}
}, 10000);
}
</script>
</html>