-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2048.html
executable file
·448 lines (329 loc) · 15.4 KB
/
2048.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
<!--
We ripped this code off from Gabriele Cirulli, who was nice enough
to MIT-license it. Thank you!
Therefore, these resulting games are also MIT-licensed, APART FROM:
THE UVT SHARING CODE, which is pulled in from elsewhere
and which we can't MIT license.
ANY IMAGES SUPPLIED BY OUR USERS, which should be hosted on
imgur or similar and appropriately licensed.
Love, UsVsTh3m
And now, here is 2048 as the Fonz jumping the shark:
2048 --
/|\ --
__/_\__ --
____
| --__
/| | --__
~~~~~~~~~~/ |~~~~~~~~~~| --~~~~~~~~~~~
The MIT License (MIT)
Copyright (c) 2014 Gabriele Cirulli
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script type='text/javascript'>var _sf_startpt=(new Date()).getTime()</script>
<title>2048: FTC Edition</title>
<base href="http://usvsth3m.co.uk/2048/">
<meta name="description" content="A custom version of 2048, the addictive tile-matching game.">
<link href="/2048/style/main.css" rel="stylesheet" type="text/css">
<meta name="apple-mobile-web-app-capable" content="yes">
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,700' rel='stylesheet' type='text/css'>
<meta name="HandheldFriendly" content="True">
<meta name="MobileOptimized" content="320">
<link rel="icon" href="http://images.icnetwork.co.uk/collections/usvsth3m/favicon.ico">
<link rel="image_src" href="http://games.usvsth3m.com/2048/intro.jpg">
<meta property="og:image" content="http://games.usvsth3m.com/2048/intro.jpg" />
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0, maximum-scale=1, user-scalable=no, minimal-ui">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400,700' rel='stylesheet' type='text/css'>
<script src="http://static.usvsth3m.com/wrapper/wrapper.js"></script>
<link rel="stylesheet" href="http://static.usvsth3m.com/wrapper/wrapper.css">
<style>
.tile-text {
display:inline-block;
vertical-align: middle;
}
/* lol !important */
.tile-inner { background-position: center center !important; background-size: cover !important; background-repeat: no-repeat !important; }
.tile-2 .tile-inner {
background-image: url(http://i.imgur.com/xL3CJJy.png) !important;
}
.tile-4 .tile-inner {
background-image: url(http://i.imgur.com/lcaGHPG.jpg) !important;
}
.tile-8 .tile-inner {
background-image: url(http://i.imgur.com/zIa35Cy.jpg) !important;
}
.tile-16 .tile-inner {
background-image: url(http://i.imgur.com/t6Fi2zp.jpg) !important;
}
.tile-32 .tile-inner {
background-image: url(http://i.imgur.com/Eqr5jl4.gif) !important;
}
.tile-64 .tile-inner {
background-image: url(http://cdn3.volusion.com/vyfsn.knvgw/v/vspfiles/photos/ftc-2013-2.jpg?1374491143) !important;
}
.tile-128 .tile-inner {
background-image: url(http://i.imgur.com/4ZhIibM.png) !important;
}
.tile-256 .tile-inner {
background-image: url(http://botbench.com/driversuite/images/logo.png) !important;
}
.tile-512 .tile-inner {
background-image: url(http://i.imgur.com/g7VPaMv.gif) !important;
}
.tile-1024 .tile-inner {
background-image: url(http://www.rose-hulman.edu/media/496800/dean-kamen_250x361.jpg) !important;
}
.tile-2048 .tile-inner {
background-image: url(http://upload.wikimedia.org/wikipedia/en/b/b5/Woodie_flowers.jpg) !important;
}
.thisistext, p, a, h1 { color: #776e65; }
.game-container { background-color: #bbada0 }
.preload, .preload img { position: absolute; top: -100px; -left: 100px; width: 1px; height: 1px; overflow: hidden; }
#fix {
position: absolute; top: 0; left: 0; width: 100%; height: 100%; position: fixed; z-index: -1000;
background-color: #faf8ef;
}
</style>
<script>
// GLOBALS, GLOBALS, BODGE ALL THE GLOBALS
var external_score;
var tile_contents = ["","","","","","","","","","","",""];
var external_score; // yep, this is a bodge
function tweet() {
var tweet = {};
tweet.message='I scored ' + external_score + " in 2048: FTC Edition! Can you beat me?" ;
tweet.url="http://games.usvsth3m.com/2048/ftc-edition/";
UVT.sharing.twitter(tweet);
}
function facebook() {
var fbmsg = {};
fbmsg.title='I scored ' + external_score + " in 2048: FTC Edition! Can you beat me?" ;
fbmsg.message="Make your own versions of addictive slidey-puzzle game 2048.";
fbmsg.url="http://games.usvsth3m.com/2048/ftc-edition/";
fbmsg.picture="http://games.usvsth3m.com/2048/intro.jpg";
UVT.sharing.facebook(fbmsg);
}
var sizes = [];
function resizeTextOn(whichelement) {
if (typeof sizes[whichelement] == "undefined") {
//console.log("Performing hard maths on " + whichelement);
$(whichelement + " .tile-inner").css("display", "block");
$(whichelement + " .tile-text").css("display", "inline-block");
$(whichelement + " .tile-text").css("fontSize", "60px");
while ($(whichelement + " .tile-text").width()+30 > $(whichelement + " .tile-inner").width()) {
var newSize = (parseInt($(whichelement + " .tile-text").css("fontSize")) - 1) + "px";
$(whichelement + " .tile-text").css("fontSize", newSize);
}
if (typeof newSize == "undefined") { var newSize = "60px"; }
$(whichelement + " .tile-text").css("lineHeight", newSize);
if (parseInt(newSize) > 50) {
$(whichelement + " .tile-text").css("position", "relative");
$(whichelement + " .tile-text").css("top", "5px");
} else {
$(whichelement + " .tile-text").css("position", "relative");
$(whichelement + " .tile-text").css("top", "0px");
}
$(whichelement + " .tile-inner").css("display", "table");
$(whichelement + " .tile-text").css("display", "table-cell");
sizes[whichelement] = newSize;
} else {
newSize = sizes[whichelement];
$(whichelement + " .tile-text").css("fontSize", newSize);
$(whichelement + " .tile-text").css("lineHeight", newSize);
if (parseInt(newSize) > 50) {
$(whichelement + " .tile-text").css("position", "relative");
$(whichelement + " .tile-text").css("top", "5px");
} else {
$(whichelement + " .tile-text").css("position", "relative");
$(whichelement + " .tile-text").css("top", "0px");
}
$(whichelement + " .tile-inner").css("display", "table");
$(whichelement + " .tile-text").css("display", "table-cell");
}
//console.log(sizes);
}
$(document).keypress(function(event) {
if ( event.which == 61 ) {
$(".tile-container").empty();
var tile = new Tile({x:0,y:0},2);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:1,y:0},4);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:2,y:0},8);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:3,y:0},16);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:0,y:1},32);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:1,y:1},64);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:2,y:1},128);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:3,y:1},256);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:0,y:2},512);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:1,y:2},1024);
HTMLActuator.prototype.addTile(tile);
var tile = new Tile({x:2,y:2},2048);
HTMLActuator.prototype.addTile(tile);
}
});
</script>
<style>
@media (min-width: 800px) {
.sharer {
-moz-column-count: 2;
-moz-column-gap: 20px;
-webkit-column-count: 2;
-webkit-column-gap: 20px;
}
.sharer a { color: #0000cc; }
}
@media (max-width: 800px) {
.sharer {
padding: 0 10px;
}
.sharer a { color: #0000cc; }
}
</style>
</head>
<body>
<div id="fix"></div>
<div class="container">
<h1> FTC 2048 </h1>
<div class="heading">
<div class="game-container">
<div class="game-message">
<p></p>
<div class="lower">
<a class="tweet">Tweet your score</a>
<a class="facebook">Share on Facebook</a>
<a class="retry-button">Try again</a>
</div>
</div>
<div class="grid-container">
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
</div>
<div class="tile-container">
</div>
</div>
<p class="game-explanation">
<strong class="important">How to play:</strong> Use your <strong>arrow keys</strong> to move the tiles.<br>When two identical tiles touch, they merge and become the next level of tile. Get a tile to the eleventh level to win.
</p>
<hr>
<div class="sharer">
<div>
<a href="https://twitter.com/share" class="twitter-share-button" data-size="large" data-related="usvsth3m" data-dnt="true">Tweet</a>
<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>
</div>
<div class="fb-like" data-width="240" data-height="40" data-layout="standard" data-action="like" data-show-faces="false" data-send="false"></div>
</div>
<hr>
<p>
A complete ripoff of <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli</a>'s MIT-licensed <a href="http://gabrielecirulli.github.io/2048/">2048</a>, which was based on <a href="https://itunes.apple.com/us/app/1024!/id823499224" target="_blank">1024 by Veewo Studio</a> and conceptually similar to <a href="http://asherv.com/threes/" target="_blank">Threes by Asher Vollmer</a>. All the words and images you see have been supplied by our users.
</p>
</div>
<script src="/2048/js/glom.js"></script>
<div class="preload">
<img src="http://i.imgur.com/xL3CJJy.png" class="preload"><img src="http://i.imgur.com/lcaGHPG.jpg" class="preload"><img src="http://i.imgur.com/zIa35Cy.jpg" class="preload"><img src="http://i.imgur.com/t6Fi2zp.jpg" class="preload"><img src="http://i.imgur.com/Eqr5jl4.gif" class="preload"><img src="http://cdn3.volusion.com/vyfsn.knvgw/v/vspfiles/photos/ftc-2013-2.jpg?1374491143" class="preload"><img src="http://i.imgur.com/4ZhIibM.png" class="preload"><img src="http://botbench.com/driversuite/images/logo.png" class="preload"><img src="http://i.imgur.com/g7VPaMv.gif" class="preload"><img src="http://www.rose-hulman.edu/media/496800/dean-kamen_250x361.jpg" class="preload"><img src="http://upload.wikimedia.org/wikipedia/en/b/b5/Woodie_flowers.jpg" class="preload"> </div>
<!-- UVT Sharing and Analytics for Interactives -->
<div id="fb-root"></div>
<script src="http://static.usvsth3m.com/js/unified-sharing.js"></script>
<script type='text/javascript'>
var _sf_async_config={};
/** CONFIGURATION START **/
_sf_async_config.uid = 33715;
_sf_async_config.domain = 'usvsth3m.tumblr.com';
_sf_async_config.useCanonical = true;
_sf_async_config.sections = 'Change this to your Section name'; //CHANGE THIS
_sf_async_config.authors = 'Change this to your Author name'; //CHANGE THIS
/** CONFIGURATION END **/
(function(){
function loadChartbeat() {
window._sf_endpt=(new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src', '//static.chartbeat.com/js/chartbeat.js');
document.body.appendChild(e);
}
var oldonload = window.onload;
window.onload = (typeof window.onload != 'function') ?
loadChartbeat : function() { oldonload(); loadChartbeat(); };
})();
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '383984258388383', // App ID from the app dashboard
channelUrl : '//games.usvsth3m.com/channel.html', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Additional initialization code such as adding Event Listeners goes here
};
</script>
<!-- SiteCatalyst Code -->
<script type="text/JavaScript"><!--
//var s_account = "tmrmirrordeveloper";
var s_account = "tmrusvsthem,tmrgroupaggregateprod";
var s_omnitureDNSAlias = "trinitymirror.112.2o7.net";
//--></script>
<script language="JavaScript" type="text/javascript" src="http://s.mirror.co.uk/resources/js/s_code.js"></script>
<script language="JavaScript" type="text/javascript"><!--
s.pageName ="us vs th3m:"+document.title;
s.prop5 ="us vs th3m";
s.prop1=document.location.host;
s.eVar40=document.location.host;
s.prop16="MGN5";
s.prop21="MGN2";
var s_code=s.t();if(s_code)document.write(s_code)//--></script>
<script language="JavaScript" type="text/javascript"><!--
if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//--></script><noscript><img src="http://trinitymirror.112.2o7.net/b/ss/tmrusvsthem,tmrmgnthreeaggprod/1/H.25.2--NS/0?[AQB]&cdp=3&[AQE]"
height="1" width="1" border="0" alt="" /></noscript>
<!-- End UVT Sharing -->
</body>
</html>
<!-- Cached, generated in 0.0013070106506348 seconds -->