Merge remote-tracking branch 'origin/master' into gh-pages
This commit is contained in:
commit
ebc1697a6f
|
@ -18,11 +18,11 @@ game over screen/restart button
|
||||||
|
|
||||||
make flags permanent to prevent cheating?
|
make flags permanent to prevent cheating?
|
||||||
|
|
||||||
make middle click work on revealed mines and not just flagged mines
|
|
||||||
|
|
||||||
save game using html5 local storage so player can come back later
|
save game using html5 local storage so player can come back later
|
||||||
|
|
||||||
## bugs
|
## bugs
|
||||||
Game adds too many rows and they appear off the bottom of the screen
|
Game adds too many rows and they appear off the bottom of the screen
|
||||||
|
|
||||||
middle-clicking causes middle-click-scroll to happen; this is probably related to above issue
|
middle-clicking causes middle-click-scroll to happen; this is probably related to above issue
|
||||||
|
|
||||||
|
this has been slightly fixed but in a hacky way
|
||||||
|
|
48
index.html
48
index.html
|
@ -15,6 +15,7 @@
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
font-family: Helsinki;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
|
@ -27,6 +28,31 @@
|
||||||
background-color: #2b2113;
|
background-color: #2b2113;
|
||||||
float: left;
|
float: left;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
height: 90vmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
#stats {
|
||||||
|
height: 10vmin;
|
||||||
|
width: 100vmin;
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
border-radius: 2vmin;
|
||||||
|
|
||||||
|
background: #768087;
|
||||||
|
background: -moz-linear-gradient(top, #768087 0%, #53595e 100%);
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#768087), color-stop(100%,#53595e));
|
||||||
|
background: -webkit-linear-gradient(top, #768087 0%,#53595e 100%);
|
||||||
|
background: -o-linear-gradient(top, #768087 0%,#53595e 100%);
|
||||||
|
background: -ms-linear-gradient(top, #768087 0%,#53595e 100%);
|
||||||
|
background: linear-gradient(to bottom, #768087 0%,#53595e 100%);
|
||||||
|
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#768087', endColorstr='#53595e',GradientType=0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
#stats div {
|
||||||
|
float: left;
|
||||||
|
font-size: 5.4vmin;
|
||||||
|
margin: 2vmin 4vmin;
|
||||||
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul {
|
ul {
|
||||||
|
@ -40,7 +66,6 @@
|
||||||
li {
|
li {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: 8vmin;
|
font-size: 8vmin;
|
||||||
font-family: Helsinki;
|
|
||||||
padding: 1vmin;
|
padding: 1vmin;
|
||||||
padding-top: 0.5vmin;
|
padding-top: 0.5vmin;
|
||||||
padding-bottom: 1.5vmin;
|
padding-bottom: 1.5vmin;
|
||||||
|
@ -49,7 +74,7 @@
|
||||||
float: left;
|
float: left;
|
||||||
height: 8vmin;
|
height: 8vmin;
|
||||||
width: 8vmin;
|
width: 8vmin;
|
||||||
background-color: #4e3c23;
|
background-color: #8b969e;
|
||||||
border-radius: 2vmin;
|
border-radius: 2vmin;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +84,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
li:not(.revealed):hover {
|
li:not(.revealed):hover {
|
||||||
background-color: #614a2c;
|
background-color: #a0a9af;
|
||||||
}
|
}
|
||||||
|
|
||||||
li.flagged {
|
li.flagged {
|
||||||
|
@ -109,7 +134,7 @@
|
||||||
<script src="jquery-2.1.3.min.js"></script>
|
<script src="jquery-2.1.3.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var gameBoardWidth = 10;
|
var gameBoardWidth = 10;
|
||||||
var gameBoardHeight = 10;
|
var gameBoardHeight = 9;
|
||||||
var score = 0;
|
var score = 0;
|
||||||
var firstClick = true;
|
var firstClick = true;
|
||||||
var currentlyIterating = false;
|
var currentlyIterating = false;
|
||||||
|
@ -349,8 +374,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.middleClick = function() {
|
$.fn.middleClick = function() {
|
||||||
|
//move this functionality to left click
|
||||||
|
|
||||||
//number of flags matches number of adjacent mines
|
//number of flags matches number of adjacent mines
|
||||||
if ($(this).text() == $(this).getAdjacentTiles().filter('.flagged').length) {
|
if (parseInt($(this).text()) === $(this).getAdjacentTiles().filter('.flagged, .revealed.mine').length) {
|
||||||
$(this).getAdjacentTiles().filter(':not(.flagged)').each(function() {
|
$(this).getAdjacentTiles().filter(':not(.flagged)').each(function() {
|
||||||
$(this).mousedown();
|
$(this).mousedown();
|
||||||
});
|
});
|
||||||
|
@ -358,7 +385,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$.fn.rightClick = function() {
|
$.fn.rightClick = function() {
|
||||||
if (!$(this).hasClass("revealed")) {
|
if ($(this).hasClass("revealed")) {
|
||||||
|
//deploy a bomb!
|
||||||
|
//...
|
||||||
|
} else {
|
||||||
$(this).toggleClass("flagged");
|
$(this).toggleClass("flagged");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -368,6 +398,8 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("mousedown", "li", function(event) {
|
$(document).on("mousedown", "li", function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
if (!inputEnabled) return;
|
if (!inputEnabled) return;
|
||||||
|
|
||||||
switch (event.which) {
|
switch (event.which) {
|
||||||
|
@ -392,5 +424,9 @@
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="game"></div>
|
<div id="game"></div>
|
||||||
|
<div id="stats">
|
||||||
|
<div id="score">Score: 0</div>
|
||||||
|
<div id="bombs">Bombs: 0</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue