minesweeper/src/main/webapp/pages/index.html
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 14 Aug 2014 07:50:10 +0200
branchAppStore
changeset 197 197472ca59d4
parent 186 541d0898da47
permissions -rw-r--r--
Adressing comments from the first AppStore review: 1. don't mention android, 2. don't use word 'demo', replace it with 'showcase'.
jtulach@63
     1
<!--
jtulach@63
     2
jtulach@63
     3
    The MIT License (MIT)
jtulach@63
     4
jtulach@63
     5
    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@63
     6
jtulach@63
     7
    Permission is hereby granted, free of charge, to any person obtaining a copy
jtulach@63
     8
    of this software and associated documentation files (the "Software"), to deal
jtulach@63
     9
    in the Software without restriction, including without limitation the rights
jtulach@63
    10
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jtulach@63
    11
    copies of the Software, and to permit persons to whom the Software is
jtulach@63
    12
    furnished to do so, subject to the following conditions:
jtulach@63
    13
jtulach@63
    14
    The above copyright notice and this permission notice shall be included in
jtulach@63
    15
    all copies or substantial portions of the Software.
jtulach@63
    16
jtulach@63
    17
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jtulach@63
    18
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jtulach@63
    19
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jtulach@63
    20
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jtulach@63
    21
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jtulach@63
    22
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jtulach@63
    23
    THE SOFTWARE.
jtulach@63
    24
jtulach@63
    25
-->
jtulach@63
    26
<!DOCTYPE html>
jtulach@63
    27
<html>
jtulach@63
    28
    <head>
jtulach@182
    29
        <title>Fair Minesweeper</title>
jtulach@63
    30
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
jtulach@63
    31
        <link href="bootstrap.css" rel="stylesheet">
jtulach@63
    32
        <link href="bootstrap-responsive.css" rel="stylesheet">
jtulach@63
    33
        <link href="mines.css" rel="stylesheet">
jtulach@71
    34
        <!-- Target tablets -->
jtulach@73
    35
        <link href="mines-tablet-large.css" 
jaroslav@139
    36
              media="(min-width:640px), (min-height:660px)" 
jtulach@73
    37
              rel="stylesheet" />
jtulach@73
    38
        <link href="mines-tablet-small.css" 
jtulach@80
    39
              media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)" 
jtulach@73
    40
              rel="stylesheet" />
jtulach@71
    41
        <!-- Target phones -->
jtulach@73
    42
        <link href="mines-phone-large.css" 
jtulach@80
    43
              media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)" 
jtulach@73
    44
              rel="stylesheet" />
jtulach@73
    45
        <link href="mines-phone-small.css" 
jtulach@180
    46
              media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)" 
jtulach@80
    47
              rel="stylesheet" />
jtulach@80
    48
        <link href="mines-phone-smaller.css" 
jtulach@180
    49
              media="(max-width:300px), (max-height:300px)" 
jtulach@73
    50
              rel="stylesheet" />
jtulach@63
    51
    </head>
jtulach@63
    52
    <body>
jtulach@70
    53
        <div class="navbar">
jtulach@70
    54
            <div class="navbar-inner">
jaroslav@175
    55
                <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
jaroslav@175
    56
                    <img height="20" width="20" src="DukeSweeper.png">
jaroslav@175
    57
                    <span class="hidden-phone">Minesweeper</span>
jaroslav@175
    58
                </a>
jtulach@80
    59
                <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
jtulach@80
    60
                    <span>&#x21bb;</span>
jtulach@80
    61
                    <span class="hidden-phone">New Game!</span>
jtulach@80
    62
                </button>
jaroslav@176
    63
                <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
jtulach@80
    64
                    <span>&#x2717;</span>
jtulach@80
    65
                    <span class="hidden-phone">Show Mines!</span>
jtulach@80
    66
                </button>
jaroslav@176
    67
                <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
jaroslav@164
    68
                    <span>&#x26A0;</span>
jaroslav@164
    69
                    <span class="hidden-phone">Mark Mine!</span>
jaroslav@164
    70
                </button>
jtulach@70
    71
            </div>
jtulach@70
    72
        </div>
jaroslav@163
    73
jtulach@63
    74
jtulach@76
    75
        <script type="text/html" id="field">
jaroslav@139
    76
          <center>
jaroslav@166
    77
              <table class="field" data-bind="css: gameStyle">
jtulach@76
    78
                <tbody>
jtulach@76
    79
                    <!-- ko foreach: rows -->
jtulach@76
    80
                    <tr>
jtulach@76
    81
                        <!-- ko foreach: columns -->
jtulach@76
    82
                        <td data-bind="css: style, click: $parents[1].click" >
jaroslav@163
    83
                            <div></div>
jtulach@76
    84
                        </td>
jtulach@76
    85
                        <!-- /ko -->
jtulach@76
    86
                    </tr>
jtulach@63
    87
                    <!-- /ko -->
jtulach@76
    88
                </tbody>
jtulach@76
    89
            </table>
jaroslav@139
    90
          </center>
jtulach@76
    91
        </script>
jtulach@78
    92
jtulach@78
    93
        <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
jtulach@63
    94
        
jtulach@77
    95
        <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
jtulach@77
    96
            <div class="container">
jaroslav@197
    97
                <h1>HTML/Java Technology Showcase</h1>
jtulach@77
    98
jtulach@77
    99
                <p>At first sight this is an old good <em>minesweeper</em>
jaroslav@197
   100
                    game. At closer look, this is a sample use of a revolutionary 
jtulach@77
   101
                    technology that allows you to use <strong>Java</strong>
jtulach@77
   102
                    to code your application logic and present it using
jaroslav@197
   103
                    <strong>HTML</strong> on any device providing
jtulach@77
   104
                    modern <strong>HTML5</strong> browser.
jtulach@77
   105
                </p>
jtulach@77
   106
                <p><a class="btn btn-primary btn-lg" role="button" 
jtulach@78
   107
                      target="_blank" href="http://html.java.net"
jtulach@78
   108
                >Visit Project Page!</a>
jtulach@77
   109
                </p>
jtulach@77
   110
            </div>
jtulach@77
   111
        </div>
jtulach@78
   112
jtulach@78
   113
    <div class="container" data-bind="visible: !fieldShowing()">
jaroslav@186
   114
      <div>
jaroslav@197
   115
        <div class="col-sm-8 col-md-6">
jtulach@78
   116
          <h2>Minesweeper</h2>
jtulach@78
   117
          <p>
jtulach@182
   118
              Discover ten square fields that contain a mine and
jaroslav@197
   119
              mark them with a <b>&#x26a0;</b> sign.
jtulach@182
   120
              Touch a square to find out if there is
jtulach@182
   121
              a mine or not and
jtulach@182
   122
              how many mines are in the eight surrounding 
jtulach@182
   123
              ones. Avoid random play, the game 
jtulach@182
   124
              recognizes guessing and can re-arrange
jtulach@182
   125
              the mines. This game is <b>fair</b>!
jtulach@78
   126
          </p>
jtulach@78
   127
          <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play &raquo;</a></p>
jtulach@78
   128
        </div>
jaroslav@197
   129
        <div class="col-sm-8 col-md-6">
jtulach@78
   130
          <h2>Documentation</h2>
jtulach@78
   131
          <p>
jtulach@78
   132
              In case you want to write application like 
jtulach@78
   133
              this (e.g. use <strong>Java</strong> and <strong>HTML</strong>)
jtulach@78
   134
              you can learn more about the libraries that
jtulach@78
   135
              make that possible. Follow this link to
jaroslav@197
   136
              <em>HTML for Java</em> documentation.
jtulach@78
   137
          </p>
jtulach@78
   138
          <p><a class="btn btn-default"
jaroslav@135
   139
                target="_blank" href="http://bits.netbeans.org/html+java/"
jtulach@78
   140
                role="button">Read more &raquo;</a></p>
jtulach@78
   141
       </div>
jtulach@93
   142
      </div>
jtulach@78
   143
    </div>
jaroslav@186
   144
<div class="container" data-bind="visible: !fieldShowing()">
jtulach@183
   145
  <div class="col-sm-6 col-md-4">
jtulach@183
   146
    <div class="thumbnail">
jaroslav@197
   147
        <img src="safari_logo.png" width="120" height="120" alt="Safari">
jtulach@183
   148
      <div class="caption">
jaroslav@197
   149
          <h3>Run in a Browser</h3>
jaroslav@197
   150
          <p>
jaroslav@197
   151
              While primarily this technology runs on a desktop
jaroslav@197
   152
              or as a tablet or phone application, it is also possible
jaroslav@197
   153
              to execute the same unchanged code directly in a browser 
jaroslav@197
   154
              as well. To do so, one needs a 
jaroslav@197
   155
              <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>
jaroslav@197
   156
              virtual machine.
jaroslav@197
   157
          </p>
jaroslav@197
   158
          <p><a class="btn btn-primary" role="button"
jaroslav@197
   159
                target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
jaroslav@197
   160
             >Try it &raquo;</a></p>
jaroslav@197
   161
       </div>
jtulach@183
   162
    </div>
jtulach@183
   163
  </div>
jtulach@183
   164
  <div class="col-sm-6 col-md-4">
jtulach@183
   165
    <div class="thumbnail">
jtulach@183
   166
        <img src="ios_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   167
      <div class="caption">
jtulach@183
   168
        <h3>iBrwsr</h3>
jtulach@183
   169
        <p>
jtulach@183
   170
            This application can also be packaged to run on your iPhone
jaroslav@197
   171
            or iPad.
jtulach@183
   172
            In this mode it
jtulach@183
   173
            uses <a target="_blank" href="http://www.robovm.org">RoboVM</a> 
jtulach@183
   174
            virtual machine to execute Java code natively.
jtulach@183
   175
            It uses iOS WebView to display the UI and execute
jtulach@183
   176
            generated JavaScript. Both these components are
jtulach@183
   177
            bound together via <a target="_blank" 
jtulach@183
   178
                href="http://wiki.apidesign.org/wiki/IBrwsr">
jtulach@183
   179
            iBrwsr</a> library.
jtulach@183
   180
        </p>
jtulach@183
   181
        <p>
jtulach@183
   182
            <a href="http://wiki.apidesign.org/wiki/IBrwsr"
jtulach@183
   183
               target="_blank"
jtulach@183
   184
               class="btn btn-primary" role="button"
jtulach@183
   185
               >Learn more &raquo;</a> 
jtulach@183
   186
        </p>
jtulach@183
   187
      </div>
jtulach@183
   188
    </div>
jtulach@183
   189
  </div>
jtulach@183
   190
  <div class="col-sm-6 col-md-4">
jtulach@183
   191
    <div class="thumbnail">
jtulach@183
   192
        <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   193
      <div class="caption">
jtulach@183
   194
        <h3>Develop Own App!</h3>
jtulach@183
   195
        <p>
jtulach@183
   196
            One can package this application as a 
jtulach@183
   197
            <a href="http://plugins.netbeans.org/plugin/53864/"
jtulach@183
   198
               target="_blank"
jtulach@183
   199
            >plugin for NetBeans</a> or
jtulach@183
   200
            use <a href="http://www.netbeans.org" target="_blank">
jtulach@183
   201
            NetBeans</a> IDE to create
jtulach@183
   202
            application like this yourself. Enjoy the
jtulach@183
   203
            power of <em>HTML</em> and <em>Java</em>.
jtulach@183
   204
            Write your applications once and deploy and display 
jtulach@183
   205
            them on any device!
jtulach@183
   206
        </p>
jtulach@183
   207
        <p>
jtulach@183
   208
            <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
jtulach@183
   209
               target="_blank"
jtulach@183
   210
               class="btn btn-primary" role="button"
jtulach@183
   211
               >Develop &raquo;</a> 
jtulach@183
   212
        </p>
jtulach@183
   213
      </div>
jtulach@183
   214
    </div>
jtulach@183
   215
  </div>
jtulach@183
   216
</div>
jtulach@94
   217
        <!-- boot bck2brwsr -->
jtulach@63
   218
        <script type="text/javascript" src="bck2brwsr.js"></script>
jtulach@63
   219
        <script>
jaroslav@160
   220
            var vm = bck2brwsr('minesweeper.js');
jaroslav@160
   221
            var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
jaroslav@160
   222
            c.invoke('main');
jtulach@63
   223
        </script>
jtulach@89
   224
jtulach@63
   225
    </body>
jtulach@63
   226
</html>