-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
192 lines (181 loc) · 7.71 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
<!DOCTYPE html>
<!--
~ Copyright (c) 2018. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
~ Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
~ Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
~ Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
~ Vestibulum commodo. Ut rhoncus gravida arcu.
-->
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" href="css/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
</head>
<body>
<div id="msg"></div>
<div class="mask">
</div>
<div class="form">
<h2>您本次最高分为<span id="max-score" style="color: red;">0</span>!</h2>
<p><label for="nickname">留下您的大名,让江湖人尽皆知吧!</label><input type="text" id="nickname"></p>
<p>
<a class="btn-submit" href="javascript:void(0)" onclick="no_cookies_name_submit()">昭告天下</a>
</p>
</div>
<div class="header">
<h3 id="message_label">Link Start</h3>
</div>
<div class="game-description"><p>2048-相邻且相同的数字可以合成两个数的和,相同但是中间隔着一个空的格子也可以</p></div>
<div class="body">
<div class="left">
<div class="tab_additional">
<a href="javascript:gamestart()" class="start">开始</a>
<div class="sn">
<label>SN:</label>
<span id="step_round" title="当前步数">0</span>
</div>
<div class="asn">
<label>ASN:</label>
<span id="step_all" title="总步数">0</span>
</div>
<div class="score">
<label for="score">score</label>
<span id="score" title="分数">0</span>
</div>
</div>
<div id="container" class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</div>
<div class="right">
<h5>排行榜</h5>
<ul>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><label for=""><img src="http://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKdDbru8q7iaic5VHcQqSnYicZkHPNiad5UXWl23wZibdSicrL9abOofuqdux4YxZGl5BUEyB5zRQm9DuzQ/132"/></label>
<span class="username">可可</span>
<span class="max-score">2048</span>
<span class="date">2018-3-13 11:04</span>
</li>
<li><a href="/rank.php">查看排行榜</a></li>
</ul>
</div>
</div>
</body>
<script src="js/2048.src.js" type="text/javascript"></script>
<script src="js/tool.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
function gamestart() {
var game_box = document.getElementById('container');
gamer_factory.init(game_box,
"{'count_round':'step_round','count_all':'step_all','error_label':'message_label','level':1,'score':'score'}");
}
gamer_factory.end = function() {
return false;
if(getCookie('cc_2048_username')) {
//本次存储有用户名
var data = '';
data += 'username=' + getCookie('cc_2048_username') + '&score=' + gamer_factory.max() +
'&step=' + gamer_factory.step_round;
var ajax_obj = getAjaxObject();
ajax_obj.onstatechange = function(ev) {
};
post(ajax_obj, '/2048/info_cal_in.php', data);
} else {
document.getElementsByClassName('mask')[0].style.display = 'block';
document.getElementsByClassName('form')[0].style.display = 'block';
}
};
function showError(str) {
var msgobj = document.getElementById('msg');
msgobj.innerHTML = str;
msgobj.style.display = 'block';
setTimeout(function() {
msgobj.style.display = 'none';
}, 3000)
}
function no_cookies_name_submit() {
var username = document.getElementById('nickname').value.replace(/(^\s*)|(\s*$)/g, '');
if(typeof username !== 'string' || username === '') {
showError('请阁下告知您的大名,好让我们铭记于心。')
}
setCookie('cc_2048_username', username, 360);
var data = '';
data += 'username=' + getCookie('cc_2048_username') + '&score=' + gamer_factory.max() +
'&step=' + gamer_factory.step_round;
var ajax_obj = getAjaxObject();
ajax_obj.onstatechange = function() {
if(ajax_obj.readyState === 4 && ajax_obj.status === 200) {
var res = xmlhttp.responseText;
if(res !== '') {
}
try {
setCookie('uuid', res)
} catch(e) {
}
}
};
post(ajax_obj, '/2048/info_cal_in.php', data);
}
</script>
</html>