-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
275 lines (274 loc) · 12.2 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html lang="en" ng-app="PathOfDamage">
<head>
<meta charset="UTF-8">
<title>Path of Damage</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="libs/lz-string.min.js"></script>
<script src="js/app.js"></script>
<script src="js/DataService.js"></script>
<script src="js/Modifiers.js"></script>
<script src="js/selectAllOnClick.js"></script>
<script src="libs/ui-select/select.js"></script>
<link rel="stylesheet" href="libs/ui-select/select.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/input.css">
<link rel="stylesheet" href="css/damageTable.css">
<link rel="stylesheet" href="css/select.css">
<link rel="shortcut icon" type="image/x-icon" href="icon/favicon2.ico"/>
</head>
<body ng-controller="Damage">
<div class="background">
<div class="header">
<div class="titleContainer">
<div class="title">Path of Damage</div>
<div>The Path of Exile physical hit damage mitigation calculator</div>
</div>
<div class="clearButtonContainer">
<button class="button clearButton" ng-click="clear()">Clear Form</button>
</div>
</div>
<div class="inputSection">
<div class="quickAddContainer">
<ui-select id="quickAdd" class="input" ng-model="selected.modifier" ng-change="focusAddButton()">
<ui-select-match placeholder="Quick Add...">
<span ng-bind="$select.selected.name"></span>
</ui-select-match>
<ui-select-choices repeat="modifier in (modifiers | filter: $select.search) track by modifier.id">
<span ng-bind="modifier.name"></span>
</ui-select-choices>
</ui-select>
<div class="addButtonContainer">
<button id="addButton" class="button addButton" ng-click="quickAdd()">Add</button>
</div>
</div>
<hr class="borderLine">
<div class="section" ng-repeat="section in [mitigation, taken, shift, monster]">
<h4>{{section.name}}<br>
<small><i>{{section.description}}</i></small>
</h4>
<div class="inputContainer" ng-if="section.armor !== undefined || section.charges !== undefined">
<label>Armor:
<input class="input number noIncrement"
type="number"
min="0"
ng-model="section.armor"
id="armor"
ng-change="updateDamageValues()"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
<label>Endurance Charges:
<input class="input number"
type="number"
min="0"
ng-model="section.charges"
id="charges"
ng-change="updateDamageValues()"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
</div>
<div class="tableContainer" ng-repeat="(tableName, table) in section.tables">
<div class="tableTitle">{{table.name}}</div>
<table class="table table-condensed">
<tr ng-repeat="row in table.rows track by $index">
<td>
<label class="checkboxContainer">
<input type="checkbox" class="checkbox " ng-model="row.enabled" ng-change="updateTotal(table)">
</label>
</td>
<td class="name">
<input class="input"
placeholder="Source Name"
spellcheck="false"
ng-model="row.name"
ng-change="add(table)">
</td>
<td class="percent">
<div class="inputGroup">
<input class="input number noIncrement"
type="number"
placeholder="+/-"
ng-model="row.value"
ng-change="add(table)"
ng-attr-id="{{tableName}}"
ng-model-options="{debounce: 200}"
select-all-on-click>
<div ng-if="tableName !== 'flat'" class="inputGroupAddon">%</div>
<div ng-if="tableName == 'flat'"
class="inputGroupAddon flat"
ng-click="inverse(table, $index)"
unselectable="on"
onselectstart="return false;"
onmousedown="return false;">
+/-
</div>
</div>
</td>
<td ng-if="tableName==='shifts'">
<table class="radio elementSelector">
<tr>
<td><label class="select fire" ng-class="{selected: row.elements.fire}" title="Fire">
<input type="radio" name="shift" value="fire" ng-model="row.elements.model"
ng-change="setElement(table, row, 'fire')"></label></td>
<td><label class="select cold" ng-class="{selected: row.elements.cold}" title="Cold">
<input type="radio" name="shift" value="cold" ng-model="row.elements.model"
ng-change="setElement(table, row, 'cold')"></label></td>
</tr>
<tr>
<td><label class="select lightning" ng-class="{selected: row.elements.lightning}" title="Lightning">
<input type="radio" name="shift" value="lightning" ng-model="row.elements.model"
ng-change="setElement(table, row, 'lightning')"></label></td>
<td><label class="select chaos" ng-class="{selected: row.elements.chaos}" title="Chaos">
<input type="radio" name="shift" value="chaos" ng-model="row.elements.model"
ng-change="setElement(table, row, 'chaos')"></label></td>
</tr>
</table>
</td>
<td ng-if="section.name==='Damage Taken' || tableName==='mana'">
<table class="multi elementSelector">
<tr>
<td><label class="select physical" ng-class="{selected: row.elements.physical}" title="Physical">
<input type="checkbox" ng-model="row.elements.physical" ng-change="updateTotal(table)"></label></td>
<td><label class="select fire" ng-class="{selected: row.elements.fire}" title="Fire">
<input type="checkbox" ng-model="row.elements.fire" ng-change="updateTotal(table)"></label></td>
<td><label class="select cold" ng-class="{selected: row.elements.cold}" title="Cold">
<input type="checkbox" ng-model="row.elements.cold" ng-change="updateTotal(table)"></label></td>
</tr>
<tr>
<td><label class="select selectAll" ng-class="{allSelected: allSelected(row)}"
title="{{allSelected(row) ? 'Deselect All' : 'Select All'}}">
<input type="checkbox" ng-click="selectAll(table, row)"></label></td>
<td><label class="select lightning" ng-class="{selected: row.elements.lightning}" title="Lightning">
<input type="checkbox" ng-model="row.elements.lightning" ng-change="updateTotal(table)"></label>
</td>
<td><label class="select chaos" ng-class="{selected: row.elements.chaos}" title="Chaos">
<input type="checkbox" ng-model="row.elements.chaos" ng-change="updateTotal(table)"></label></td>
</tr>
</table>
</td>
<td>
<div class="buttonContainer">
<button ng-if="!$last" class="button deleteButton"
ng-click="delete(table, $index)" title="Delete">
</button>
</div>
</td>
</tr>
</table>
<div class="total" ng-if="table.rows.length > 1 && !table.defaultElements">
<div class="subTotal" ng-if="total != 0" ng-repeat="(totalName, total) in table.totals">
{{capitalize(totalName)}}: <b>{{round(total)}}%</b>
</div>
</div>
<div class="element total" ng-if="table.rows.length > 1 && table.defaultElements">
<div class="subTotal {{totalName}}"
ng-if="total != 0 && totalName != 'total'"
ng-repeat="(totalName, total) in table.totals">
<b>{{round(total)}}{{tableName !== 'flat' ? '%' : ''}}</b>
</div>
<div class="subTotal {{totalName}}"
ng-if="total != 0 && totalName == 'total'"
ng-repeat="(totalName, total) in table.totals">
<b>Total: {{round(total)}}{{tableName !== 'flat' ? '%' : ''}}</b>
</div>
</div>
</div>
<hr class="borderLine">
</div>
</div>
</div>
<div class="damageTable" id="damageTable" ng-class="{fixed: fixedTable}">
<table class="table table-bordered table-striped">
<tr>
<th>Physical Hit</th>
<th>Damage Taken</th>
</tr>
<tr ng-repeat="hit in hits track by $index">
<td class="damageInput">
<input class="input number noIncrement"
type="number"
ng-model="hits[$index].hit"
ng-change="updateHitRow($index)"
ng-blur="deleteEmptyRow($index)"
ng-model-options="{debounce: 200}"
select-all-on-click>
</td>
<td class="damageOutput"><span class="taken">{{hit.totalTaken}}</span>
<div class="healthBarContainer">
<div class="health bar" ng-style="getBarWidth(hit.healthRemaining)"></div>
<div class="es bar" ng-style="getBarWidth(hit.esRemaining)"></div>
<div class="physical bar" ng-style="getBarWidth(hit.totalTaken)"></div>
</div>
<div class="tooltip">
Phys Damage Taken: {{hit.physTaken}} <br/>
<span ng-if="hit.eleTaken">Ele Damage Taken: {{hit.eleTaken}} <br/></span>
<span ng-if="hit.manaTaken">Mana Damage Taken: {{hit.manaTaken}} <br/></span>
Damage Mitigated: {{hit.mitigated}} <br/>
<span ng-if="mitigation.es">ES Remaining: {{hit.esRemaining}} <br/></span>
Health Remaining: {{hit.healthRemaining}}
</div>
</td>
</tr>
</table>
<div class="maxHit">Maximum survivable hit: {{maxSurvivableHit}}</div>
<div class="resistanceHeader">Resistances:</div>
<div class="resistanceContainer">
<label ng-repeat="(name, value) in mitigation.resistance"
class="label resistance {{name}}" title="{{capitalize(name)}} resistance">
<input class="input number noIncrement"
type="number"
max="100"
ng-model="mitigation.resistance[name]"
ng-change="updateDamageValues()"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
</div>
<div class="healthPoolContainer">
<label class="label health">Health:
<input class="input number noIncrement pool"
type="number"
min="0"
ng-model="mitigation.health"
ng-change="updateDamageValues()"
ng-required="true"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
<label class="label es">ES:
<input class="input number noIncrement pool"
type="number"
min="0"
ng-model="mitigation.es"
ng-change="updateDamageValues()"
ng-required="true"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
</div>
<label class="label">Unreserved Mana:
<input class="input number noIncrement pool"
type="number"
min="0"
ng-model="mitigation.mana"
ng-change="updateDamageValues()"
ng-model-options="{debounce: 200}"
select-all-on-click>
</label>
<label class="label">Chaos Blocked by ES:
<input class="input number noIncrement pool"
type="checkbox"
ng-model="mitigation.chaosBlocked"
ng-change="updateDamageValues()">
</label>
<label class="label">Chaos Immune:
<input class="input number noIncrement pool"
type="checkbox"
ng-model="mitigation.chaosImmune"
ng-change="updateDamageValues()">
</label>
</div>
</body>
</html>