Reset button

Also, credits
This commit is contained in:
synth-ruiner 2015-03-09 19:34:50 +00:00
parent 2c007f7c81
commit 8148057849
1 changed files with 47 additions and 7 deletions

View File

@ -47,6 +47,20 @@
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#768087', endColorstr='#53595e',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#768087', endColorstr='#53595e',GradientType=0 );
} }
#stats button {
margin: 1vmin;
float: right;
font-family: Helsinki;
font-size: 3vmin;
border-radius: 2vmin;
padding: 1.75vmin;
box-shadow: 0.5vmin 0.5vmin 0 #000;
border: 0.4vmin solid #454e52;
position: relative;
top: auto;
left: auto;
}
#stats div { #stats div {
float: left; float: left;
font-size: 5.4vmin; font-size: 5.4vmin;
@ -66,8 +80,6 @@
} }
#setup h1 { #setup h1 {
margin-top: 6vmin;
margin-bottom: 6vmin;
} }
#setup h2 { #setup h2 {
@ -121,6 +133,11 @@
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#768087', endColorstr='#53595e',GradientType=0 ); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#768087', endColorstr='#53595e',GradientType=0 );
} }
button.cancel {
right: 20vmin;
left: auto;
}
h1, h2 { h1, h2 {
text-align: center; text-align: center;
} }
@ -128,7 +145,8 @@
h1 { h1 {
color: #a4f4b4; color: #a4f4b4;
font-size: 12vmin; font-size: 12vmin;
margin: 16vmin 0; margin-top: 6vmin;
margin-bottom: 6vmin;
text-shadow: 1vmin 1vmin 0 #fe7ac6; /* x y blur-radius colour */ text-shadow: 1vmin 1vmin 0 #fe7ac6; /* x y blur-radius colour */
} }
@ -507,14 +525,31 @@
}); });
$('#gameOver button').on("click", function() { $('#gameOver button').on("click", function() {
//reset game board
drawGameBoard(); drawGameBoard();
$('#gameOver').hide(); $('#gameOver').hide();
$('button.cancel').hide();
$('button.start').removeAttr('style');
$('#setup').show(); $('#setup').show();
}); });
$('#setup button').on("click", function() { $('button.reset').on("click", function() {
//prompt user with setup screen
$('#setup').show();
$('button.cancel').show();
$('button.start').css('left', '20vmin');
});
$('button.cancel').on("click", function() {
//prompt user with setup screen
$('#setup').hide();
$('button.cancel').hide();
$('button.start').removeAttr('style');
});
$('button.start').on("click", function() {
drawGameBoard();
//reset stats //reset stats
firstClick = true; firstClick = true;
@ -656,6 +691,7 @@
drawGameBoard(); drawGameBoard();
$('#gameOver').hide(); $('#gameOver').hide();
$('button.cancel').hide();
}); });
</script> </script>
<script> <script>
@ -673,10 +709,13 @@
<div id="stats"> <div id="stats">
<div id="score">Score: 0</div> <div id="score">Score: 0</div>
<div id="mines">Mines left: 0</div> <div id="mines">Mines left: 0</div>
<button class="reset">reset</button>
</div> </div>
<div id="gameOver"> <div id="gameOver">
<h1>game over</h1> <h1>game over</h1>
<!-- credits go here --> <p>a game by max bradbury</p>
<p>inspirations include minesweeper, tetris and 2048</p>
<p>tell your friends</p>
<button>reset</button> <button>reset</button>
</div> </div>
<div id="setup"> <div id="setup">
@ -699,7 +738,8 @@
<label for="difficultyHard">Hard</label> <label for="difficultyHard">Hard</label>
</div> </div>
<button>start</button> <button class="start">start</button>
<button class="cancel">cancel</button>
</div> </div>
</body> </body>
</html> </html>