From e4660cf7aa65a570138c83d48e58047fe41548d8 Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 14:55:37 +0000 Subject: [PATCH 1/3] Middle click behaviour Allow middle clicking for adjacent clicked mines as well as flagged mines --- index.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index e9a577f..a8f647c 100644 --- a/index.html +++ b/index.html @@ -349,8 +349,10 @@ } $.fn.middleClick = function() { + //move this functionality to left click + //number of flags matches number of adjacent mines - if ($(this).text() == $(this).getAdjacentTiles().filter('.flagged').length) { + if ($(this).text() == $(this).getAdjacentTiles().filter('.flagged, .revealed.mine').length) { $(this).getAdjacentTiles().filter(':not(.flagged)').each(function() { $(this).mousedown(); }); @@ -358,7 +360,10 @@ } $.fn.rightClick = function() { - if (!$(this).hasClass("revealed")) { + if ($(this).hasClass("revealed")) { + //deploy a bomb! + //... + } else { $(this).toggleClass("flagged"); } } From bae72b544c3fa8dc1e5be575eff688190b4de101 Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 15:03:23 +0000 Subject: [PATCH 2/3] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 050d1ad..c6949d5 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,11 @@ game over screen/restart button 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 ## bugs 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 + +this has been slightly fixed but in a hacky way From 59501877789496fda6e3318a33cc488bec62e59a Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 15:28:12 +0000 Subject: [PATCH 3/3] Additions/fixes Added stats box (non-functioning) Better middle-click support Styling changes --- index.html | 41 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index a8f647c..274b574 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,7 @@ height: 100vh; width: 100vw; overflow: hidden; + font-family: Helsinki; } body { @@ -27,6 +28,31 @@ background-color: #2b2113; float: left; 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 { @@ -40,7 +66,6 @@ li { color: white; font-size: 8vmin; - font-family: Helsinki; padding: 1vmin; padding-top: 0.5vmin; padding-bottom: 1.5vmin; @@ -49,7 +74,7 @@ float: left; height: 8vmin; width: 8vmin; - background-color: #4e3c23; + background-color: #8b969e; border-radius: 2vmin; cursor: default; } @@ -59,7 +84,7 @@ } li:not(.revealed):hover { - background-color: #614a2c; + background-color: #a0a9af; } li.flagged { @@ -109,7 +134,7 @@