-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
175 lines (147 loc) · 5.12 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
<!DOCTYPE html>
<html ng-app="monsterBuilder" ng-controller="monsterController">
<head>
<title>Angular Demo</title>
<!-- <title>5e Monster Builder</title> -->
<link rel="stylesheet" href="css/styles.css">
<!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script> -->
<script src="js/angular.min.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div id="results" class="untabbed-block">
<article class="monster-block">
<header>
<h2><span ng-if="!monster.name">Monster Name</span>{{monster.name}}</h2>
<p>{{monster.size.id}} {{monster.type}}<span ng-if="monster.tags">
({{monster.tags}})</span>, <span ng-bind="monster.alignment"></span></p>
</header>
<hr>
<b>Armor Class:</b><br>
<b>Hit Points:</b>
<output ng-bind="monster.hp"></output>
(<output ng-bind="monster.hd">
</output>d<output ng-bind="monster.size.hd">
</output><span ng-if="monster.abilities[2].mod">+<output
ng-bind="monster.abilities[2].mod * monster.hd"></output></span>)<br>
<b>Speed:</b> <ul class="inline">
<li ng-repeat="movement in monster.movement"
ng-if="movement.speed > 0">
<span ng-bind="movement.id"></span>
<output ng-bind="movement.speed"></output> ft<span class="list-separator">,</span></li>
</ul>
<hr>
<ul class="horizontal">
<li ng-repeat="ability in monster.abilities">
<h4 ng-bind="ability.id"></h4>
<output ng-bind="ability.score"></output>
(<span ng-if="ability.mod >= 0">+</span><output
ng-bind="ability.mod"></output>)
</li>
</ul>
<hr>
<h3>Actions</h3>
<ul>
<li ng-repeat="attack in monster.attacks"
ng-include="'attack-result.html'">
</li>
</ul>
</article>
</div>
<nav class="tabs">
<ul class="horizontal">
<li><a href="" ng-click="goToTab('stats')">Stats</a></li>
<li><a href="" ng-click="goToTab('features')">Features</a></li>
<li><a href="" ng-click="goToTab('attacks')">Attacks</a></li>
</ul>
</nav>
<div class="tab-content">
<section id="stats" ng-show="builder.tab=='stats'">
<h2>Stats</h2>
<form class="builder-block">
<!-- TODO: a thought: maybe each of these sections should be a fieldset actually -->
<fieldset id="info">
<legend>Info</legend>
<label>Name: <input type="text"
ng-model="monster.name" required></label><br>
<label><input type="checkbox"
ng-model="monster.nameIsProper"> Proper name</label>
<br>
<label>Size: <select
ng-model="monster.size"
ng-options="size as size.id for size in SIZES">
</select><!-- <select
ng-model="monster.size"
ng-options="size for (size, properties) in SIZES">
</select> --></label>
<label>Type: <select
ng-model="monster.type"
ng-options="type for type in TYPES">
</select></label><br>
<label>Tags: <input list="monster-tags"
ng-model="monster.tags">
<datalist id="monster-tags">
<option ng-repeat="tag in TAGS">{{tag}}</option>
</datalist>
</label><br>
<label>Alignment: <select
ng-model="monster.alignment"
ng-options="alignment for alignment in ALIGNMENTS">
</select>
</label>
</fieldset>
<fieldset id="abilities">
<legend>Abilities</legend>
<ul class="two-columns">
<!-- <div ng-repeat="(index, ability) in abilities"> -->
<li ng-repeat="ability in monster.abilities">
<label>{{ability.id}}
<input type="number" min="1" max="30"
ng-model="ability.score"></label>
<span ng-show="ability.mod > 0">+</span><output>{{ability.mod}}
</output>
</li>
</ul>
</fieldset>
<fieldset id="speed">
<legend>Speed</legend>
<ul>
<li ng-repeat="movement in monster.movement">
<label><span ng-bind="movement.id"></span> speed:
<input type="number" min="0" max="9999" step="10"
ng-model="movement.speed"> ft</label><br></li>
</ul>
<small>Speeds should be multiples of 10.<br>
Exception: a speed of 5 ft. is okay.</small>
</fieldset>
<fieldset id="HD">
<legend>HD</legend>
<label>
<input type="radio" value="fixed" ng-model="builder.hdMode">
Use specific number of HD:
<input type="number" min="1" max="999"
ng-model="monster.hd"
ng-disabled="builder.hdMode!='fixed'">d<output
ng-bind="monster.size.hd"></output></label><br>
<label><input type="radio" value="dynamic" ng-model="builder.hdMode">
Match to target amount of hp:
<input type="number" min="0" max="9999"
ng-model="builder.hpTarget"
ng-disabled="builder.hdMode!='dynamic'"></label>
</fieldset>
</form>
</section>
<section id="features" ng-show="builder.tab=='features'">
<h2>Features</h2>
</section>
<section id="attacks" ng-show="builder.tab=='attacks'">
<h2>Attacks</h2>
<ul>
<li ng-repeat="attack in monster.attacks"
ng-include="'attack-form.html'"></li>
</ul>
<button ng-click="newAttack()">+</button>
</section>
</div>
</body>
</html>