minesweeper/src/main/webapp/pages/index.html
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 26 Jul 2014 11:15:18 +0200
changeset 183 77670cba08c3
parent 182 01951f6c119c
child 186 541d0898da47
permissions -rw-r--r--
Advertizing various deployment options
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">
jtulach@77
    97
                <h1>HTML/Java Technology Demo</h1>
jtulach@77
    98
jtulach@77
    99
                <p>At first sight this is an old good <em>minesweeper</em>
jtulach@77
   100
                    game. At closer look, this is a demo 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
jtulach@77
   103
                    <strong>HTML</strong> on any device capable of rendering
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()">
jtulach@78
   114
      <div class="row">
jtulach@78
   115
        <div class="col-md-4">
jtulach@78
   116
          <h2>Minesweeper</h2>
jtulach@78
   117
          <p>
jtulach@182
   118
              Discover ten square fields that contain a mine and
jtulach@182
   119
              mark them with a &#x26a0; 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>
jtulach@78
   129
        <div class="col-md-4">
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
jtulach@78
   136
              our 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@78
   142
        <div class="col-md-4">
jtulach@78
   143
          <h2>Run in a Browser</h2>
jtulach@78
   144
          <p>
jtulach@78
   145
              While primarily this technology runs on a desktop
jtulach@78
   146
              or as a table or phone application, it is possible
jtulach@78
   147
              to execute the same unchanged code in a browser 
jtulach@182
   148
              as well. To do so, one needs a 
jtulach@182
   149
              <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>
jtulach@78
   150
              virtual machine.
jtulach@78
   151
          </p>
jtulach@78
   152
          <p><a class="btn btn-default"
jtulach@182
   153
                target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
jtulach@182
   154
                role="button">Try it &raquo;</a></p>
jtulach@78
   155
       </div>
jtulach@93
   156
      </div>
jtulach@78
   157
    </div>
jtulach@183
   158
<div class="row" data-bind="visible: !fieldShowing()">
jtulach@183
   159
  <div class="col-sm-6 col-md-4">
jtulach@183
   160
    <div class="thumbnail">
jtulach@183
   161
        <img src="android_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   162
      <div class="caption">
jtulach@183
   163
        <h3>DlvkBrwsr</h3>
jtulach@183
   164
        <p>
jtulach@183
   165
            This application has been packaged to run on your Android phone
jtulach@183
   166
            and is available on Google Play! In this mode it
jtulach@183
   167
            uses Dalvik virtual machine to execute Java code natively.
jtulach@183
   168
            It uses Android's WebView to display the UI and execute
jtulach@183
   169
            generated JavaScript. Both these components are
jtulach@183
   170
            bound together via <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
jtulach@183
   171
            DlvkBrwsr</a>.
jtulach@183
   172
        </p>
jtulach@183
   173
        <p>
jtulach@183
   174
            <a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
jtulach@183
   175
               target="_blank"
jtulach@183
   176
               class="btn btn-primary" role="button"
jtulach@183
   177
               >Install &raquo;</a> 
jtulach@183
   178
        </p>
jtulach@183
   179
      </div>
jtulach@183
   180
    </div>
jtulach@183
   181
  </div>
jtulach@183
   182
  <div class="col-sm-6 col-md-4">
jtulach@183
   183
    <div class="thumbnail">
jtulach@183
   184
        <img src="ios_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   185
      <div class="caption">
jtulach@183
   186
        <h3>iBrwsr</h3>
jtulach@183
   187
        <p>
jtulach@183
   188
            This application can also be packaged to run on your iPhone
jtulach@183
   189
            or iPad. It is not yet available on AppStore, but it will.
jtulach@183
   190
            In this mode it
jtulach@183
   191
            uses <a target="_blank" href="http://www.robovm.org">RoboVM</a> 
jtulach@183
   192
            virtual machine to execute Java code natively.
jtulach@183
   193
            It uses iOS WebView to display the UI and execute
jtulach@183
   194
            generated JavaScript. Both these components are
jtulach@183
   195
            bound together via <a target="_blank" 
jtulach@183
   196
                href="http://wiki.apidesign.org/wiki/IBrwsr">
jtulach@183
   197
            iBrwsr</a> library.
jtulach@183
   198
        </p>
jtulach@183
   199
        <p>
jtulach@183
   200
            <a href="http://wiki.apidesign.org/wiki/IBrwsr"
jtulach@183
   201
               target="_blank"
jtulach@183
   202
               class="btn btn-primary" role="button"
jtulach@183
   203
               >Learn more &raquo;</a> 
jtulach@183
   204
        </p>
jtulach@183
   205
      </div>
jtulach@183
   206
    </div>
jtulach@183
   207
  </div>
jtulach@183
   208
  <div class="col-sm-6 col-md-4">
jtulach@183
   209
    <div class="thumbnail">
jtulach@183
   210
        <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
jtulach@183
   211
      <div class="caption">
jtulach@183
   212
        <h3>Develop Own App!</h3>
jtulach@183
   213
        <p>
jtulach@183
   214
            One can package this application as a 
jtulach@183
   215
            <a href="http://plugins.netbeans.org/plugin/53864/"
jtulach@183
   216
               target="_blank"
jtulach@183
   217
            >plugin for NetBeans</a> or
jtulach@183
   218
            use <a href="http://www.netbeans.org" target="_blank">
jtulach@183
   219
            NetBeans</a> IDE to create
jtulach@183
   220
            application like this yourself. Enjoy the
jtulach@183
   221
            power of <em>HTML</em> and <em>Java</em>.
jtulach@183
   222
            Write your applications once and deploy and display 
jtulach@183
   223
            them on any device!
jtulach@183
   224
        </p>
jtulach@183
   225
        <p>
jtulach@183
   226
            <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
jtulach@183
   227
               target="_blank"
jtulach@183
   228
               class="btn btn-primary" role="button"
jtulach@183
   229
               >Develop &raquo;</a> 
jtulach@183
   230
        </p>
jtulach@183
   231
      </div>
jtulach@183
   232
    </div>
jtulach@183
   233
  </div>
jtulach@183
   234
</div>
jtulach@94
   235
        <!-- boot bck2brwsr -->
jtulach@63
   236
        <script type="text/javascript" src="bck2brwsr.js"></script>
jtulach@63
   237
        <script>
jaroslav@160
   238
            var vm = bck2brwsr('minesweeper.js');
jaroslav@160
   239
            var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');
jaroslav@160
   240
            c.invoke('main');
jtulach@63
   241
        </script>
jtulach@89
   242
jtulach@63
   243
    </body>
jtulach@63
   244
</html>