-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
88 lines (78 loc) · 2.06 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
<!DOCTYPE html>
<html>
<head>
<title>URLRedirector</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<style>
@import url('https://fonts.googleapis.com/css2?family=Varela+Round:wght@400&display=swap');
input#url, button.redirect-button {
margin: 0 auto;
display: block;
position: absolute;
top: 60%;
left: 50%;
transform: translate(-50%, -50%);
font-family: 'Varela Round', sans-serif;
font-size: 50px;
border-radius: 20px;
}
input#url {
width: 500px;
height: 150px;
margin-left: -170px;
background-color: black;
color: #ADD8E6;
outline: 10px solid #ADD8E6;
}
body {
background-color: black;
}
button.redirect-button {
background-color: green;
border: none;
color: white;
padding: 10px;
width: 300px;
height: 150px;
margin-left: 270px;
outline: 10px solid darkgreen;
}
button.redirect-button:hover {
filter: saturate(4);
}
.text {
position: absolute;
top: 150px;
right: 25%;
font-family: 'Varela Round', sans-serif;
font-size: 100px;
font-weight: bold;
color: #ADD8E6;
}
.new-image {
position: absolute;
bottom: 70px;
left: 50%;
transform: translateX(-50%);
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<div class="text">URLRedirector</div>
<input type="text" id="url" placeholder="Enter URL here">
<button class="redirect-button" onclick="redirect()">Redirect</button>
<img src="https://lh3.googleusercontent.com/a/ACg8ocKlmLbwR14KND2gVGIzp_yF-REPA8xNxpimGRjH4ererw=s288-c-no" class="new-image">
<script>
function redirect() {
var url = document.getElementById('url').value;
// If the URL does not start with "https://" or "http://", prepend "https://" to it.
if (url.indexOf('https://') !== 0 && url.indexOf('http://') !== 0) {
url = 'https://' + url;
}
window.location.href = url;
}
</script>
</body>
</html>