-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
126 lines (96 loc) · 3.23 KB
/
index.html
File metadata and controls
126 lines (96 loc) · 3.23 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<title>usersniper's website</title>
<link rel="stylesheet" href="stylesheets/reset_margins.css">
<link rel="stylesheet" href="stylesheets/index.css">
<link rel="stylesheet" href="stylesheets/bars.css">
<script src="jquery.min.js"></script>
</head>
<body>
<!-- DA MAIN PAGE -->
<object id="page" type="text/html" data="pages/landing.html"></object>
<!-- SIDEBAR -->
<div id="sidebar">
<h1>Site Map</h1>
<p class="pagelink">go home lmao</p>
<br>
<p class="pagelink">cx16 emulator tests</p>
<br>
<p class="pagelink">stuff i made</p>
<p class="pagelink">about meeeee</p>
<br>
<p class="pagelink">the 404 page</p>
</div>
<!-- THE HEADER -->
<div id="topbar">
<img
src="assets/sniper.png"
height="64px"
>
<h1 id="gohome" style="display:inline-block;">usersniper</h1>
<img
src="assets/sniper.png"
height="64px"
style="display:inline-block;"
>
</div>
<!-- DA LINKS -->
<div id="links">
<img class="linkslink" src="assets/youtube.png" width="64" height="64">
<img class="linkslink" src="assets/discord.png" width="64" height="64">
<img class="linkslink" src="assets/github.png" width="64" height="64">
</div>
</body>
<script>
/*
* add pages here!!!!
*/
const pagelist = [
"landing.html",
"cx16_emu_tests.html",
"stuff_i_made.html",
"about.html",
"fek"
];
const linkslist = [
"https://www.youtube.com/@UserSniper",
"https://www.discord.gg/Wt3kJ949X5",
"https://www.github.com/UserSniper"
];
/*
const fileExists = file =>
fetch(file, {method: 'HEAD', cache: 'no-store'})
.then(response => ({200: true, 404: false})[response.status])
.catch(exception => undefined);
*/
function fileExists(url) {
if(url){
var req = new XMLHttpRequest();
req.open('HEAD', url, false);
req.send();
return req.status==200;
} else {
return false;
}
}
var $gohome = $("a#gohome");
$gohome.on("click",function(){
$("#page").prop("data","pages/landing.html");
});
var $pagelink = $(".pagelink");
$pagelink.on("click",function(){
var i = $pagelink.index(this);
var tmp = "pages/" + pagelist[i];
if(!fileExists(tmp)){
tmp = "pages/404.html"
}
$("#page").prop("data",tmp);
});
var $linkslink = $(".linkslink");
$linkslink.on("click", function(){
var i = $linkslink.index(this);
window.open(linkslist[i], '_blank').focus();
});
</script>
</html>