-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (77 loc) · 3.72 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
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" >
<meta name=description content="Memes lol">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="styles/stylesheet.css">
<link rel="stylesheet" href="styles/tailwind.css">
<title>
Memes lol
</title>
<script>
$(()=>{
prev = sessionStorage.getItem("SomeNameThatIsSurelyNotUsedElsewhere");
if (prev !== null){
$.ajax({
url: prev,
success: (data)=>{
var content = $("#content").html(data.replace(/<head>[\s\S]*<\/head>/mg, '')).html(); // remove the head because we dont need it and it would be dangeroud to keep (redirect loop)
$.ajax({
url: "/"+prev.split("/")[3]+"/navbar.html",
success: (data)=>{
var nav = $("nav").html(data.replace(/<head>[\s\S]*<\/head>/mg, '')).html();
window.history.replaceState({"html":content, "nav":nav}, "", prev);
},
dataType: "html"
});
},
dataType: "html"
})
}
else {
$.ajax({
url: navigator.languages.includes("de") ? "/de" : "/en",
//url: "/de",
success: (data)=>{
var content = $("#content").html(data.replace(/<head>[\s\S]*<\/head>/mg, '')).html();
$.ajax({
url: navigator.languages.includes("de") ? "/de/navbar.html" : "/en/navbar.html",
//url: "/de",
success: (data)=>{
var nav = $("nav").html(data.replace(/<head>[\s\S]*<\/head>/mg, '')).html();
window.history.replaceState({"html":content, "nav":nav}, "", navigator.languages.includes("de") ? "/de" : "/en");
},
dataType: "html"
})
//window.history.replaceState({html:content}, "", "/de");
},
dataType: "html"
})
}
$(window).bind("popstate", (e)=>{
$("nav").html(e.originalEvent.state["nav"]);
$("#content").html(e.originalEvent.state["html"]);
});
})
</script>
<script src="js/memes.js"></script>
</head>
<body>
<div class="-z-10 fixed left-0 h-full w-full overflow-hidden" id="background">
<div class="h-full w-full absolute top-0 left-0">
<div class="bg right desktop"></div>
<div class="bg right desktop secondary"></div>
<div class="bg left desktop"></div>
<div class="bg left desktop secondary"></div>
<div class="bg center desktop"></div>
<div class="bg center desktop secondary"></div>
<div class="bg mobile"></div>
<div class="bg mobile secondary"></div>
</div>
</div>
<nav></nav>
<div id="content"></div>
</body>
</html>