Indicate the mine selection mode by blinking the danger sign on all undiscovered squares
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>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)"
38 <link href="mines-tablet-small.css"
39 media="(min-width:510px) and (max-width:640px), (min-height:520px) and (max-height:660px)"
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)"
45 <link href="mines-phone-small.css"
46 media="(min-width:250px) and (max-width:410px), (min-height:250px) and (max-height:400px)"
48 <link href="mines-phone-smaller.css"
49 media="(max-width:250px), (max-height:250px)"
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">
58 <span class="hidden-phone">New Game!</span>
60 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !fieldShowing(), click: giveUp ">
62 <span class="hidden-phone">Show Mines!</span>
64 <button class="btn btn-default navbar-btn" disabled="true" data-bind="disable: !fieldShowing(), click: markMine">
66 <span class="hidden-phone">Mark Mine!</span>
72 <script type="text/html" id="field">
74 <table class="field" data-bind="css: gameStyle">
76 <!-- ko foreach: rows -->
78 <!-- ko foreach: columns -->
79 <td data-bind="css: style, click: $parents[1].click" >
90 <div data-bind="template: { name : 'field', if: fieldShowing }"></div>
92 <div class="jumbotron control-label" data-bind="visible: !fieldShowing() ">
93 <div class="container">
94 <h1>HTML/Java Technology Demo</h1>
96 <p>At first sight this is an old good <em>minesweeper</em>
97 game. At closer look, this is a demo of a revolutionary
98 technology that allows you to use <strong>Java</strong>
99 to code your application logic and present it using
100 <strong>HTML</strong> on any device capable of rendering
101 modern <strong>HTML5</strong> browser.
103 <p><a class="btn btn-primary btn-lg" role="button"
104 target="_blank" href="http://html.java.net"
105 >Visit Project Page!</a>
110 <div class="container" data-bind="visible: !fieldShowing()">
112 <div class="col-md-4">
115 At the end this is a <em>minesweeper</em>
116 game and you can of course play it. Discover
117 all fields that don't contain a mine.
118 Touch a field to find out if there is
119 a mine or not. A number on a field indicates
120 how many mines is in the eight surrounding
123 <p><a class="btn btn-default" href="#" data-bind="click: normalGame"role="button">Play »</a></p>
125 <div class="col-md-4">
126 <h2>Documentation</h2>
128 In case you want to write application like
129 this (e.g. use <strong>Java</strong> and <strong>HTML</strong>)
130 you can learn more about the libraries that
131 make that possible. Follow this link to
134 <p><a class="btn btn-default"
135 target="_blank" href="http://bits.netbeans.org/html+java/"
136 role="button">Read more »</a></p>
138 <div class="col-md-4">
139 <h2>Run in a Browser</h2>
141 While primarily this technology runs on a desktop
142 or as a table or phone application, it is possible
143 to execute the same unchanged code in a browser
144 as well. To do so, one needs a <strong>bck2brwsr</strong>
147 <p><a class="btn btn-default"
148 target="_blank" href="http://bck2brwsr.apidesign.org"
149 role="button">Learn more »</a></p>
154 <!-- boot bck2brwsr -->
155 <script type="text/javascript" src="bck2brwsr.js"></script>
157 var vm = bck2brwsr('minesweeper.js');
158 var c = vm.loadClass('org.apidesign.demo.minesweeper.MinesModel');