-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.min.html
161 lines (146 loc) · 8.81 KB
/
index.min.html
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE html>
<html lang="en" ng-app="myApp" ng-strict-di manifest="index.min.appcache">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Dominoes</title>
<meta name="description" content="Dominoes game">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<!-- To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript. -->
<link rel="stylesheet" href="css/everything.min.css">
<link rel="stylesheet" type="text/css" href="http://yoav-zibin.github.io/emulator/main.css">
<!-- The crossorigin attribute controls, for scripts that are obtained from other origins, whether error information will be exposed. -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
<!-- For the game rules/instructions, I use carousel from Angular UI + Bootstrap -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular-touch.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.1/ui-bootstrap-tpls.min.js"></script>
<script src="http://yoav-zibin.github.io/emulator/dist/turnBasedServices.3.min.js"></script>
<script src="js/everything.min.js"></script>
</head>
<body ng-cloak>
<div style="position:absolute; bottom:5px; left: 5px; z-index:10;">
<span ng-click="game.isHelpModalShown = true"
class="glyphicon glyphicon-question-sign" aria-hidden="true"></span>
</div>
<div class="overlayModal" ng-class="{zeroOpacity: !game.isHelpModalShown, oneOpacity: game.isHelpModalShown}" aria-hidden="true">
<div class="modal-backdrop in"></div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" ng-click="game.isHelpModalShown = false" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">
{{ 'RULES_OF_TICTACTOE' | translate }}
</h4>
</div>
<div class="modal-body">
<carousel style="height: 150px">
<slide>
<div class="col-xs-12 col-sm-6 col-lg-8">
{{ 'RULES_SLIDE1' | translate }}
</div>
<div class="col-xs-6 col-lg-4">
<img src="imgs/HelpSlide1.png" class="helpImage">
</div>
</slide>
<slide>
<div class="col-xs-12 col-sm-6 col-lg-8">
{{ 'RULES_SLIDE2' | translate }}
</div>
<div class="col-xs-6 col-lg-4">
<img src="imgs/HelpSlide2.png" class="helpImage">
</div>
</slide>
<slide>
<div class="col-xs-12 col-sm-6 col-lg-8">
{{ 'RULES_SLIDE3' | translate }}
</div>
<div class="col-xs-6 col-lg-4">
<img src="imgs/HelpSlide3.png" class="helpImage">
</div>
</slide>
<slide>
<div class="col-xs-12 col-sm-6 col-lg-8">
{{ 'RULES_SLIDE4' | translate }}
</div>
<div class="col-xs-6 col-lg-4">
<img src="imgs/HelpSlide4.png" class="helpImage">
</div>
</slide>
<slide>
<div class="col-xs-12 col-sm-6 col-lg-8">
{{ 'RULES_SLIDE5' | translate }}
</div>
<div class="col-xs-6 col-lg-4">
<img src="imgs/HelpSlide5.png" class="helpImage">
</div>
</slide>
</carousel>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" ng-click="game.isHelpModalShown = false">
{{ 'CLOSE' | translate }}
</button>
</div>
</div>
</div>
</div>
<div id="gameArea">
<!-- First row: Area for other player's tiles -->
<div class="opponents">
<div class="opponent" ng-repeat="player in game.getOpponentIds(yourPlayerIndex)" style="width: {{100 / game.getNumberOfPlayers()}}%;height:100%">
<img ng-src="{{ game.getPlayerIconSource(player) }}" class="opponentIcon">
<h5 ng-if="hasGameEnded" class="scoreText">Score: {{ game.getFinalScore(player) }}</h5>
<img ng-repeat="tile in game.getNumberOfTilesForPlayer(player)" ng-src="{{ game.getTileImageSourceForPlayer(player, tile) }}" class="opponentTile">
</div>
</div>
<div class="game">
<div class="tree0" ng-click="game.placeTileOnTree(0)" ng-if="!hasGameEnded">
<!-- <img ng-src="{{ game.getImageSource(0, 0) }}" ng-if="game.shouldShowImage(0, 0)" ng-class="game.getImageClass(0, 0)"> -->
<img ng-src="{{ game.getImageSource(0, 0) }}" ng-if="game.shouldShowImage(0, 0)" ng-class="{rootTile: game.getImageClass(0, 0, 'rootTile'), enLar: game.shouldEnlarge(0, 0)}">
</div>
<div class="tree2" ng-click="game.placeTileOnTree(2)" ng-if="!hasGameEnded">
<!-- Max: 10 points. Horizontal tile is two points, vertical is one point -->
<img ng-repeat="tile in [6, 5, 4, 3, 2, 1]" ng-src="{{ game.getImageSource(tile, 2) }}"
ng-if="game.shouldShowImage(tile, 2)" ng-class="{horizontalTile: game.getImageClass(tile, 2, 'horizontalTile'), horizontalTileFlip: game.getImageClass(tile, 2, 'horizontalTileFlip'), enLar: game.shouldEnlarge(tile, 2)}">
</div>
<div class="tree3" ng-click="game.placeTileOnTree(3)" ng-if="!hasGameEnded">
<img ng-src="{{ game.getImageSource(7, 3) }}" ng-if="game.shouldShowImage(7, 3)" ng-class="{maxWidthHeightTile: game.getImageClass(7, 3, 'maxWidthHeightTile'), maxWidthHeightTileFlip: game.getImageClass(7, 3, 'maxWidthHeightTileFlip'), enLar: game.shouldEnlarge(7, 3)}">
</div>
<div class="tree4" ng-click="game.placeTileOnTree(4)" ng-if="!hasGameEnded">
<img ng-src="{{ game.getImageSource(8, 4) }}" ng-if="game.shouldShowImage(8, 4)" ng-class="{maxWidthHeightTile: game.getImageClass(8, 4, 'maxWidthHeightTile'), maxWidthHeightTileFlip: game.getImageClass(8, 4, 'maxWidthHeightTileFlip'), enLar: game.shouldEnlarge(8, 4)}">
</div>
<div class="tree5" ng-click="game.placeTileOnTree(5)" ng-if="!hasGameEnded">
<img ng-repeat="tile in [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22]" ng-src="{{ game.getImageSource(tile, 5) }}"
ng-if="game.shouldShowImage(tile, 5)" ng-class="{tree5Tile: game.getImageClass(tile, 5, 'tree5Tile'), tree5TileFlip: game.getImageClass(tile, 5, 'tree5TileFlip'), enLar: game.shouldEnlarge(tile, 5)}">
</div>
<div class="tree1" ng-click="game.placeTileOnTree(1)" ng-if="!hasGameEnded">
<img ng-repeat="tile in [1, 2, 3, 4, 5, 6, 7]" ng-src="{{ game.getImageSource(tile, 1) }}"
ng-if="game.shouldShowImage(tile, 1)" ng-class="{horizontalTile: game.getImageClass(tile, 1, 'horizontalTile'), horizontalTileFlip: game.getImageClass(tile, 1, 'horizontalTileFlip'), enLar: game.shouldEnlarge(tile, 1)}">
</div>
<div class="tree6" ng-click="game.placeTileOnTree(6)" ng-if="!hasGameEnded">
<img ng-src="{{ game.getImageSource(8, 6) }}" ng-if="game.shouldShowImage(8, 6)" ng-class="{maxWidthHeightTile: game.getImageClass(8, 6, 'maxWidthHeightTile'), maxWidthHeightTileFlip: game.getImageClass(8, 6, 'maxWidthHeightTileFlip'), enLar: game.shouldEnlarge(8, 6)}">
</div>
<div class="tree7" ng-click="game.placeTileOnTree(7)" ng-if="!hasGameEnded">
<img ng-repeat="tile in [22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9]" ng-src="{{ game.getImageSource(tile, 7) }}"
ng-if="game.shouldShowImage(tile, 7)" ng-class="{tree5Tile: game.getImageClass(tile, 7, 'tree5Tile'), tree5TileFlip: game.getImageClass(tile, 7, 'tree5TileFlip'), enLar: game.shouldEnlarge(tile, 7)}">
</div>
</div>
<!-- Third row: area for current player's tiles -->
<div class="currentPlayer">
<button id="passbtn" type="button" class="btn" ng-click="game.passPlay()" ng-if="game.isPassAllowed(yourPlayerIndex)">{{ 'PASS' | translate }}</button>
<img ng-src="{{ game.getPlayerIconSource(yourPlayerIndex) }}" class="currentPlayerIcon">
<h5 ng-if="hasGameEnded" class="scoreText">Score: {{ game.getFinalScore(yourPlayerIndex) }}</h5>
<img ng-repeat="tile in game.getNumberOfTilesForPlayer(yourPlayerIndex)"
ng-src="{{ game.getTileImageSourceForPlayer(yourPlayerIndex, tile) }}"
ng-click="game.registerSelectedPlayerTile(tile)"
ng-class="{currentPlayerTile: true, slowlyAppear: game.shouldSlowlyAppear(tile, yourPlayerIndex), selectedTile: game.isSelectedTile(tile, yourPlayerIndex)}">
</div>
<!-- Right Side: area for house tiles -->
<div class="boneyard" ng-if="!hasGameEnded">
<img ng-repeat="tile in game.getNumberOfTilesForBoneYard()" src="imgs/dominoes/domino-blank.svg"
class="tile" ng-click="game.makeBuyPlay(tile)">
</div>
</div>
</body>
</html>