-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
74 lines (74 loc) · 2.18 KB
/
Copy pathindex.html
File metadata and controls
74 lines (74 loc) · 2.18 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Website Redirect</title>
<style>
body {
background-color: #121212;
color: #ffffff;
font-family: Arial, sans-serif;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
margin: 0;
}
#container {
text-align: center;
border: 1px solid #333;
padding: 20px;
border-radius: 10px;
background-color: #1e1e1e;
}
input[type="text"] {
padding: 10px;
width: 300px;
margin-bottom: 15px;
border-radius: 5px;
border: 1px solid #333;
background-color: #333;
color: #fff;
}
button {
padding: 10px 20px;
margin: 5px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: white;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
<script>
function redirectToWebsite(newTab) {
var website = document.getElementById("website").value.trim();
if (website !== "") {
if (!website.startsWith("http://") && !website.startsWith("https://")) {
website = "http://" + website;
}
if (newTab) {
window.open(website, "_blank");
} else {
window.location.href = website;
}
} else {
alert("Please enter a valid URL.");
}
}
</script>
</head>
<body>
<div id="container">
<h1>Redirect to a Website</h1>
<input type="text" id="website" placeholder="Enter website URL"><br>
<button onclick="redirectToWebsite(false)">Go</button>
<button onclick="redirectToWebsite(true)">Open in New Tab</button>
</div>
</body>
</html>
<!-- website is ai generated so i dont own it lol -->