-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·67 lines (60 loc) · 2.15 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
<!DOCTYPE html>
<html>
<head>
<title>Casino Blocker</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
}
form {
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 5px;
}
#search-field {
width: 300px;
border-radius: 15px;
border: 2px solid #920000;
color: #920000;
font-weight: 500;
padding: 5px 10px 5px 10px;
}
#search-btn {
background-color: #920000;
color: white;
padding: 7px 10px;
border: none;
border-radius: 5px;
cursor: pointer;
font-weight: 900;
}
</style>
</head>
<body>
<img src="img/logo.png" alt="logo" style="width: 300px; margin: 0 auto; display: block; margin-bottom: 20px;">
<form id="urlForm" style="margin: 0 auto; width: fit-content">
<input id="search-field" type="text" name="url" placeholder="https://en.wikipedia.org/wiki/Elon_Musk">
<input id="search-btn" type="submit" value="Search">
</form>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script>
document.getElementById('urlForm').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent the form from submitting via the browser
const urlInput = document.getElementById('search-field').value;
const endpoint = 'https://casino.regevson.com/api?url=' + encodeURIComponent(urlInput);
// Make a GET request using Axios
axios.get(endpoint)
.then(response => {
// Assuming the response contains a URL in 'data.newUrl' property
console.log(response.data);
window.location.href = response.data; // Redirect to the new URL
})
.catch(error => {
console.error('There has been a problem with your Axios request:', error);
});
});
</script>
</body>
</html>