minesweeper/src/main/webapp/pages/index.html
author Jaroslav Tulach <jtulach@netbeans.org>
Thu, 20 Mar 2014 11:25:28 +0100
changeset 116 4dce5ea7e13a
parent 94 9aab40420432
child 117 b5562abbf0f3
permissions -rw-r--r--
Merging teavm branch into default line, now when teavm 0.1 is out
     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></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) and (max-width:780px), (min-height:660px) and (max-height:830px)" 
    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:250px) and (max-width:410px), (min-height:250px) and (max-height:400px)" 
    47               rel="stylesheet" />
    48         <link href="mines-phone-smaller.css" 
    49               media="(max-width:250px), (max-height:250px)" 
    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">Minesweeper</a>
    56                 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
    57                     <span>&#x21bb;</span>
    58                     <span class="hidden-phone">New Game!</span>
    59                 </button>
    60                 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !fieldShowing(), click: giveUp ">
    61                     <span>&#x2717;</span>
    62                     <span class="hidden-phone">Show Mines!</span>
    63                 </button>
    64             </div>
    65         </div>
    66         
    67 
    68         <script type="text/html" id="field">
    69             <table class="field">
    70                 <tbody>
    71                     <!-- ko foreach: rows -->
    72                     <tr>
    73                         <!-- ko foreach: columns -->
    74                         <td data-bind="css: style, click: $parents[1].click" >
    75                             <div data-bind='html: html'></div>
    76                         </td>
    77                         <!-- /ko -->
    78                     </tr>
    79                     <!-- /ko -->
    80                 </tbody>
    81             </table>
    82         </script>
    83 
    84         <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
    85         
    86         <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
    87             <div class="container">
    88                 <h1>HTML/Java Technology Demo</h1>
    89 
    90                 <p>At first sight this is an old good <em>minesweeper</em>
    91                     game. At closer look, this is a demo of a revolutionary 
    92                     technology that allows you to use <strong>Java</strong>
    93                     to code your application logic and present it using
    94                     <strong>HTML</strong> on any device capable of rendering
    95                     modern <strong>HTML5</strong> browser.
    96                 </p>
    97                 <p><a class="btn btn-primary btn-lg" role="button" 
    98                       target="_blank" href="http://html.java.net"
    99                 >Visit Project Page!</a>
   100                 </p>
   101             </div>
   102         </div>
   103 
   104     <div class="container" data-bind="visible: !fieldShowing()">
   105       <div class="row">
   106         <div class="col-md-4">
   107           <h2>Minesweeper</h2>
   108           <p>
   109               At the end this is a <em>minesweeper</em>
   110               game and you can of course play it. Discover
   111               all fields that don't contain a mine. 
   112               Touch a field to find out if there is
   113               a mine or not. A number on a field indicates
   114               how many mines is in the eight surrounding 
   115               fields.
   116           </p>
   117           <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play &raquo;</a></p>
   118         </div>
   119         <div class="col-md-4">
   120           <h2>Documentation</h2>
   121           <p>
   122               In case you want to write application like 
   123               this (e.g. use <strong>Java</strong> and <strong>HTML</strong>)
   124               you can learn more about the libraries that
   125               make that possible. Follow this link to
   126               our documentation.
   127           </p>
   128           <p><a class="btn btn-default"
   129                 target="_blank" href="http://bits.netbeans.org/html4j/0.7.5/"
   130                 role="button">Read more &raquo;</a></p>
   131        </div>
   132         <div class="col-md-4">
   133           <h2>Run in a Browser</h2>
   134           <p>
   135               While primarily this technology runs on a desktop
   136               or as a table or phone application, it is possible
   137               to execute the same unchanged code in a browser 
   138               as well. To do so, one needs a <strong>bck2brwsr</strong>
   139               virtual machine.
   140           </p>
   141           <p><a class="btn btn-default"
   142                 target="_blank" href="http://bck2brwsr.apidesign.org"
   143                 role="button">Learn more &raquo;</a></p>
   144        </div>
   145       </div>
   146     </div>
   147 
   148         <!-- boot bck2brwsr -->
   149         <script type="text/javascript" src="bck2brwsr.js"></script>
   150         <script>
   151             var vm = bck2brwsr('${project.build.finalName}.jar');
   152             vm.loadClass('org.apidesign.demo.minesweeper.MainBrwsr');
   153         </script>
   154     </body>
   155 </html>