提交 09beaf57 编写于 作者: M Mikhail Novikov

Merge branch 'master' into gh-pages

...@@ -3,12 +3,18 @@ A small clone of [1024](https://play.google.com/store/apps/details?id=com.veewo. ...@@ -3,12 +3,18 @@ A small clone of [1024](https://play.google.com/store/apps/details?id=com.veewo.
Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/) Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/)
The official app can also be found on the [Play Store](https://play.google.com/store/apps/details?id=com.gabrielecirulli.app2048) and [App Store!](https://itunes.apple.com/us/app/2048-by-gabriele-cirulli/id868076805)
### Contributions ### Contributions
[Anna Harren](https://github.com/iirelu/) and [sigod](https://github.com/sigod) are maintainers for this repository.
Other notable contributors:
- [TimPetricola](https://github.com/TimPetricola) added best score storage - [TimPetricola](https://github.com/TimPetricola) added best score storage
- [chrisprice](https://github.com/chrisprice) added custom code for swipe handling on mobile - [chrisprice](https://github.com/chrisprice) added custom code for swipe handling on mobile
- [elektryk](https://github.com/elektryk) made swipes work on Windows Phone - [elektryk](https://github.com/elektryk) made swipes work on Windows Phone
- [mgarciaisaia](https://github.com/mgarciaisaia) addes support for Android 2.3 - [mgarciaisaia](https://github.com/mgarciaisaia) added support for Android 2.3
Many thanks to [rayhaanj](https://github.com/rayhaanj), [Mechazawa](https://github.com/Mechazawa), [grant](https://github.com/grant), [remram44](https://github.com/remram44) and [ghoullier](https://github.com/ghoullier) for the many other good contributions. Many thanks to [rayhaanj](https://github.com/rayhaanj), [Mechazawa](https://github.com/Mechazawa), [grant](https://github.com/grant), [remram44](https://github.com/remram44) and [ghoullier](https://github.com/ghoullier) for the many other good contributions.
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
<link href="style/main.css" rel="stylesheet" type="text/css"> <link href="style/main.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="favicon.ico"> <link rel="shortcut icon" href="favicon.ico">
<link rel="apple-touch-icon" href="meta/apple-touch-icon.png"> <link rel="apple-touch-icon" href="meta/apple-touch-icon.png">
<link rel="apple-touch-startup-image" href="meta/apple-touch-startup-image-640x1096.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)"> <!-- iPhone 5+ -->
<link rel="apple-touch-startup-image" href="meta/apple-touch-startup-image-640x920.png" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)"> <!-- iPhone, retina -->
<meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
......
(function() { (function () {
var lastTime = 0; var lastTime = 0;
var vendors = ['webkit', 'moz']; var vendors = ['webkit', 'moz'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; window[vendors[x] + 'CancelRequestAnimationFrame'];
} }
if (!window.requestAnimationFrame) { if (!window.requestAnimationFrame) {
window.requestAnimationFrame = function(callback, element) { window.requestAnimationFrame = function (callback) {
var currTime = new Date().getTime(); var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function() { callback(currTime + timeToCall); }, var id = window.setTimeout(function () {
callback(currTime + timeToCall);
},
timeToCall); timeToCall);
lastTime = currTime + timeToCall; lastTime = currTime + timeToCall;
return id; return id;
...@@ -19,7 +21,7 @@ ...@@ -19,7 +21,7 @@
} }
if (!window.cancelAnimationFrame) { if (!window.cancelAnimationFrame) {
window.cancelAnimationFrame = function(id) { window.cancelAnimationFrame = function (id) {
clearTimeout(id); clearTimeout(id);
}; };
} }
......
...@@ -28,11 +28,7 @@ GameManager.prototype.keepPlaying = function () { ...@@ -28,11 +28,7 @@ GameManager.prototype.keepPlaying = function () {
// Return true if the game is lost, or has won and the user hasn't kept playing // Return true if the game is lost, or has won and the user hasn't kept playing
GameManager.prototype.isGameTerminated = function () { GameManager.prototype.isGameTerminated = function () {
if (this.over || (this.won && !this.keepPlaying)) { return this.over || (this.won && !this.keepPlaying);
return true;
} else {
return false;
}
}; };
// Set up the game // Set up the game
......
...@@ -310,7 +310,7 @@ hr { ...@@ -310,7 +310,7 @@ hr {
.tile, .tile .tile-inner { .tile, .tile .tile-inner {
width: 107px; width: 107px;
height: 107px; height: 107px;
line-height: 116.25px; } line-height: 107px; }
.tile.tile-position-1-1 { .tile.tile-position-1-1 {
-webkit-transform: translate(0px, 0px); -webkit-transform: translate(0px, 0px);
-moz-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px);
...@@ -749,7 +749,7 @@ hr { ...@@ -749,7 +749,7 @@ hr {
.tile, .tile .tile-inner { .tile, .tile .tile-inner {
width: 58px; width: 58px;
height: 58px; height: 58px;
line-height: 67.5px; } line-height: 58px; }
.tile.tile-position-1-1 { .tile.tile-position-1-1 {
-webkit-transform: translate(0px, 0px); -webkit-transform: translate(0px, 0px);
-moz-transform: translate(0px, 0px); -moz-transform: translate(0px, 0px);
......
...@@ -374,7 +374,7 @@ hr { ...@@ -374,7 +374,7 @@ hr {
&, .tile-inner { &, .tile-inner {
width: ceil($tile-size); width: ceil($tile-size);
height: ceil($tile-size); height: ceil($tile-size);
line-height: $tile-size + 10px; line-height: ceil($tile-size);
} }
// Build position classes // Build position classes
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册