Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
151 lines (141 loc) · 4.7 KB

File metadata and controls

executable file
·
151 lines (141 loc) · 4.7 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<!doctype html>
<html lang="en">
<head>
<!--
JavaScript Snake
https://patorjk.com/games/snake
Source code is available here: https://github.com/patorjk/JavaScript-Snake
-->
<meta charset="utf-8" />
<title>JavaScript Snake</title>
<link
rel="stylesheet"
id="style"
type="text/css"
href="css/main-snake.css"
/>
<link rel="shortcut icon" href="css/images/favicon.png" />
<style>
.snake-toolbar {
position: absolute;
top: 0;
left: 0;
z-index: 10000;
padding: 5px;
}
</style>
<script>
function getTheme() {
function changeTheme(themeUrl) {
const elm = document.getElementById("style");
elm && elm.remove();
const newCss = document.createElement("link");
newCss.id = "style";
newCss.rel = "stylesheet";
newCss.type = "text/css";
newCss.href = themeUrl;
document.head.appendChild(newCss);
}
const index = document.getElementById("select").selectedIndex;
switch (index) {
case 0:
changeTheme("./css/light-snake.css?" + Math.random());
break;
case 1:
changeTheme("./css/main-snake.css?" + Math.random());
break;
case 2:
changeTheme("css/dark-snake.css?" + Math.random());
break;
case 3:
changeTheme("css/green-snake.css?" + Math.random());
break;
case 4:
changeTheme("css/matrix-snake.css?" + Math.random());
break;
case 5:
changeTheme("css/Senura-snake.css?" + Math.random());
break;
case 6:
changeTheme("css/head-snake.css?" + Math.random());
break;
case 7:
changeTheme("css/black-snake.css?" + Math.random());
break;
case 8:
changeTheme("css/neon-snake.css?" + Math.random());
break;
default:
changeTheme("css/main-snake.css?" + Math.random());
break;
}
setTimeout(function () {
document.getElementById("game-area").focus();
}, 10);
}
</script>
<!--
<script async src="https://www.googletagmanager.com/gtag/js?id=G-352HTB3H82"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-352HTB3H82');
</script>
--></head>
<body>
<div class="snake-toolbar">
<div style="display: inline-block; margin-right: 10px">
<span>Theme:</span>
<select autocomplete="off" id="select">
<option>Light Theme by yokesharun</option>
<option selected>Main Theme by patorjk</option>
<option>Dark Theme by KenyStev</option>
<option>Green Theme by CoffeeCatDE</option>
<option>Matrix Theme by Geahad Haymor</option>
<option>Theme by Senura Ratnayake</option>
<option>Snake Head Theme by Rb64</option>
<option>Black and purple Theme by LucassSantoss</option>
<option>Neon Theme by Daisy21000</option>
</select>
</div>
<div style="display: inline-block; margin-right: 10px">
<span>Mode:</span>
<select id="selectMode">
<option value="100">Easy</option>
<option value="75" selected>Medium</option>
<option value="50">Hard</option>
<option value="25">Impossible</option>
<option value="110">Rush</option>
</select>
</div>
<button id="go_full_screen">Full Screen</button>
<br />
</div>
<div id="mode-wrapper" style="display: inline; width: auto"></div>
<div id="game-area" tabindex="0"></div>
<script type="text/javascript" src="js/snake.js"></script>
<script type="text/javascript" src="js/init.js"></script>
<script type="text/javascript">
document.getElementById('select').addEventListener('change', getTheme);
function go_full_screen() {
const elem = document.documentElement;
try {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
} catch (err) {
console.error(err);
alert("Sorry, fullscreen won't work in this setup.");
}
}
document.getElementById('go_full_screen').addEventListener('click', go_full_screen);
</script>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.