-
Notifications
You must be signed in to change notification settings - Fork 71
/
tmp.html
298 lines (284 loc) · 8.15 KB
/
tmp.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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
<!DOCTYPE html>
<html>
<head>
<title>Sten Unblocked</title>
<meta charset="UTF-8">
<meta name="description" content="Play free Unblocked games at school that loads in just a few seconds!">
<meta name="keywords" content="unblocked games, unblocked games 66, unblocked games school, unblocked games wtf, unblocked games premium, unblocked games sten">
<meta name="author" content="Sten">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="https://stenunblocked.github.io/stennerela.jpg">
<style>
h1 {
font-family: Arial;
text-align: center;
}
a {
filter: drop-shadow(0 0 1rem MediumPurple);
transition: 0.3s;
opacity: 1;
color: Blue;
}
a:hover {
filter: drop-shadow(0 0 1rem Blue);
color: Violet;
}
img {
width: 500px;
position: absolute;
top: -12.5%;
left: 50%;
transform: translateX(-50%);
}
iframe {
border: none;
width: 70%;
height: 300px;
}
a.like {
font-size: 15px;
position: absolute;
}
.down-arrow {
width: 0;
height: 0;
border: solid 5px transparent;
background: transparent;
border-top: solid 7px black;
border-bottom-width: 0;
margin-top:1px;
cursor: pointer;
position: absolute;
right: 30%;
transform: translate(1050%) rotate(180deg);
}
.sort-container {
position: absolute;
left: 70%;
transform: translate(120%, 10px);
display: none;
}
table {
border-collapse: collapse;
}
td, th {
border: 3px solid MediumPurple;
padding: 8px;
user-select: none;
transition: 0.3s;
}
td:hover {
border: 3px solid MediumSeaGreen;
cursor: pointer;
}
</style>
</head>
<body>
<img src="https://stenunblocked.github.io/stennerela.jpg"></img>
<br><br><br><br><br><br>
<hr>
<div class="down-arrow" id="downarrow" onclick="clickDownArrow(this)"></div>
<div class="sort-container" id="sort-container">
<table>
<tr>
<td id="sort_alphabet" style="border: 3px solid green;" onclick="clicksort_alphabet(this)">🔤</td>
<td id="sort_time" onclick="clicksort_time(this)">🕒</td>
</tr>
<tr>
<td id="sort_likes" onclick="clicksort_likes(this)">👍</td>
</tr>
</table>
</div>
<div id="container"></div>
<script>
var is_clicked = false;
var el_alpha = document.getElementById("sort_alphabet");
var el_time = document.getElementById("sort_time");
var el_likes = document.getElementById("sort_likes");
var downarrow= document.getElementById("downarrow");
function clicksort_any(el) {
el_alpha.setAttribute('style', '');
el_time.setAttribute('style', '');
el_likes.setAttribute('style', '');
el.setAttribute('style', "border: 3px solid green;");
}
function clicksort_time(el) {
clicksort_any(el);
sort_games_time();
clickDownArrow(downarrow);
}
function clicksort_alphabet(el) {
clicksort_any(el);
sort_games_alphabet();
clickDownArrow(downarrow);
}
function clicksort_likes(el) {
clicksort_any(el);
sort_games_likes();
clickDownArrow(downarrow);
}
function clickDownArrow(el) {
let sort = document.getElementById("sort-container");
is_clicked = !is_clicked;
if (!is_clicked) {
el.style.transform = 'translate(1050%) rotate(180deg)';
sort.style.display = 'none';
} else {
el.style.transform = 'translate(1050%)';
sort.style.display = 'block';
}
}
</script>
<script>
function setCookie(cname, cvalue, exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
let expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
let name = cname + "=";
let ca = document.cookie.split(';');
for(let i = 0; i < ca.length; i++) {
let c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
if (getCookie("likes")==="") {
setCookie("likes", '[]', 365);
}
function getAllLikes() {
let url = 'https://stenunblockedserver.stensjogren.repl.co/like?game=all';
const xml = new XMLHttpRequest();
xml.open("GET", url, false);
xml.send(null);
if (xml.status === 200) {
return JSON.parse(xml.responseText);
} else {
return null;
}
}
function getLikes(game) {
let url = 'https://stenunblockedserver.stensjogren.repl.co/like?game=' + encodeURIComponent(game);
const xml = new XMLHttpRequest();
xml.open("GET", url, false);
xml.send(null);
if (xml.status === 200) {
return JSON.parse(xml.responseText)['likes'];
} else {
return "Error: " + xml.responseText;
}
}
function likez(game) {
let js = JSON.parse(getCookie("likes"));
if (js.includes(game)) {
likes[game] = getLikes(game);
return likes[game] + '👍';
}
let url = 'https://stenunblockedserver.stensjogren.repl.co/like?game=' + encodeURIComponent(game);
const xml = new XMLHttpRequest();
xml.open("POST", url, false);
xml.send(null);
if (xml.status === 200) {
js.push(game);
setCookie("likes", JSON.stringify(js));
likes[game] = getLikes(game);
return likes[game] + '👍';
}
return "Error: " + xml.responseText;
}
</script>
<script>
var games = [
["/paper-io-3d/", "Paper.io 3D"],
["/geometrydash/", "Geometry Dash"],
["/moto-x3m/", "Moto X3M"],
["/moto-x3m-winter/", "Moto X3M Winter Edition"],
["/moto-x3m-pool-party/", "Moto X3M Pool Party Edition"],
["/drift-hunters/", "Drift Hunters"],
["https://stennen.github.io/games/cookies/", "Cookie Clicker"],
["https://stennen.github.io/games/2048/", "2048"],
["/wheelie-bike/", "Wheelie Bike 2"],
["/bottle-flip-3d/", "Bottle Flip 3D"],
["/short-ride/", "Short Ride"],
["/moto-x3m-3/", "Moto X3M 3"],
["/moto-x3m-2/", "Moto X3M 2"],
["/slope/", "Slope"],
["/wheeliebike/", "Wheelie Bike"],
["/site-unblocker/", "Website Unblocker"],
["/traffic-run/", "Traffic Run"],
["/1v1-lol/", "1v1.LOL"]
];
var games_original = games.slice();
games_original.reverse();
function sort_games_alphabet() {
var container = document.getElementById("container");
container.innerHTML = '';
games.sort(function(a,b) {
var gameA = a[1].toLowerCase();
var gameB = b[1].toLowerCase();
if (gameA < gameB)
return -1;
if (gameA > gameB)
return 1;
return 0;
} );
var likes = getAllLikes();
for (let i = 0; i < games.length; i++) {
let game = games[i];
let like = '';
if (game[0] in likes) {
like = '<a class="like" href="#" onclick="this.innerHTML = likez(\'' + game[0] + '\')">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + game[0] + '">' + game[1] + '</a>' + like + '</h1>';
}
}
function sort_games_time() {
var container = document.getElementById("container");
container.innerHTML = '';
var likes = getAllLikes();
for (let i = 0; i < games_original.length; i++) {
let game = games_original[i];
let like = '';
if (game[0] in likes) {
like = '<a class="like" href="#" onclick="this.innerHTML = likez(\'' + game[0] + '\')">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + game[0] + '">' + game[1] + '</a>' + like + '</h1>';
}
}
function sort_games_likes() {
var container = document.getElementById("container");
var likes = getAllLikes();
container.innerHTML = '';
games.sort(function(a,b) {
var gameA = likes[a[0]];
var gameB = likes[b[0]];
if (gameA > gameB)
return -1;
if (gameA < gameB)
return 1;
return 0;
} );
for (let i = 0; i < games.length; i++) {
let game = games[i];
let like = '';
if (game[0] in likes) {
like = '<a class="like" href="#" onclick="this.innerHTML = likez(\'' + game[0] + '\')">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + game[0] + '">' + game[1] + '</a>' + like + '</h1>';
}
}
sort_games_alphabet();
</script>
<script>
function f(){let xhr = new XMLHttpRequest();xhr.open("POST", 'https://stenunblockedserver.stensjogren.repl.co/view', true);xhr.send('world cup');}
f();
</script>
</body>
</html>