-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpuzzle.html
More file actions
38 lines (37 loc) · 1.55 KB
/
Copy pathpuzzle.html
File metadata and controls
38 lines (37 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html ng-app="puzzleApp">
<head>
<title>AngularJS puzzle</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="lib/angular.js"></script>
<script type="text/javascript" src="js/puzzle/puzzle.js"></script>
<script type="text/javascript" src="js/puzzle/app.js"></script>
<link rel="stylesheet" type="text/css" href="css/puzzle.css"/>
</head>
<body>
<fieldset id="simple">
<legend>Basic</legend>
<puzzle class="puzzle" size="3x3" src="img/angular.png"></puzzle>
</fieldset><br/>
<fieldset id="advanced" ng-controller="advancedCtrl">
<legend>Advanced</legend>
<div ng-repeat="puzzle in puzzles">
<h2>{{puzzle.title}}</h2>
<div class="src">
<input type="text" ng-model="puzzle.src"/>
</div>
<div class="status">
moves: <strong>{{puzzle.ctrl.moves}}</strong><br/>
solved: <strong>{{puzzle.ctrl.isSolved()}}</strong>
</div>
<div class="size">
rows: <input type="text" ng-model="puzzle.rows" size="2"/>
cols: <input type="text" ng-model="puzzle.cols" size="2"/><br/>
<button ng-click="puzzle.ctrl.shuffle()">shuffle</button>
<button ng-click="puzzle.ctrl.solve()">solve</button>
</div>
<puzzle class="puzzle" ctrl="puzzle.ctrl" size="{{puzzle.rows}}x{{puzzle.cols}}" src="{{puzzle.src}}"></puzzle>
</div>
</fieldset>
</body>
</html>