-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.js
55 lines (48 loc) · 1.41 KB
/
index.js
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
const params = new URLSearchParams(window.location.search);
if (params.get("r") && params.get("r").toLowerCase().endsWith(" reveal")) {
const url = params.get("r").slice(0, -7);
document.head.innerHTML += '<link rel="stylesheet" href="./style.css">';
document.body.innerHTML = `
<div id="electric-surge"></div>
<div class="reveal center">
<div>
<div class="top">This URL redirects to:</div>
<div class="destination">${window.atob(url)}</div>
</div>
</div>
`;
document.body.appendChild(
Object.assign(document.createElement("script"), { src: "./script.js" }),
);
} else if (params.get("r")) {
window.location.replace(window.atob(params.get("r")));
} else if (params.get("t")) {
document.body.innerHTML = `
<p>${window.atob(params.get("t"))}</p>
`;
document.head.innerHTML += `
<style>
:root {
color-scheme: dark;
}
* {
margin: 0;
padding: 0;
color: #fff;
}
html {
background: linear-gradient(to top, #171515, #242323) no-repeat center center / cover;
height: 100dvh;
overflow-x: hidden;
}
p {
padding: 0.9rem 1.2rem;
font-size: 2rem;
font-family: Arial, Helvetica, sans-serif;
word-wrap: break-word;
}
</style>
`;
} else {
window.location.replace("https://axorax.github.io/urlmskr/create");
}