Different colors and symbols minesweeper
authorJaroslav Tulach <jtulach@netbeans.org>
Sat, 08 Feb 2014 09:25:53 +0100
branchminesweeper
changeset 754eb79fa3434a
parent 74 df12da7ceed9
child 76 55b2e1d3ad2b
Different colors and symbols
minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java
minesweeper/src/main/webapp/pages/mines.css
     1.1 --- a/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java	Sat Feb 08 09:10:48 2014 +0100
     1.2 +++ b/minesweeper/src/main/java/org/apidesign/demo/minesweeper/MinesModel.java	Sat Feb 08 09:25:53 2014 +0100
     1.3 @@ -55,14 +55,14 @@
     1.4      })
     1.5      static class SquareModel {
     1.6          @ComputedProperty static String html(SquareType state) {
     1.7 -            if (state == null) return " ";
     1.8 +            if (state == null) return "&nbsp;";
     1.9              switch (state) {
    1.10 -                case EXPLOSION: return "B";
    1.11 -                case UNKNOWN: return "?";
    1.12 +                case EXPLOSION: return "&#x2717;";
    1.13 +                case UNKNOWN: return "&nbsp;";
    1.14                  case DISCOVERED: return "&#x2714;";  
    1.15                  case N_0: return "&nbsp;";
    1.16              }
    1.17 -            return "" + state.ordinal();
    1.18 +            return "&#x278" + (state.ordinal() - 1);
    1.19          }
    1.20          
    1.21          @ComputedProperty static String style(SquareType state) {
     2.1 --- a/minesweeper/src/main/webapp/pages/mines.css	Sat Feb 08 09:10:48 2014 +0100
     2.2 +++ b/minesweeper/src/main/webapp/pages/mines.css	Sat Feb 08 09:25:53 2014 +0100
     2.3 @@ -44,14 +44,14 @@
     2.4  }
     2.5  
     2.6  table.field td.UNKNOWN {
     2.7 -    background-color: #D0D0D0;
     2.8 +    background-color: #D6E4E1;
     2.9      cursor: pointer;
    2.10  }
    2.11  table.field td.EXPLOSION {
    2.12 -    background-color: #f1100c;
    2.13 +    background-color: #A31E39;
    2.14  }
    2.15  table.field td.DISCOVERED {
    2.16 -    background-color: #100cf1;
    2.17 +    background-color: #9DB2B1;
    2.18  }
    2.19  .but-orientation {
    2.20      margin-top:20px;