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