minesweeper/src/main/webapp/pages/index.html
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 06 Nov 2014 21:58:57 +0100
changeset 228 fc2f72be9392
parent 223 4ee062b3f5ed
permissions -rw-r--r--
According to Hrebejk defining viewport prevents scaling and speeds up reaction to touches
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">
jaroslav@228
    31
        <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
jtulach@63
    32
        <link href="bootstrap.css" rel="stylesheet">
jtulach@63
    33
        <link href="bootstrap-responsive.css" rel="stylesheet">
jtulach@63
    34
        <link href="mines.css" rel="stylesheet">
jtulach@71
    35
        <!-- Target tablets -->
jtulach@73
    36
        <link href="mines-tablet-large.css" 
jaroslav@139
    37
              media="(min-width:640px), (min-height:660px)" 
jtulach@73
    38
              rel="stylesheet" />
jtulach@73
    39
        <link href="mines-tablet-small.css" 
jtulach@80
    40
              media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)" 
jtulach@73
    41
              rel="stylesheet" />
jtulach@71
    42
        <!-- Target phones -->
jtulach@73
    43
        <link href="mines-phone-large.css" 
jtulach@80
    44
              media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)" 
jtulach@73
    45
              rel="stylesheet" />
jtulach@73
    46
        <link href="mines-phone-small.css" 
jtulach@180
    47
              media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)" 
jtulach@80
    48
              rel="stylesheet" />
jtulach@80
    49
        <link href="mines-phone-smaller.css" 
jtulach@180
    50
              media="(max-width:300px), (max-height:300px)" 
jtulach@73
    51
              rel="stylesheet" />
jtulach@63
    52
    </head>
jtulach@63
    53
    <body>
jtulach@70
    54
        <div class="navbar">
jtulach@70
    55
            <div class="navbar-inner">
jaroslav@175
    56
                <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
jaroslav@175
    57
                    <img height="20" width="20" src="DukeSweeper.png">
jaroslav@175
    58
                    <span class="hidden-phone">Minesweeper</span>
jaroslav@175
    59
                </a>
jtulach@80
    60
                <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
jtulach@80
    61
                    <span>&#x21bb;</span>
jaroslav@200
    62
                    <span class="info-text">New!</span>
jtulach@80
    63
                </button>
jaroslav@200
    64
                <button class="hidden-phone btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
jtulach@80
    65
                    <span>&#x2717;</span>
jaroslav@200
    66
                    <span>Show Mines!</span>
jtulach@80
    67
                </button>
jaroslav@176
    68
                <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
jaroslav@164
    69
                    <span>&#x26A0;</span>
jaroslav@200
    70
                    <span class="info-text">Mark Mine!</span>
jaroslav@164
    71
                </button>
jtulach@70
    72
            </div>
jtulach@70
    73
        </div>
jaroslav@163
    74
jtulach@63
    75
jtulach@76
    76
        <script type="text/html" id="field">
jaroslav@139
    77
          <center>
jaroslav@166
    78
              <table class="field" data-bind="css: gameStyle">
jtulach@76
    79
                <tbody>
jtulach@76
    80
                    <!-- ko foreach: rows -->
jtulach@76
    81
                    <tr>
jtulach@76
    82
                        <!-- ko foreach: columns -->
jtulach@76
    83
                        <td data-bind="css: style, click: $parents[1].click" >
jaroslav@163
    84
                            <div></div>
jtulach@76
    85
                        </td>
jtulach@76
    86
                        <!-- /ko -->
jtulach@76
    87
                    </tr>
jtulach@63
    88
                    <!-- /ko -->
jtulach@76
    89
                </tbody>
jtulach@76
    90
            </table>
jaroslav@139
    91
          </center>
jtulach@76
    92
        </script>
jtulach@78
    93
jtulach@78
    94
        <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
jtulach@63
    95
        
jtulach@77
    96
        <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
jtulach@77
    97
            <div class="container">
jtulach@77
    98
                <h1>HTML/Java Technology Demo</h1>
jtulach@77
    99
jtulach@77
   100
                <p>At first sight this is an old good <em>minesweeper</em>
jtulach@77
   101
                    game. At closer look, this is a demo of a revolutionary 
jtulach@77
   102
                    technology that allows you to use <strong>Java</strong>
jtulach@77
   103
                    to code your application logic and present it using
jtulach@77
   104
                    <strong>HTML</strong> on any device capable of rendering
jtulach@77
   105
                    modern <strong>HTML5</strong> browser.
jtulach@77
   106
                </p>
jtulach@77
   107
                <p><a class="btn btn-primary btn-lg" role="button" 
jtulach@78
   108
                      target="_blank" href="http://html.java.net"
jtulach@78
   109
                >Visit Project Page!</a>
jtulach@77
   110
                </p>
jtulach@77
   111
            </div>
jtulach@77
   112
        </div>
jtulach@78
   113
jtulach@78
   114
    <div class="container" data-bind="visible: !fieldShowing()">
jaroslav@186
   115
      <div>
jtulach@78
   116
        <div class="col-md-4">
jtulach@78
   117
          <h2>Minesweeper</h2>
jtulach@78
   118
          <p>
jtulach@182
   119
              Discover ten square fields that contain a mine and
jtulach@182
   120
              mark them with a &#x26a0; sign.
jtulach@182
   121
              Touch a square to find out if there is
jtulach@182
   122
              a mine or not and
jtulach@182
   123
              how many mines are in the eight surrounding 
jtulach@182
   124
              ones. Avoid random play, the game 
jtulach@182
   125
              recognizes guessing and can re-arrange
jtulach@182
   126
              the mines. This game is <b>fair</b>!
jtulach@78
   127
          </p>
jtulach@78
   128
          <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play &raquo;</a></p>
jtulach@78
   129
        </div>
jtulach@78
   130
        <div class="col-md-4">
jtulach@78
   131
          <h2>Documentation</h2>
jtulach@78
   132
          <p>
jtulach@78
   133
              In case you want to write application like 
jtulach@78
   134
              this (e.g. use <strong>Java</strong> and <strong>HTML</strong>)
jtulach@78
   135
              you can learn more about the libraries that
jtulach@78
   136
              make that possible. Follow this link to
jtulach@78
   137
              our documentation.
jtulach@78
   138
          </p>
jtulach@78
   139
          <p><a class="btn btn-default"
jaroslav@135
   140
                target="_blank" href="http://bits.netbeans.org/html+java/"
jtulach@78
   141
                role="button">Read more &raquo;</a></p>
jtulach@78
   142
       </div>
jtulach@78
   143
        <div class="col-md-4">
jtulach@78
   144
          <h2>Run in a Browser</h2>
jtulach@78
   145
          <p>
jtulach@78
   146
              While primarily this technology runs on a desktop
jtulach@78
   147
              or as a table or phone application, it is possible
jtulach@78
   148
              to execute the same unchanged code in a browser 
jtulach@182
   149
              as well. To do so, one needs a 
jtulach@182
   150
              <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>
jtulach@78
   151
              virtual machine.
jtulach@78
   152
          </p>
jtulach@78
   153
          <p><a class="btn btn-default"
jtulach@182
   154
                target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
jtulach@182
   155
                role="button">Try it &raquo;</a></p>
jtulach@78
   156
       </div>
jtulach@93
   157
      </div>
jtulach@78
   158
    </div>
jaroslav@186
   159
<div class="container" data-bind="visible: !fieldShowing()">
jtulach@183
   160
  <div class="col-sm-6 col-md-4">
jtulach@183
   161
    <div class="thumbnail">
jtulach@183
   162
        <img src="android_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   163
      <div class="caption">
jtulach@183
   164
        <h3>DlvkBrwsr</h3>
jtulach@183
   165
        <p>
jtulach@183
   166
            This application has been packaged to run on your Android phone
jtulach@183
   167
            and is available on Google Play! In this mode it
jtulach@183
   168
            uses Dalvik virtual machine to execute Java code natively.
jtulach@183
   169
            It uses Android's WebView to display the UI and execute
jtulach@183
   170
            generated JavaScript. Both these components are
jtulach@183
   171
            bound together via <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
jtulach@183
   172
            DlvkBrwsr</a>.
jtulach@183
   173
        </p>
jtulach@183
   174
        <p>
jtulach@183
   175
            <a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
jtulach@183
   176
               target="_blank"
jtulach@183
   177
               class="btn btn-primary" role="button"
jtulach@183
   178
               >Install &raquo;</a> 
jtulach@183
   179
        </p>
jtulach@183
   180
      </div>
jtulach@183
   181
    </div>
jtulach@183
   182
  </div>
jtulach@183
   183
  <div class="col-sm-6 col-md-4">
jtulach@183
   184
    <div class="thumbnail">
jtulach@183
   185
        <img src="ios_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   186
      <div class="caption">
jtulach@183
   187
        <h3>iBrwsr</h3>
jtulach@183
   188
        <p>
jaroslav@202
   189
            This application has been packaged to run on your iPhone
jaroslav@202
   190
            or iPad and made available on AppStore.
jtulach@183
   191
            In this mode it
jtulach@183
   192
            uses <a target="_blank" href="http://www.robovm.org">RoboVM</a> 
jtulach@183
   193
            virtual machine to execute Java code natively.
jtulach@183
   194
            It uses iOS WebView to display the UI and execute
jtulach@183
   195
            generated JavaScript. Both these components are
jtulach@183
   196
            bound together via <a target="_blank" 
jaroslav@202
   197
            href="http://wiki.apidesign.org/wiki/IBrwsr">
jtulach@183
   198
            iBrwsr</a> library.
jtulach@183
   199
        </p>
jtulach@183
   200
        <p>
jaroslav@202
   201
            <a href="https://itunes.apple.com/us/app/fair-minesweeper/id903688146"
jtulach@183
   202
               target="_blank"
jtulach@183
   203
               class="btn btn-primary" role="button"
jaroslav@202
   204
               >Install &raquo;</a> 
jtulach@183
   205
        </p>
jtulach@183
   206
      </div>
jtulach@183
   207
    </div>
jtulach@183
   208
  </div>
jtulach@183
   209
  <div class="col-sm-6 col-md-4">
jtulach@183
   210
    <div class="thumbnail">
jtulach@183
   211
        <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   212
      <div class="caption">
jtulach@183
   213
        <h3>Develop Own App!</h3>
jtulach@183
   214
        <p>
jtulach@183
   215
            One can package this application as a 
jtulach@183
   216
            <a href="http://plugins.netbeans.org/plugin/53864/"
jtulach@183
   217
               target="_blank"
jtulach@183
   218
            >plugin for NetBeans</a> or
jtulach@183
   219
            use <a href="http://www.netbeans.org" target="_blank">
jtulach@183
   220
            NetBeans</a> IDE to create
jtulach@183
   221
            application like this yourself. Enjoy the
jtulach@183
   222
            power of <em>HTML</em> and <em>Java</em>.
jtulach@183
   223
            Write your applications once and deploy and display 
jtulach@183
   224
            them on any device!
jtulach@183
   225
        </p>
jtulach@183
   226
        <p>
jtulach@183
   227
            <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
jtulach@183
   228
               target="_blank"
jtulach@183
   229
               class="btn btn-primary" role="button"
jtulach@183
   230
               >Develop &raquo;</a> 
jtulach@183
   231
        </p>
jtulach@183
   232
      </div>
jtulach@183
   233
    </div>
jtulach@183
   234
  </div>
jtulach@183
   235
</div>
jtulach@94
   236
        <!-- boot bck2brwsr -->
jtulach@63
   237
        <script type="text/javascript" src="bck2brwsr.js"></script>
jtulach@63
   238
        <script>
jaroslav@223
   239
            if (!this.hasOwnProperty("main")) {
jaroslav@223
   240
                this.main = function() {
jaroslav@223
   241
                    var vm = bck2brwsr('minesweeper.js');
jaroslav@223
   242
                    var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
jaroslav@223
   243
                    c.invoke('main');
jaroslav@223
   244
                }
jaroslav@223
   245
            }
jaroslav@223
   246
            this.main();
jtulach@63
   247
        </script>
jtulach@89
   248
jtulach@63
   249
    </body>
jtulach@63
   250
</html>