-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
executable file
·182 lines (165 loc) · 7.78 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Snake</title>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0"/>
<meta charset="utf-8"/>
<meta name="description" content="A pure HTML5 classic Snake game">
<meta name="keywords" content="snake, html5, game">
<meta name="author" content="Lorenzo Cioni">
<meta name="Robots" content="All" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="SHORTCUT ICON" href="favicon.ico" type="image/x-icon" />
<!-- OpenGraph meta properties -->
<meta property="og:type" content="website" />
<meta property="og:url" content="http://lorecioni.github.io/snake/" />
<meta property="og:title" content="Snake" />
<meta property="og:description" content="A pure HTML5 classic Snake game" />
<meta property="og:site_name" content="Snake" />
<meta property="og:image" content="http://lorecioni.github.io/snake/screenshot.jpg" />
<link rel="image_src" href="img/favicon.png" />
<!-- Load stylesheets -->
<link href="css/style.css" rel="stylesheet"/>
<link href="css/normalize.css" rel="stylesheet"/>
</head>
<body id="main">
<!-- Loading screen -->
<div id="loader">
<h1 id="loader-title">Snake</h1>
<p id="loading-text">Loading...</p>
<div id="bar-container">
<div id="bar"></div>
</div>
</div>
<!-- end loading screen -->
<!-- Main container -->
<div id="container">
<!-- Page header -->
<a href="http://lorecioni.github.io/snake/">
<h1>Snake</h1>
</a>
<h3>A pure HTML5 classic game</h3>
<!-- end header -->
<div id="game-container">
<div id="canvas-container">
<!-- Canvas -->
<canvas id="canvas">Your browser doesn't support HTML5! Please upgrade your browser.</canvas>
<!-- Canvas overlay box -->
<div id="canvas-overlay">
<div id="overlay-inner">
<span id="overlay-text" data-action="play">Play</span>
<!-- Saving scores -->
<div id="save">Save score</div>
<!-- Save score box inputs -->
<div id="save-score-box">
<div id="save-score-inner">
<input type="text" id="save-name" placeholder="Name">
<input type="button" id="save-button" value="Save">
<input type="button" id="cancel-button" value="Cancel">
</div>
</div>
<!-- !end box inputs -->
</div>
</div>
<!-- end overlay -->
</div>
<!-- end canvas container -->
<!-- Adding bonus score -->
<div class="bonus-text"></div>
<!-- Score display -->
<div id="score-container">
<div id="score-text">Score</div>
<div id="score-num">0</div>
</div>
<!-- Speed selection -->
<div id="speed-container">
<div id="speed-text">Speed</div>
<input type="range" min="5" max="20" value="12" id="speed-fader">
<div id="speed-labels">
<span id="speed-min">Min</span>
<span id="speed-max">Max</span>
</div>
</div>
<!-- Border selection -->
<div id="border-selection-container">
<div id="border-text">Borders</div>
<input type="checkbox" id="border-selector" name="border-selector" class="switch" />
<label for="border-selector">Active</label>
</div>
</div>
<a href="https://play.google.com/store/apps/details?id=com.lorenzocioni.snake">
<img src="https://4.bp.blogspot.com/-GKjg1s2iU_Q/Vv5Tp4XWwSI/AAAAAAAACSE/VNuyM7jjsokp69WGolS1jNN7-uNtbnyLg/s200/google-play-badge.png" alt="Google Play Badge" id="gplay"></a>
<!-- Ranking list -->
<section>
<h2>Ranking</h2>
<p id="standings-loader">
<img src="img/loader.gif" alt="Loading">
</p>
<div class="scrollable">
<ul id="standing-list"></ul>
</div>
</section>
<!-- Instructions -->
<section id="instructions">
<h2>Instructions</h2>
<p>Select speed and play! Use arrow keys to move, ESC or P to pause game. The lower the speed, the less are the points you can get. Don't miss the fruits!<br>
If you collide with borders you will lose the game, but you can choose to activate borders!</p>
</section>
<!-- Footer -->
<footer>
<p id="play-counter"></p>
<p>Made by <a href="http://github.com/lorecioni" target="_blank">Lorenzo Cioni</a></p>
<div id="social">
<!-- Facebook like button -->
<div class="fb-like" data-href="http://lorecioni.github.io/snake/" data-layout="box_count" data-action="like" data-show-faces="true" data-share="false"></div>
<!-- Twitter follow button -->
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://lorecioni.github.io/snake/" data-size="large">Tweet</a>
</div>
</footer>
<!-- end Footer -->
</div>
<!-- end container -->
<!-- Github ribbon -->
<a href="https://github.com/lorecioni/snake" target="_blank" class="github-ribbon">
<img src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png" alt="Fork me on GitHub">
</a>
<!-- Load scripts -->
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/modernizr-2.6.2.min.js"></script>
<script src="js/fastclick.js"></script>
<script src="js/jquery.touchSwipe.min.js"></script>
<script src="js/settings.js"></script>
<script src="js/script.js"></script>
<script src="js/engine.js"></script>
<script src="js/loader.js"></script>
<!-- Facebook connection -->
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '744974672275726',
xfbml : true,
version : 'v2.5'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<!-- Twitter connection -->
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<!-- Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-30452652-10', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>