-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
493 lines (460 loc) · 13.6 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
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
<!DOCTYPE html>
<html>
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3798877607103818" crossorigin="anonymous"></script>
<!-- Google tag (gtag.js) -->
<script async src="ganalytics.js"></script>
<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">
<script src="stenunblockedmain.js"></script>
<link rel="icon" href="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;
}
html,body {
padding: 0;
margin: 0;
}
div.cookieAskCntr {
width: 100%;
height: 100%;
top: 0;
z-index: 100;
float: left;
}
div.cookieAskBg {
bottom: 0;
position: fixed;
z-index: 10;
background-color: white;
border: 2px solid gray;
height: 150px;
width: calc(100% - 4px);
}
div.cookieContainer {
transform: translateY(25%);
}
</style>
</head>
<body>
<div class="cookieAskBg" id="cookieContainer" style="display:none"><div class="cookieContainer">
<center><h1><a href="#" style="text-decoration:none;font-size: 50x;" onclick="acceptCookies()">
🍪✅
<span> <a href="#" style="text-decoration:none;font-size: 50x;" onclick="denyCookies()">🍪❌</a></span></a></h1>
<h3 style="font-family:Arial;"><a href="/privacy-policy/">Privacy Policy</a></h3></center>
</div></div>
<img src="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" 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 likes;
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);
}
if (getCookie("lastSorting")==="") {
setCookie("lastSorting", "alphabet", 365);
}
function getAllLikes(cb) {
let url = 'https://stenunblockedserver-c3acd8e9110f.herokuapp.com/like?game=all';
const xml = new XMLHttpRequest();
xml.open("GET", url, true);
xml.send(null);
xml.addEventListener("load", function() {
if (xml.status === 200) {
cb(JSON.parse(xml.responseText));
} else {
cb(null);
}});
}
function getLikes(game, cb) {
let url = 'https://stenunblockedserver-c3acd8e9110f.herokuapp.com/like?game=' + encodeURIComponent(game);
const xml = new XMLHttpRequest();
xml.open("GET", url, true);
xml.send(null);
xml.addEventListener("load", function() {
if (xml.status === 200) {
cb( JSON.parse(xml.responseText)['likes'] );
} else {
cb( "Error: " + xml.responseText );
}
});
}
function likez(game, cb) {
let js = JSON.parse(getCookie("likes"));
if (js.includes(game)) {
getLikes(game, function(lika) {
likes[game] = lika;
cb(likes[game] + '👍');
});
return;
}
let url = 'https://stenunblockedserver-c3acd8e9110f.herokuapp.com/like?game=' + encodeURIComponent(game);
const xml = new XMLHttpRequest();
xml.open("POST", url, true);
xml.send(null);
xml.addEventListener("load", function() {
if (xml.status === 200) {
js.push(game);
setCookie("likes", JSON.stringify(js));
getLikes(game, function(likess) {
likes[game] = likess;
cb( likes[game] + '👍' );
});
return;
}
cb( "Error: " + xml.responseText );
});
}
function likezElement(game, element) {
likez(game, function(lstr) {
element.innerText = lstr;
});
}
</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"],
["/drive-mad/", "Drive Mad"],
["/pixel-warfare/", "Pixel Warfare"],
["/hole-io/", "Hole.IO"],
["/moto-x3m-spookyland/", "Moto X3M Spooky Land Edition"],
["/tunnel-rush/", "Tunnel Rush"],
["/traffic-mania/", "Traffic Mania"],
["/happywheels/", "Happy Wheels"],
["/CaseClicker/", "Case Clicker - CSGO"],
["/helix-jump/", "Helix Jump"],
["/paper-io-2/", "Paper.IO 2"],
["/snowball-io/", "Snowball.IO"],
["/fireboy-and-watergirl/", "Fireboy & Watergirl"],
["/gun-spin/", "Gun Spin"],
["/overkill-apache/", "Overkill Apache"],
["/neon-pong/", "Neon Pong"],
["/drift-hunters/second_mirror.html", "Drift Hunters (2nd Link)"],
["/time-shooter-2/", "Time Shooter 2"],
["/jacksmith/", "Jacksmith"],
["/stunt-master/", "City Car Driving Simulator: Stunt Master"],
["/drift-hunters/third_miror.html", "Drift Hunters (3rd Link)"],
["/fruit-merge/", "Fruit Merge"],
["/gold-digger/", "Gold Digger FRVR"],
["/bitlife/", "BitLife Life Simulator"],
["/moto-run/frame.html", "Moto Traffic Run 3D [BETA]"]
];
var games_original = games.slice();
games_original.reverse();
function normalize_game_url(gm) {
if (gm.startsWith("/")) {
gm = "." + gm;
if (!gm.endsWith(".html")) {
if (!gm.endsWith("index.html")) {
if (!gm.endsWith("/"))
gm = gm + "/";
gm = gm + "index.html";
}
}
return gm;
}
return gm;
}
function sort_games_alphabet() {
var container = document.getElementById("container");
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;
} );
container.innerHTML = '';
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="likezElement(\'' + game[0] + '\', this)">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + normalize_game_url(game[0]) + '">' + game[1] + '</a>' + like + '</h1>';
}
setCookie("lastSorting", "alphabet");
}
function sort_games_time() {
var container = document.getElementById("container");
container.innerHTML = '';
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="likezElement(\'' + game[0] + '\', this)">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + normalize_game_url(game[0]) + '">' + game[1] + '</a>' + like + '</h1>';
}
setCookie("lastSorting", "time");
}
function sort_games_likes() {
var container = document.getElementById("container");
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;
gameA = a[1].toLowerCase();
gameB = b[1].toLowerCase()
if (gameA < gameB)
return -1;
if (gameA > gameB)
return 1;
return 0;
} );
container.innerHTML = '';
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="likezElement(\'' + game[0] + '\', this)">' + likes[game[0]] + '👍</a>'
}
container.innerHTML += '\n<h1><a href="' + normalize_game_url(game[0]) + '">' + game[1] + '</a>' + like + '</h1>';
}
setCookie("lastSorting", "likes");
}
function sort_def() {
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;
} );
for (let i = 0; i < games.length; i++) {
let game = games[i];
container.innerHTML += '\n<h1><a href="' + normalize_game_url(game[0]) + '">' + game[1] + '</a></h1>';
}
}
sort_def(); // när servern är avstängd
var likes = getAllLikes(function(_likes) {
let url = 'https://stenunblockedserver-c3acd8e9110f.herokuapp.com/like?game=all';
likes = _likes;
let ss = getCookie("lastSorting");
let sortcon = document.getElementById("sort-container");
if (ss === "alphabet") {
clicksort_alphabet(el_alpha);
} else if (ss === "time") {
clicksort_time(el_time);
} else {
clicksort_likes(el_likes);
}
clickDownArrow(document.getElementById("downarrow"));
});
var cookieElement = document.getElementById("cookieContainer");
function acceptCookies() {
cookieElement.outerHTML = "";
setCookie("enabledCookie", "1");
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MY0THGFRYS');
}
function denyCookies() {
cookieElement.outerHTML = "";
setCookie("enabledCookie", "0");
}
var enabled = getCookie("enabledCookie");
if (enabled == "1") {
cookieElement.outerHTML = "";
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-MY0THGFRYS');
}
else if (enabled == "0") {
cookieElement.outerHTML = "";
} else {
cookieElement.style.display = '';
}
</script>
<script>
(function(){
let xml = new XMLHttpRequest();
xml.open('POST', 'https://stenunblockedserver-c3acd8e9110f.herokuapp.com/views/view-game', true);
xml.send(null);
})();
</script>
<br><hr><br>
<center>
<a href="/privacy-policy/" style="font-family: Arial;">Privacy Policy</a>
<a href="/contact/" style="font-family: Arial;">Contact</a><br>
</center>
<!--
<center>
<br>
<a href="#" style="font-family: Arial;" id="hueModeTxt"><b>Hue Mode</b></a>
</center>
-->
<br>
<!--<script>
var chrismashat = document.getElementById("chrismanhat");
var allowed = ["stenblocked2", "stenblocked", "stenunblocked"];
if (allowed.includes(window.location.host.split(".")[0].toLowerCase()))
chrismashat.style.display = '';
</script>-->
</body>
</html>