diff --git a/index.html b/index.html index 2cff28b..f9707a5 100644 --- a/index.html +++ b/index.html @@ -75,6 +75,7 @@ #setup h2, #setup label { + margin: 4vmin 3.5vmin; font-size: 6vmin; color: #fe7ac6; text-shadow: 0.5vmin 0.5vmin 0 #a4f4b4; /* x y blur-radius colour */ @@ -85,6 +86,17 @@ left: 10vmin; } + input[type="radio"] { + display: none; + } + + /* after checked input */ + input:checked + label { + border: 1vmin dotted #a4f4b4; + border-radius: 2vmin; + padding: 1vmin 2vmin; + } + button { font-family: Helsinki; font-size: 6vmin; @@ -424,7 +436,7 @@ $('input[type="radio"]').on("change", function() { switch ($(this).val()) { case "easy": - mineChance = 0.1; + mineChance = 0.13; break; case "normal": mineChance = 0.2; @@ -445,6 +457,8 @@ $('#setup button').on("click", function() { //reset stats + firstClick = true; + score = 0; mines = 0; @@ -456,8 +470,20 @@ $.fn.leftClick = function() { //don't want first click to be a mine - if (firstClick && $(this).isMine()) { - $(this).removeClass("mine"); + if (firstClick) { + var x = $(this).getX(); + x = (x >= 1) ? x : 1; + x = (x <= gameBoardWidth - 2) ? x : gameBoardWidth - 2; + + var y = $(this).getY(); + y = (y >= 1) ? y : 1; + y = (y <= gameBoardHeight - 2) ? y : gameBoardHeight - 2; + + $('ul').eq(y - 1).children().slice(x - 1).filter(':lt(3)').removeClass("mine"); + $('ul').eq(y ).children().slice(x - 1).filter(':lt(3)').removeClass("mine"); + $('ul').eq(y + 1).children().slice(x - 1).filter(':lt(3)').removeClass("mine"); + + firstClick = false; } if ($(this).hasClass("flagged")) {