-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
322 lines (316 loc) · 13.8 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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<html>
<head>
<title>Yadrol - Dice roller and dice distribution sampler</title>
<!--<link href="css/bootstrap.min.css" rel="stylesheet">-->
<link href="css/themes/minty/bootstrap.min.css" rel="stylesheet">
<link href="css/bootstrap-tour.min.css" rel="stylesheet">
<link href="css/plottable.css" rel="stylesheet">
<link href="css/codemirror.css" rel="stylesheet">
<link href="css/yadrol.css" rel="stylesheet">
<link href="css/yadrol-editor.css" rel="stylesheet">
<link href="css/entypo-plus.css" rel="stylesheet">
<script src="js/yadrol/values.js"></script>
<script src="js/yadrol/yadrol-parser.js"></script>
<script src="js/yadrol/parseutils.js"></script>
<script src="js/yadrol/expressions.js"></script>
<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/yadrol/app.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/bootstrap-tour.min.js"></script>
<script src="js/svgtypewriter.js"></script>
<script src="js/d3.js"></script>
<script src="js/plottable.min.js"></script>
<script src="js/codemirror.js"></script>
<script src="js/yadrol/help.js"></script>
<script src="js/yadrol/libs.js"></script>
<script src="js/yadrol/main.js"></script>
</head>
<body>
<div class="container-fluid">
<div id="header" class="row">
<div class="col">
<h2 class="float-left">Yadrol <small class="text-muted">Dice roller and dice distribution sampler</small></h2>
</div>
<div class="col">
<div class="btn-group float-right" role="group">
<button type="button" class="btn" data-toggle="modal" data-target="#about" data-toggle="tooltip" data-placement="bottom" title="About Yadrol - Credits">
<span class="icon-info-with-circle"></span>
</button>
</div>
</div>
</div>
<div id="content" class="row">
<div class="col-6">
<div id="input-container" class="container-fluid">
<div id="toolbar" class="row">
<div class="col">
<button id="settings-button" class="btn btn-sm btn-primary" type="button" data-toggle="modal" data-target="#settings" onclick="Action.updateURL()" data-toggle="tooltip" title="Settings">
<span class="icon-cog"></span>
</button>
</div>
<div class="col">
<div class="dropdown" data-toggle="tooltip" title="Import library">
<button id="library-button" class="btn btn-sm btn-primary dropdown-toggle" type="button" data-toggle="dropdown">
<span class="icon-bowl"></span>
</button>
<div id="libraries" class="dropdown-menu">
<!--<a class="dropdown-item" href="#">Action</a>-->
</div>
</div>
</div>
<div class="col">
<div class="dropdown" data-toggle="tooltip" title="History">
<button id="history-button" class="btn btn-sm btn-primary dropdown-toggle" type="button" data-toggle="dropdown" disabled="disabled">
<span class="icon-back-in-time"></span>
</button>
<div id="history" class="dropdown-menu">
<!--<a class="dropdown-item" href="#">Action</a>-->
</div>
</div>
</div>
<div class="col">
<button id="url-button" class="btn btn-sm btn-primary" type="button" disabled="true" data-toggle="modal" data-target="#build-url" data-toggle="tooltip" title="Shareable URL" onclick="Action.updateURL()">
<span class="icon-link"></span>
</button>
</div>
<div class="col-4">
<div class="btn-group dropdown float-right">
<button id="run-button" type="button" disabled="true" class="btn btn-secondary btn-md" onclick="Action.run()">
<img class="output-mode-icon" src="icons/buttons/graph4.svg">
Sample
</button>
<button id="output-mode-button" type="button" disabled="true" class="btn btn-secondary btn-md dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<div id="output-modes-menu" class="dropdown-menu">
<a class="dropdown-item" onclick="Action.setMode('roll', true)">
<img class="output-mode-icon" src="icons/buttons/dice3.svg">
Roll
</a>
<a class="dropdown-item" onclick="Action.setMode('sample', true)">
<img class="output-mode-icon" src="icons/buttons/graph4.svg">
Sample
</a>
<a class="dropdown-item" onclick="Action.setMode('advanced', true)">
<img class="output-mode-icon" src="icons/buttons/dice2.svg">
Advanced
</a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<textarea id="expression-string" class="form-control" placeholder="Expression, e.g. 3d6" rows="7"></textarea>
</div>
</div>
<div id="bottom-toolbar" class="row">
<div id="help-buttons" class="col">
<div class="btn-group" role="group">
<button type="button" class="btn btn-sm btn-info" onclick="Help.startTutorial()">
Tutorial
</button>
<button type="button" class="btn btn-sm btn-info" onclick="Help.tableofcontents('Recipes', Help.recipesContent)">
Recipes
</button>
<button type="button" class="btn btn-sm btn-info" onclick="Help.tableofcontents('Libraries', Libs.libsContent)">
Libraries
</button>
<button type="button" class="btn btn-sm btn-info" onclick="Help.tableofcontents('Reference', Help.referenceContent)">
Reference
</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-6">
<div id="output-container" class="container-fluid">
<div class="row">
<div class="col">
<div id="sample-records" class="container-fluid">
<div id="sample-records-toolbar" class="row">
<div class="col"></div>
<div class="col">
<div id="y-button-group" class="btn-group" data-toggle="buttons">
<label class="btn btn-sm btn-primary active">
<input type="radio" name="y-value" onchange="Action.setY('relativeAtLeast')" autocomplete="off" checked>
At Least
</label>
<label class="btn btn-sm btn-primary">
<input type="radio" name="y-value" onchange="Action.setY('relative')" autocomplete="off">
Exact
</label>
<label class="btn btn-sm btn-primary">
<input type="radio" name="y-value" onchange="Action.setY('relativeAtMost')" autocomplete="off">
At Most
</label>
</div>
</div>
<div class="col"></div>
<div class="col">
<div id="centrum-button-group" class="btn-group" data-toggle="buttons">
<label class="btn btn-sm btn-primary active">
<input type="radio" name="centrum-value" onchange="Action.setCentrum('mean')" autocomplete="off" checked>
Mean
</label>
<label class="btn btn-sm btn-primary">
<input type="radio" name="centrum-value" onchange="Action.setCentrum('mode')" autocomplete="off">
Mode
</label>
<label class="btn btn-sm btn-primary">
<input type="radio" name="centrum-value" onchange="Action.setCentrum('median')" autocomplete="off">
Median
</label>
</div>
</div>
<div class="col"></div>
</div>
<div class="row">
<div class="col">
<svg id="sample-records-graph"></svg>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="help" class="row">
<div id="help-toc" class="col-3">
</div>
<div id="help-content" class="col-9">
</div>
</div>
<div id="footer" class="row">
</div>
</div>
<div id="build-url" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Share URL</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span>×</span>
</button>
</div>
<div class="modal-body container-fluid">
<div class="row">
<div class="col">
<div class="input-group">
<input id="url" type="text" class="form-control">
<span class="input-group-btn">
<button type="button" class="btn" onclick="Action.copyURL()">
C
</button>
</span>
</div>
</div>
</div>
<div id="url-options" class="row">
<div class="col">
</div>
<div class="col">
<label>
<input id="url-include-mode" type="checkbox" onclick="Action.updateURL()">
Include mode
</label>
</div>
<div class="col">
<label>
<input id="url-autorun" type="checkbox" onclick="Action.updateURL()">
Autorun
</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="about" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">About Yadrol</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span>×</span>
</button>
</div>
<div class="modal-body container-fluid">
<h4>Version 0.1</h4>
<p>
Made by <a href="mailto:[email protected]?subject=[yadrol] ">phatonin</a> during his leisure time.
</p>
<p>
For sources, bug reports, feature requests, see the <a target="_new" href="https://github.com/phatonin/yadrol">GitHub page</a>.
</p>
<hr>
<h4>Icons</h4>
<p>
<img height="17ex" src="icons/buttons/dice2.svg"> by <a target="_new" href="http://www.flaticon.com/authors/nikita-golubev">Nikita Golubev</a> [<a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC 3.0 BY</a>].
</p>
<p>
<img height="17ex" src="icons/buttons/dice3.svg"> by <a target="_new" href="http://www.freepik.com">Freepik</a> [<a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC 3.0 BY</a>].
</p>
<p>
<img height="17ex" src="icons/buttons/graph4.svg"> by <a target="_new" href="http://www.flaticon.com/authors/retinaicons">Retinaicons</a> [<a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC 3.0 BY</a>].
</p>
<p>
<img height="40ex" src="icons/dice/d4.svg"> <img height="40ex" src="icons/dice/d6.svg"> by <a target="_new" href="https://thenounproject.com/DaanDirk/">Daan Dirk</a> [<a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC 3.0 BY</a>].
</p>
<p>
<img height="40ex" src="icons/dice/d8.svg"> <img height="40ex" src="icons/dice/d10.svg"> <img height="40ex" src="icons/dice/d12.svg"> <img height="40ex" src="icons/dice/d20.svg"> by <a target="_new" href="https://thenounproject.com/mvalstar/">Mike Valstar</a> [<a href="http://creativecommons.org/licenses/by/3.0/" target="_blank">CC 3.0 BY</a>].
</p>
<p>
<span class="icon-info-with-circle"></span><span class="icon-cog"></span><span class="icon-link"></span><span class="icon-bowl"></span><span class="icon-back-in-time"></span> from <a href="http://www.entypo.com/">Entypo+</a> collection by <a href="http://www.danielbruce.se/">Daniel Bruce</a> [CC 4.0 BY-SA].
</p>
<hr>
<h4>Libraries</h4>
<p>
The Yadrol language parser is generated with <a href="https://zaa.ch/jison/">Jison</a> by <a href="https://github.com/zaach">Zachary Carter</a> [<a href="https://github.com/zaach/jison#license">MIT license</a>]
</p>
<p>
Yadrol uses <a href="https://jquery.com/">jQuery</a> by the <a href="https://jquery.org/team/">jQuery Foundation</a> [<a href="https://jquery.org/license/">MIT license</a>].
</p>
<p>
Layout was made this neat, thanks to <a target="_new" href="http://getbootstrap.com/">Bootstrap</a> by the <a href="https://github.com/orgs/twbs/people">Bootstrap core team</a> [<a href="https://github.com/twbs/bootstrap/blob/master/LICENSE">MIT license</a>].
</p>
<p>
The Minty theme comes from the <a href="https://bootswatch.com/">Bootswatch</a> collection by <a href="https://thomaspark.co/">Thomas Park</a> [<a href="https://github.com/thomaspark/bootswatch/blob/master/LICENSE">MIT license</a>].
</p>
<p>
Beautiful charts rendered with <a href="http://plottablejs.org/">Plottable</a> by <a href="https://www.palantir.com/">Palantir Technologies</a> [<a href="https://github.com/palantir/plottable/blob/develop/LICENSE">MIT license</a>] and <a href="https://d3js.org/">d3js</a> by <a href="https://bost.ocks.org/mike/">Mike Bostock</a> [<a href="https://github.com/d3/d3/blob/master/LICENSE">BSD 3-clause license</a>].
</p>
<p>
Tutorial easily built with <a href="http://bootstraptour.com/">Bootstrap Tour</a> by <a href="https://github.com/sorich87">Ulrich Sossou</a> [<a href="https://github.com/sorich87/bootstrap-tour/blob/master/LICENSE">MIT license</a>].
</p>
<p>
The expression editor works out of the box with <a href="http://codemirror.net/">CodeMirror</a> by <a href="https://github.com/marijnh">Marijn Haverbeke</a> [<a href="https://github.com/codemirror/CodeMirror/blob/master/LICENSE">MIT license</a>].
</p>
</div>
</div>
</div>
</div>
<div id="settings" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Settings</h3>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span>×</span>
</button>
</div>
<div class="modal-body container-fluid">
<div class="row">
<div class="col-md-6">Sample size</div>
<div class="col-md-6">
<input id="sample-size" class="form-control" type="number" value="100000" min="1000" max="1000000" step="1000" onchange="Action.setSampleSize()" />
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>