-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice1.html
More file actions
156 lines (131 loc) · 4.24 KB
/
service1.html
File metadata and controls
156 lines (131 loc) · 4.24 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<title>File Downloader</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #e6f7ff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
background: linear-gradient(to right bottom, skyblue, #E7F2F7);
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1),
0 -4px 10px rgba(0, 0, 0, 0.1),
4px 0 10px rgba(0, 0, 0, 0.1),
-4px 0 10px rgba(0, 0, 0, 0.1);
width: 80%;
max-width: 500px;
}
h2 {
color: #333333;
margin-top: -10px;
}
p {
font-size: 11px;
margin-top: -12px;
text-align: center;
}
input[type="text"] {
width: 100%;
padding: 10px;
margin-top: 10px;
border-radius: 5px;
border: 1px solid #cccccc;
}
.button {
padding: 10px 20px;
margin-top: 20px;
background-color: white;
color: #333333;
border: 2px solid white;
border-radius: 5px;
cursor: pointer;
transition: background 0.3s;
}
.contact {
margin-top: -35px;
margin-left: 140px;
}
h1 {
font-size: 10px;
margin-left: 130px;
margin-top: -45px;
}
i {
margin-left: 10px;
margin-top: 30px;
font-size: 15px;
color: black;
}
.button:hover {
background: linear-gradient(to right, #88b5d3, #f2f2f2);
}
#safetyMessage {
display: none;
color: red;
margin-top: 10px;
font-size: 14px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h2>File Downloader</h2>
<p>You can download files from here by simply pasting the URL!</p>
<div>
<input type="text" id="fileUrl" placeholder="Paste the URL">
</div>
<button class="button" onclick="downloadFile()">Download</button>
<h1>Follow us</h1>
<div class="contact">
<a href="https://github.com/Niyaz5"><i class="fa-brands fa-github"></i></a>
<a href="https://instagram.com/ni.yyaz"><i class="fa-brands fa-instagram"></i></a>
<a href="#"><i class="fa-brands fa-discord"></i></a>
<a href="mailto:sulustore54@gmail.com"><i class="fa-brands fa-google"></i></a>
</div>
<div id="safetyMessage"></div>
</div>
<script>
const fileUrlInput = document.getElementById('fileUrl');
fileUrlInput.addEventListener('input', function() {
const url = this.value;
const isSafe = isUrlSafe(url);
if (isSafe) {
document.getElementById('safetyMessage').style.display = 'none';
} else {
document.getElementById('safetyMessage').textContent = 'This file source is not safe to download!';
document.getElementById('safetyMessage').style.display = 'block';
}
});
function isUrlSafe(url) {
return url.startsWith('https://');
}
function downloadFile() {
const url = document.getElementById('fileUrl').value;
const isSafe = isUrlSafe(url);
if (isSafe) {
const link = document.createElement('a');
link.href = url;
link.download = 'downloaded_file_name';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
} else {
document.getElementById('safetyMessage').textContent = 'This file source is not safe to download!';
document.getElementById('safetyMessage').style.display = 'block';
}
}
</script>
</body>
</html>