-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
39 lines (34 loc) · 1011 Bytes
/
index.html
File metadata and controls
39 lines (34 loc) · 1011 Bytes
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
<!DOCTYPE html>
<html>
<head>
<title>URL Redirect</title>
</head>
<body>
<h2>The shrimplest redirect ever</h2>
<form id="redirectForm">
<input type="url" id="urlInput" placeholder="https://example.com">
<button type="submit">:)</button>
</form>
<script>
document.getElementById('urlInput').addEventListener('input', function() {
const url = this.value.trim();
if (url) {
document.querySelector('form').action = url;
}
});
document.getElementById('urlInput').addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
document.querySelector('form').submit();
}
});
document.querySelector('form').addEventListener('submit', function(e) {
e.preventDefault();
const url = document.getElementById('urlInput').value.trim();
if (url) {
window.location.href = url;
}
});
</script>
<a href="https://vipermikey.github.io/EaglyMC-links/">EaglyMC</a>
</body>
</html>