According to Hrebejk defining viewport prevents scaling and speeds up reaction to touches
5 Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
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:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
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
29 <title>Fair Minesweeper</title>
30 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
31 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
32 <link href="bootstrap.css" rel="stylesheet">
33 <link href="bootstrap-responsive.css" rel="stylesheet">
34 <link href="mines.css" rel="stylesheet">
35 <!-- Target tablets -->
36 <link href="mines-tablet-large.css"
37 media="(min-width:640px), (min-height:660px)"
39 <link href="mines-tablet-small.css"
40 media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)"
42 <!-- Target phones -->
43 <link href="mines-phone-large.css"
44 media="(min-width:410px) and (max-width:510px), (min-height:400px) and (max-height:520px)"
46 <link href="mines-phone-small.css"
47 media="(min-width:300px) and (max-width:410px), (min-height:300px) and (max-height:400px)"
49 <link href="mines-phone-smaller.css"
50 media="(max-width:300px), (max-height:300px)"
55 <div class="navbar-inner">
56 <a id="apptitle" class="brand" href="#" data-bind="click: showHelp">
57 <img height="20" width="20" src="DukeSweeper.png">
58 <span class="hidden-phone">Minesweeper</span>
60 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: false, click: normalGame">
62 <span class="info-text">New!</span>
64 <button class="hidden-phone btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: giveUp ">
66 <span>Show Mines!</span>
68 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !gameInProgress(), click: markMine">
70 <span class="info-text">Mark Mine!</span>
76 <script type="text/html" id="field">
78 <table class="field" data-bind="css: gameStyle">
80 <!-- ko foreach: rows -->
82 <!-- ko foreach: columns -->
83 <td data-bind="css: style, click: $parents[1].click" >
94 <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
96 <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
97 <div class="container">
98 <h1>HTML/Java Technology Demo</h1>
100 <p>At first sight this is an old good <em>minesweeper</em>
101 game. At closer look, this is a demo of a revolutionary
102 technology that allows you to use <strong>Java</strong>
103 to code your application logic and present it using
104 <strong>HTML</strong> on any device capable of rendering
105 modern <strong>HTML5</strong> browser.
107 <p><a class="btn btn-primary btn-lg" role="button"
108 target="_blank" href="http://html.java.net"
109 >Visit Project Page!</a>
114 <div class="container" data-bind="visible: !fieldShowing()">
116 <div class="col-md-4">
119 Discover ten square fields that contain a mine and
120 mark them with a ⚠ sign.
121 Touch a square to find out if there is
123 how many mines are in the eight surrounding
124 ones. Avoid random play, the game
125 recognizes guessing and can re-arrange
126 the mines. This game is <b>fair</b>!
128 <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play »</a></p>
130 <div class="col-md-4">
131 <h2>Documentation</h2>
133 In case you want to write application like
134 this (e.g. use <strong>Java</strong> and <strong>HTML</strong>)
135 you can learn more about the libraries that
136 make that possible. Follow this link to
139 <p><a class="btn btn-default"
140 target="_blank" href="http://bits.netbeans.org/html+java/"
141 role="button">Read more »</a></p>
143 <div class="col-md-4">
144 <h2>Run in a Browser</h2>
146 While primarily this technology runs on a desktop
147 or as a table or phone application, it is possible
148 to execute the same unchanged code in a browser
149 as well. To do so, one needs a
150 <a href="http://bck2brwsr.apidesign.org">bck2brwsr</a>
153 <p><a class="btn btn-default"
154 target="_blank" href="http://xelfi.cz/minesweeper/bck2brwsr/"
155 role="button">Try it »</a></p>
159 <div class="container" data-bind="visible: !fieldShowing()">
160 <div class="col-sm-6 col-md-4">
161 <div class="thumbnail">
162 <img src="android_logo.jpg" width="120" height="120" alt="Android">
163 <div class="caption">
166 This application has been packaged to run on your Android phone
167 and is available on Google Play! In this mode it
168 uses Dalvik virtual machine to execute Java code natively.
169 It uses Android's WebView to display the UI and execute
170 generated JavaScript. Both these components are
171 bound together via <a href="http://wiki.apidesign.org/wiki/DlvkBrwsr">
175 <a href="https://play.google.com/store/apps/details?id=org.apidesign.demo.minesweeper"
177 class="btn btn-primary" role="button"
183 <div class="col-sm-6 col-md-4">
184 <div class="thumbnail">
185 <img src="ios_logo.jpg" width="120" height="120" alt="Android">
186 <div class="caption">
189 This application has been packaged to run on your iPhone
190 or iPad and made available on AppStore.
192 uses <a target="_blank" href="http://www.robovm.org">RoboVM</a>
193 virtual machine to execute Java code natively.
194 It uses iOS WebView to display the UI and execute
195 generated JavaScript. Both these components are
196 bound together via <a target="_blank"
197 href="http://wiki.apidesign.org/wiki/IBrwsr">
201 <a href="https://itunes.apple.com/us/app/fair-minesweeper/id903688146"
203 class="btn btn-primary" role="button"
209 <div class="col-sm-6 col-md-4">
210 <div class="thumbnail">
211 <img src="netbeans_logo.jpg" width="120" height="120" alt="Android">
212 <div class="caption">
213 <h3>Develop Own App!</h3>
215 One can package this application as a
216 <a href="http://plugins.netbeans.org/plugin/53864/"
218 >plugin for NetBeans</a> or
219 use <a href="http://www.netbeans.org" target="_blank">
220 NetBeans</a> IDE to create
221 application like this yourself. Enjoy the
222 power of <em>HTML</em> and <em>Java</em>.
223 Write your applications once and deploy and display
227 <a href="http://wiki.apidesign.org/wiki/DukeScriptInNetBeans"
229 class="btn btn-primary" role="button"
236 <!-- boot bck2brwsr -->
237 <script type="text/javascript" src="bck2brwsr.js"></script>
239 if (!this.hasOwnProperty("main")) {
240 this.main = function() {
241 var vm = bck2brwsr('minesweeper.js');
242 var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');