-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (84 loc) · 16.5 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
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>URL Shortener</title>
</head>
<body>
Welcome to Sanjar's URL shortener. `key=value` should work.
<div id="ok" style="color: green; font-size: 24px"></div>
<div id="error" style="color: red; font-size: 24px"></div>
<!-- Optional: You can add a loading message or styling here -->
<script>
const URL_MAPPINGS = {
home: "https://github.com/sanjarcode",
"life-flow":
"https://viewer.diagrams.net/?tags=%7B%7D&target=blank&highlight=0000ff&edit=_blank&layers=1&nav=1&title=calibration_idea.drawio#R%3Cmxfile%20pages%3D%228%22%3E%3Cdiagram%20id%3D%22nVED_cFmHkKYGcl0D_A5%22%20name%3D%22High-level%20view%22%3E3VpZd9o6EP41nHvvAxzjheURCJC2SUiztElecoSt2ArCMrLM9usr2TJeIQRom5uHHNBIGknfzHyaEalovelySIHnXBIL4oqqWMuKdlZR1bqitfiHkKwiSUNpRgKbIksOSgS3aA3jmVIaIAv6mYGMEMyQlxWaxHWhyTIyQClZZIe9EJxd1QM2LAhuTYCL0p%2FIYk4kbRlKIj%2BHyHbileuK7JmCeLAU%2BA6wyCIl0voVrUcJYdG36bIHsQAvxiWaN9jSu9kYhS4rmXDvQzoavwpMVAWDMbdLOKiiNjAf330hrujx2UoetTELSNxR9UNDdPgAVfeWSSf%2FZovPO%2BBP%2FFgVXzPSFvVFG8PInUQrWoABritEWh3w%2Fas902W36tDQ52fz5cD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Xzv%2FhfIH6nUxFttQJfq363EqhTifOaalf3%2B%2FMv8SzC5f8Me%2Fw3%3C%2Fdiagram%3E%3C%2Fmxfile%3E",
// Add more mappings as needed
};
const errorDisplayNode = document.querySelector("#error");
const okDisplayNode = document.querySelector("#ok");
function readParams() {
const params = new URLSearchParams(window.location.search);
const key = params.get("key");
const isActualUrl = getProperUrl(key);
const finalUrl = isActualUrl ? key : URL_MAPPINGS[key];
return { key, finalUrl, isActualUrl };
}
function showOnPage() {
const { key, finalUrl } = readParams();
okDisplayNode.innerHTML = `${key} --> <a href="${finalUrl}">${finalUrl}</a>`;
if (!finalUrl) {
// Handle invalid or missing key
console.error("Invalid key or URL mapping not found.");
errorDisplayNode.innerHTML = `${key} is not a valid short id`;
}
}
function redirect() {
const { key, finalUrl } = readParams();
if (finalUrl) redirectToUrlFriendly(finalUrl);
}
// reusable function
/**
* Redirects to a specified URL, handling various formats.
*
* @param {string} inputUrl - The input URL to be redirected.
*
* ?key=google.com
* ?key=https://google.com
* ?key=www.google.com
* ?key=https://www.google.com
*/
function redirectToUrlFriendly(inputUrl) {
window.location.href = getProperUrl(inputUrl);
}
function getProperUrl(inputUrl = "") {
// Trim and lowercase the input for consistency
const trimmedUrl = inputUrl.trim();
let properUrl = "";
// Check if the URL starts with 'http', 'https', or 'www'
if (
trimmedUrl.startsWith("http://") ||
trimmedUrl.startsWith("https://")
) {
// If it starts with 'http://' or 'https://', use the provided URL as-is
properUrl = trimmedUrl;
} else if (trimmedUrl.startsWith("www.")) {
// If it starts with 'www.', prepend 'https://' and redirect
properUrl = "https://" + trimmedUrl;
} else if (trimmedUrl.includes(".")) {
// If it contains a dot but doesn't start with 'http', 'https', or 'www'
// Assume it's a domain without protocol, prepend 'https://' and redirect
properUrl = "http://" + trimmedUrl;
}
return properUrl;
}
window.onload = () => {
showOnPage();
redirect();
};
</script>
</body>
</html>