Initial commit

This commit is contained in:
foxster-mp4
2023-04-27 20:27:37 -07:00
commit d35389cc9a
18 changed files with 1468 additions and 0 deletions

16
js/index.js Normal file
View File

@@ -0,0 +1,16 @@
const textField = document.querySelector("input");
textField.addEventListener("keypress", function (event) {
// If the user presses the "Enter" key on the keyboard
if (event.key === "Enter") {
event.preventDefault();
const url = textField.value;
const urlRegex = /(https?:\/\/[^ ]*)/g;
if (!url.match(urlRegex))
alert("Invalid URL.");
else
window.location.replace(`home.html?source=${url}`);
}
});