-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
113 lines (109 loc) · 4.07 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
<!DOCTYPE html>
<html>
<head>
<title>NS-SHAFT</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="white">
<meta name="apple-mobile-web-app-title" content="NS-SHAFT">
<link rel="apple-touch-icon" href="icon.png">
<style>
body{margin: 0; -webkit-user-select: none; user-select: none;}
#content{text-align: center;}
kbd{display: inline-block; padding: 3px 5px; color: #444d56; background-color: #fafbfc; border: solid 1px #c6cbd1; border-bottom-color: #959da5; border-radius: 3px; box-shadow: inset 0 -1px 0 #959da5;}
dl{margin:0 auto; width:95%;}
dt{font-weight:bold; font-size: 18pt;}
dd{display: list-item; font-size: 12pt; margin-left: 1.5em;}
</style>
</head>
<body>
<div id="content">Loading...</div>
<dl>
<dt>How to play</dt>
<dd><strong>go left</strong>: press the left half of the screen (for touch screen device), or press the <kbd>←</kbd> key (for keyboard or joystick)</dd>
<dd><strong>go right</strong>: press the right half of the screen, or press the <kbd>→</kbd> key</dd>
<dd><strong>start/resume game</strong>: press the <kbd>play again</kbd> / <kbd>continue</kbd> button on screen, or press the <kbd>Space</kbd> / <kbd>Ok</kbd> key</dd>
<dd><strong>life</strong>: hitting spikes on the top or on a floor reduces the player's life, landing on a floor (without spikes) increases the player's life</dd>
<dd><strong>game over</strong>: falling off the bottom or running out of life <img src="https://static.fouryes.com/smile.gif" /></dd>
</dl>
<script>
window.onerror = function (msg, url, lineNo, columnNo, error) {
var node = document.body;
var string = msg.toLowerCase();
var substring = "script error";
if (string.indexOf(substring) > -1){
node.appendChild(document.createTextNode('Script Error: See Console for Detail'));
} else {
var message = [
'Message: ' + msg,
'URL: ' + url,
'Line: ' + lineNo,
'Column: ' + columnNo,
'Error object: ' + JSON.stringify(error)
].join(' - ');
node.appendChild(document.createTextNode(message));
}
return false;
};
</script>
<script src="main.js"></script>
<script>
~function(){
var Game = window.Game;
Game && Game.launch(document.getElementById('content'));
if (/zh\-cn/i.test(navigator.language)) {
document.title = '是男人就下100层';
} else if (/zh\-/i.test(navigator.language)) {
document.title = '小朋友下樓梯';
}
if (true || /MicroMessenger/i.test(navigator.userAgent)) {
var script = document.createElement('script');
script.src = 'sns.js';
document.body.appendChild(script);
}
}();
</script>
<script>
~function(){
var trackEvent;
if (new Date().getTimezoneOffset() == -480) {
window._hmt = window._hmt || [];
var script = document.createElement('script');
script.async = 'async';
script.src = 'https://hm.baidu.com/hm.js?6998d97ddc26a42b1795408af4d9d9cc';
document.head.appendChild(script);
trackEvent = function(event, value) {
_hmt.push(['_trackEvent', 'main', event, 'all', value]);
};
} else {
var script = document.createElement('script');
script.async = 'async';
script.src = 'https://www.googletagmanager.com/gtag/js?id=UA-173616513-1';
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-173616513-1');
trackEvent = function(event, value) {
gtag('event', event, {'value': value});
}
}
var Game = window.Game;
Date.now || (Date.now = function() {return new Date().getTime()});
var startCount = 0;
var startTime;
Game && Game.on('gameStart', function() {
startTime = Date.now();
trackEvent('start', ++startCount);
});
Game && Game.on('gameOver', function(score, best) {
var duration = startTime && Date.now() - startTime || 0;
startTime = 0;
trackEvent('duration', duration);
trackEvent('score', score);
});
}();
</script>
</body>
</html>