-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
175 lines (164 loc) · 3.8 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>WebSite Downloader | 5iD Project</title>
<style type="text/css">
body{
background-color: #292c2f;
}
form{
width: 100%;
align-content: center;
}
.link_input > input[type="text"]
{
border: 0px;
border-radius: 2px;
width: 80%;
max-width: 500px;
font-size: 1.5em;
padding: 5px 10px;
margin: 10px 5px;
color: #222;
}
.link_submit > input[type="submit"]
{
font-size: 1em;
background-color: #ABC;
color: #333;
padding: 5px 10px;
border:0px;
border-radius: 2px;
}
.download{
width: 50%;
max-width: 200px;
background-color: #FFF;
color: #222;
border: 0px;
border-radius: 2px;
margin: 10px 5px;
padding: 5px 10px;
font-size: 1.5em;
display: none;
}
.download_button{
padding: 20px;
text-decoration: none;
}
.download:hover{
background-color: #222;
color:#FFF;
}
h1{
color: #AAA;
margin-bottom: 40px;
width: 100%;
background-color: #212A2e;
padding: 25px 0px;
}
hr{
margin: 50px 0px;
width: 70%;
}
footer{
background-color: #CCC;
width: 100%;
position: fixed;
bottom: 0%;
margin: auto;
padding: 5px 5px;
left: 0%
}
.loader {
border: 16px solid #f3f3f3; /* Light grey*/
border-top: 16px solid #3498db; /* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
}
.loader_container{
width: 100%;
position: fixed;
top: 40%;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#loader{
display: none;
}
</style>
<script type="text/javascript">
function call()
{
document.getElementById("loader").style.display="block";
link = document.getElementById("link").value;
var xhttp = new XMLHttpRequest();
// return false;
xhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
document.getElementById("loader").style.display="";
ret = this.responseText;
console.log(ret);
switch(ret)
{
case "0":alert("empty input");break;
case "2":alert("Unable to create directory");break;
case "3":alert("error in creating zip");break;
default:
document.getElementById("download").style.display="block";
document.getElementById("download_button").setAttribute("href",window.location.href+ret);
}
}
};
xhttp.open("POST",window.location.href+"start.php?"+link, true);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhttp.send("url="+link);
xhttp.onerror = () => {
alert("Some error occured");
document.getElementById("loader").style.display="";
document.getElementById("download").style.display="";
}
document.getElementById("link").value = "";
return false;
}
</script>
</head>
<body>
<center>
<h1>Recursive Download Test | :-P</h1>
</center>
<div class="loader_container" id="loader">
<center><div class="loader"></div></center>
</div>
<form>
<center>
<div class="link_input">
<input type="text" id="link" placeholder="www.example.com">
</div>
<div class="link_submit">
<input type="submit" value="DOWN WEB" onClick="return call();">
</div>
<hr>
<div class="download" id="download">
<a id="download_button" class="download_button" href="" download="site.zip">Download</a>
</div>
</center>
</form>
<footer>
<center>
Sidhartha | No copyright issued | For experimental purpose only
</center>
</footer>
</body>
</html>