This repository was archived by the owner on Jul 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathindex.html
58 lines (50 loc) · 2.47 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
<!DOCTYPE html>
<html>
<body id="text" onload="check_localhost()">
redirecting...
<script>
function check_localhost(){
var urlParams = new URLSearchParams(window.location.search);
var target = urlParams.get('redir')
var region = urlParams.get('region')
var playername = urlParams.get('playername')
var playertag = urlParams.get('playertag')
var type = urlParams.get('type')
var params_joined = "?redir=" + target + "®ion=" + region + "&playername=" + playername + "&playertag=" + playertag + "&type=" + type
console.log(params_joined)
var local_url = 'http://127.0.0.1:4100';
var http = new XMLHttpRequest();
http.open('GET', local_url, true);
http.send();
http.onreadystatechange = function () {
if (http.readyState == 4 && http.status == 200) {
var local_location = local_url + params_joined
document.getElementById("text").innerHTML = "redirecting to <a href="+local_location+">"+local_location+"</>";
window.location.replace(local_location);
}else if (http.readyState == 4){
check_valorweb(params_joined);
}
};
}
function check_valorweb(params_joined){
console.log(params_joined)
var valorweb_url = 'https://colinhartigan.github.io/valorweb';
var http = new XMLHttpRequest();
http.open('GET', valorweb_url, true);
http.send();
http.onreadystatechange = function () {
if (http.readyState == 4 && http.status == 200) {
var valorweb_location = valorweb_url + params_joined
console.log(valorweb_location)
document.getElementById("text").innerHTML = "redirecting to <a href="+valorweb_location+">"+valorweb_location+"</>";
window.location.replace(valorweb_location);
}else if (http.readyState == 4){
var github_location = "https://github.com/colinhartigan/valorant-rpc/tree/v3"
document.getElementById("text").innerHTML = "redirecting to <a href="+github_location+">"+github_location+"</>";
window.location.replace(github_location);
}
};
}
</script>
</body>
</html>