-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (59 loc) · 3.02 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Star | Zyneon Studios</title>
<link rel="icon" type="image/x-icon" href="assets/images/favicon.ico" sizes="16x16">
<link rel="stylesheet" href="assets/css/shared.css">
<link rel="stylesheet" id="css-colors">
<script src="assets/js/shared.js"></script>
</head>
<body style="background-color: var(--background);">
<div id="cnttmp"></div>
<script>
function init() {
const urlParams = new URLSearchParams(window.location.search);
if(urlParams.has("app")) {
if(urlParams.get("app")==="true") {
if(urlParams.has("theme")) {
const theme = urlParams.get("theme")+"";
localStorage.setItem("options.theme",theme);
setTheme(theme,true);
}
localStorage.setItem("options.app","true");
console.log("[CONNECTOR] star.init");
return;
} else if(urlParams.get("app")==="continue") {
redirect();
}
}
if(urlParams.has("_ijt")&&urlParams.has("_ij_reload")) {
document.getElementById("cnttmp").innerHTML = "<a style='color: white; background: dodgerblue; padding: 1rem; cursor: pointer; margin: 1rem; position: absolute; top: 0.25rem; border-radius: 0.5rem; box-shadow: 0 0 0.8rem black;' onclick='redirect();'>Continue</a><br><a style='color: white; background: dodgerblue; padding: 1rem; cursor: pointer; margin: 1rem; position: absolute; top: 5rem; border-radius: 0.5rem; box-shadow: 0 0 0.8rem black;' onclick=\"redirect('de/');\">DE</a><br><a style='color: white; background: dodgerblue; padding: 1rem; cursor: pointer; margin: 1rem; position: absolute; left: 4.75rem; top: 5rem; border-radius: 0.5rem; box-shadow: 0 0 0.8rem black;' onclick=\"redirect('en/');\">EN</a>"
} else {
redirect();
}
}
init();
function redirect(goal) {
let urlParams = new URLSearchParams(window.location.search).toString();
if(urlParams) {
urlParams = "?"+urlParams;
}
if(goal) {
location.href = /*"/"+*/goal+urlParams;
return;
}
let lang = "en";
if(localStorage.getItem("settings.language")!=null) {
lang = localStorage.getItem("settings.language");
} else {
const browserLanguage = navigator.language || navigator.userLanguage;
if(browserLanguage.toLowerCase().startsWith("de")) {
lang = "de";
}
}
location.href = lang+"/"+urlParams;
}
</script>
</body>
</html>