-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
208 lines (197 loc) · 6.21 KB
/
index.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<html lang="en" ng-app="myApp">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.4/angular-material.min.css">
<link rel="stylesheet" href="font/font-awesome/css/font-awesome.min.css">
<meta name="viewport" content="initial-scale=1" />
<style type="text/css">
.room{
width:50px;
height:50px;
}
.non-side{
}
.hor{
margin: 4px 0px 4px 0px;
}
.horLeft{
margin-bottom: 4px;
}
.vert{
margin-left:4px;
}
.side{
position: relative;
border-radius: 2px;
box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
background-color: #2ecc71;
color: #ecf0f1;
}
#progress{
height:10%;
margin:8px;
padding:8px;
}
:focus {
outline: none;
border: 0;
}
a{
text-decoration: none;
}
#square{
padding: 8px;
margin-left: auto;
margin-right: auto;
width:60%;
height:60vw;
}
.aniBackground{
-webkit-transition: background-color .2s ease-in;
-moz-transition: background-color .2s ease-in;
-ms-transition: background-color .2s ease-in;
-o-transition: background-color .2s ease-in;
transition: background-color .2s ease-in;
}
@media (max-width:600px){
.hidemobile{
display: none;
}
#square{
width:96%;
height:96%;
}
.aniBackground{
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
md-grid-tile{
font-size: 10px;
}
.side{
box-shadow: 0 1px 0px rgba(0, 0, 0, .6);
}
.hor{
margin: 1px 0px 1px 0px;
}
.horLeft{
margin-bottom: 1px;
}
.vert{
margin-left:1px;
}
}
@media (min-width:1200px){
#square{
width:800px;
height:800px;
}
}
md-divider{
margin-left: 16px;
margin-right: 16px;
}
md-grid-tile i{
color:#FFF;
}
#pair{
position: fixed;
bottom: 40px;
right: 40px;
-webkit-transition: opacity .2s ease-in;
-moz-transition: opacity .2s ease-in;
-ms-transition: opacity .2s ease-in;
-o-transition: opacity .2s ease-in;
transition: opacity .2s ease-in;
}
md-bottom-sheet{
position:fixed;
bottom:0;
}
</style>
</head>
<body ng-controller="appController" class="aniBackground">
<md-toolbar>
<div class="md-toolbar-tools">
<span>Dots and Boxes</span>
<!-- fill up the space between left and right area -->
<span flex></span>
<md-button>
Joep Schyns
</md-button>
</div>
</md-toolbar>
<div layout="column" id="content" class="aniBackground">
<div layout="row" layout-sm="column">
<md-card id="input">
<md-card-content flex="fill">
<md-input-container>
<label>Size of sides</label>
<input ng-model="board.sides" ng-change="updateField()" type="integer">
</md-input-container>
<md-input-container>
<label>Amount of players</label>
<input ng-model="board.players" ng-change="updateField()" type="integer">
</md-input-container>
<md-grid-list
md-cols="2" md-cols-sm="7" md-row-height="1:1"
md-gutter="6px">
<md-grid-tile id="player{{n.id}}" style="background-color:{{getPlayerColor(n.id)}};"ng-repeat="n in players">
<i class="fa fa-user"></i>
<md-grid-tile-footer class="hidemobile">
<h3>Player {{n.id}} <br> wins: {{n.rooms}}</h3 ng-model="n.rooms">
</md-grid-tile-footer>
</md-grid-tile>
</md-grid-list>
</md-card-content>
<md-divider ></md-divider>
<div id="progress" layout-align="center start" layout="column">
<div ><b>Progress:</b></div><div ng-model="espectedTime">{{espectedTime}}</div>
<div layout-align="center center" layout="row" style="width:100%">
<md-progress-linear flex="80" md-mode="determinate" value="{{progress}}"></md-progress-linear>
<div flex="20"><div layout="row" layout-align="center center">{{progress | number:0}}%</div></div>
</div>
</div>
</md-card>
<md-card id="square">
<div layout="row" flex="100">
<div layout="column" style="width:{{(100 / board.sides) * .2| number:0}}%; height:100%">
<div flex="{{(100 / board.sides)}}" ng-repeat="m in range(1,board.sides)" class="side horLeft aniBackground" resize md-ink-ripple ng-click="clickSide()" id="0{{m - 1}}left">
</div>
</div>
<div layout="column" flex="{{100 - (100 / board.sides) * .2 | number:0}}">
<div flex="{{100 - (100 / board.sides) * .2 | number:0}}" layout="column">
<div layout="row" ng-repeat="n in range(1,board.sides)" flex="{{100 / board.sides}}" >
<div layout="column" flex="{{100 / board.sides}}" ng-repeat="m in range(1,board.sides)" resize style="height:{{((100 - (20 / board.sides)) / board.sides) | number:0}}%;" class="middle">
<div flex="20" class="side vert aniBackground" ng-click="clickSide()" id="{{m - 1}}{{n - 1}}top" md-ink-ripple ></div>
<div flex="80" layout="row" >
<div flex="80" class="aniBackground" id="middle{{m - 1}}{{n - 1}}">
</div>
<div flex="20" class="side hor aniBackground" md-ink-ripple ng-click="clickSide()" id="{{m - 1}}{{n - 1}}right"></div>
</div>
</div>
</div>
</div>
<div layout="row" flex="{{(100 / board.sides) * .2 | number:0}}" style="height:100%">
<div flex="{{100 / board.sides}}" ng-repeat="m in range(1,board.sides)" class="side vert aniBackground" resize md-ink-ripple ng-click="clickSide()" id="{{m - 1}}{{board.sides - 1}}bottom">
</div>
</div>
</div>
</div>
</md-card>
</div>
<md-button id="pair" class="md-fab" ng-click="showGridBottomSheet($event)">
<md-icon md-svg-src="img/screenshare.svg" class="screenshare"></md-icon>
</md-button>
</div>
<!-- Angular Material Dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/0.9.4/angular-material.min.js"></script>
<script type="text/javascript" src="js/controller.js"></script>
</body>
</html>