-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
336 lines (299 loc) · 9.5 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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=1024" />
<title>Binary Multiplication</title>
<!-- FAVICON -->
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon/favicon-16x16.png" />
<!-- STYLE SHEETS -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open Sans" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link rel="stylesheet" href="style/style.css" />
<link rel="stylesheet" href="style/header.css" />
<link rel="stylesheet" href="style/footer.css" />
<link rel="stylesheet" href="style/body.css" />
<link rel="stylesheet" href="style/input.css" />
<link rel="stylesheet" href="style/results.css" />
<!-- PRELOAD ICONS -->
<link rel="prefetch" href="assets/title-yellow.png" />
<link rel="prefetch" href="assets/pencil-yellow.png" />
<link rel="prefetch" href="assets/booths-yellow.png" />
<link rel="prefetch" href="assets/extended-booths-yellow.png" />
<link rel="prefetch" href="assets/about-yellow.png" />
<link rel="prefetch" href="assets/save-yellow.png" />
<link rel="prefetch" href="assets/title.png" />
<link rel="prefetch" href="assets/pencil.png" />
<link rel="prefetch" href="assets/booths.png" />
<link rel="prefetch" href="assets/extended-booths.png" />
<link rel="prefetch" href="assets/about.png" />
<link rel="prefetch" href="assets/save.png" />
<!-- SCRIPTS -->
<!-- The order of inclusion of the scripts matters. -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- JS files containing constants and strings. Should be included before all other scripts -->
<script src="scripts/constants.js"></script>
<script src="scripts/error-strings.js"></script>
<script src="scripts/colors.js"></script>
<script src="scripts/algo-strings.js"></script>
<!-- JS files related to behaviors in the header (navigation bar) and footer -->
<script src="scripts/animate.js"></script>
<script src="scripts/mul-methods.js"></script>
<script src="scripts/dropdown.js"></script>
<script src="scripts/header.js"></script>
<!-- JS files related to behaviors in the input section -->
<script src="scripts/binary.js"></script>
<script src="scripts/focus.js"></script>
<script src="scripts/input-util.js"></script>
<script src="scripts/input.js"></script>
<!-- JS files related to behaviors in the demonstration of the multiplication algorithms -->
<script src="scripts/pencil-and-paper.js"></script>
<script src="scripts/booths.js"></script>
<script src="scripts/extended-booths.js"></script>
<!-- Should be included after the scripts for the multiplication algorithms -->
<script src="scripts/demo-util.js"></script>
<script src="scripts/demo.js"></script>
<script src="scripts/export-util.js"></script>
<script src="scripts/export.js"></script>
</head>
<body>
<!-- HEADER/NAVIGATION BAR (TOP SECTION) -->
<div id="header" class="colored flex-container">
<div id="logo">
<a class="no-decor" onclick="window.location.reload();">
<img id="title-logo" src="assets/title.png" />
</a>
</div>
<div id="title">
<div class="inner">
<a class="no-decor" onclick="window.location.reload();">
<span id="title-text"></span>
</a>
</div>
</div>
<div class="small-padding">
<div class="inner">
<span></span>
</div>
</div>
<div id="pencil-and-paper" class="hidden mul-methods">
<div class="inner">
<a class="no-decor">
<img id="pencil-logo" src="assets/pencil-yellow.png" />
</a>
</div>
<div class="inner">
<a class="no-decor">
<span id="pencil-text" class="selected">Pencil and Paper</span>
</a>
</div>
</div>
<div id="booths" class="hidden mul-methods">
<div class="inner">
<a class="no-decor">
<img id="booths-logo" src="assets/booths.png" />
</a>
</div>
<div class="inner">
<a class="no-decor">
<span id="booths-text">Booth's</span>
</a>
</div>
</div>
<div id="extended-booths" class="hidden mul-methods">
<div class="inner">
<a class="no-decor">
<img id="extended-booths-logo" src="assets/extended-booths.png" />
</a>
</div>
<div class="inner">
<a class="no-decor">
<span id="extended-booths-text">Extended Booth's</span>
</a>
</div>
</div>
<div id="display-mode" class="hidden">
<div class="inner">
<div id="display-mode-container">
<a class="no-decor">
<span id="display-mode-text" tabindex="0">Step by Step</span>
</a>
<i id="display-mode-dropdown" class="fa fa-caret-down" tabindex="0"></i>
<div id="display-mode-content">
<a class="no-decor">
<span id="display-mode-option">Show All Steps</span>
</a>
</div>
</div>
</div>
</div>
</div>
<!-- INPUT AREA (LEFT SECTION) -->
<div id="input-numbers" class="hidden">
<form id="input-numbers-dec-bin">
<div id="multiplicand-div">
<span>Multiplicand</span>
<br />
</div>
<div id="multiplicand-container" class="input-container">
<p>
<label id="multiplicand-dec-label">
Decimal
<span class="tab-18"></span>
</label>
<input
type="text"
id="multiplicand-dec"
autocomplete="off"
oninput="isValidDec(this, 'multiplicand', value)"
/>
</p>
<p>
<label>Binary</label>
<input
type="text"
id="multiplicand-bin"
autocomplete="off"
oninput="isValidBin(this, 'multiplicand', value)"
/>
</p>
</div>
<div class="error" id="multiplicand-error">
<p></p>
</div>
<br />
<div id="multiplier-div">
<span>Multiplier</span>
<br />
</div>
<div id="multiplier-container" class="input-container">
<p>
<label id="multiplier-dec-label">
Decimal
<span class="tab-18"></span>
</label>
<input
type="text"
id="multiplier-dec"
autocomplete="off"
oninput="isValidDec(this, 'multiplier', value)"
/>
</p>
<p>
<label id="multiplier-bin-label">Binary</label>
<input
type="text"
id="multiplier-bin"
autocomplete="off"
oninput="isValidBin(this, 'multiplier', value)"
/>
</p>
</div>
<div class="error" id="multiplier-error">
<p></p>
</div>
<br />
<div id="multiply-div">
<div>
<button id="multiply" type="button" disabled>MULTIPLY</button>
</div>
</div>
<br />
<div id="trivia-div">
<p>
<span id="trivia-header"></span>
<span id="trivia-body"></span>
</p>
</div>
<div id="input-values" class="tracking-only">
<span id="multiplicand-dec-value"></span>
<span id="multiplicand-bin-value"></span>
<span id="multiplier-bin-value"></span>
<span id="multiplier-dec-value"></span>
<span id="multiplier-zero-appended"></span>
<span id="multiplier-for-recoding"></span>
<span id="booths-recoding"></span>
<span id="extended-booths-recoding"></span>
<span id="tracking-product"></span>
<span id="multiplier-equalized"></span>
<span id="multiplicand-equalized"></span>
<span id="tracking-summands"></span>
</div>
</form>
</div>
<!-- RESULTS AREA (RIGHT SECTION) -->
<div id="workspace" class="flex-container">
<div id="results" class="hidden">
<div id="algo-value" class="tracking-only"></div>
<div id="algo-name"></div>
<div>
<p id="algo-steps"></p>
</div>
</div>
</div>
<!-- FOOTER (BOTTOM SECTION) -->
<div id="footer" class="colored flex-container">
<div id="about" class="hidden">
<div id="about-logo-div" class="inner">
<a
class="no-decor"
href="https://github.com/memgonzales/binary-multiplication"
target="_blank"
>
<img id="about-logo" src="assets/about.png" />
</a>
</div>
<div class="inner">
<a
class="no-decor no-hover menu"
href="https://github.com/memgonzales/binary-multiplication"
target="_blank"
>
<span id="about-text">Browse Repo</span>
</a>
</div>
</div>
<div id="playback-control" class="hidden">
<div class="inner">
<i id="prev-step" class="fa fa-step-backward" class="play-control"></i>
<!-- Only one of these two spans (namely, description and step) will be displayed at any given time. -->
<span id="description">Description</span>
<span id="step">
Step
<input id="step-number" type="number" value="1" />
of
<span id="total-steps">30</span>
</span>
<i id="next-step" class="fa fa-step-forward" class="play-control"></i>
</div>
</div>
<div id="step-number-value">
1
<span class="material-icons">check_circle_outline</span>
<span class="tab-13"></span>
</div>
<div id="save" class="hidden">
<div class="inner">
<a class="no-decor">
<img id="save-logo" src="assets/save.png" />
</a>
</div>
<div class="inner">
<a class="no-decor">
<span id="save-text">Export Steps to Text File</span>
</a>
</div>
</div>
</div>
</body>
</html>