-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.html
More file actions
347 lines (315 loc) · 17.4 KB
/
Copy pathindex.html
File metadata and controls
347 lines (315 loc) · 17.4 KB
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
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Typeset math worksheets with LaTeX in your browser, answer keys included">
<title>Math-PDF-Generator</title>
<link rel="icon" href="favicon.svg" type="image/svg+xml">
<!-- Icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<!-- Main Styles -->
<link rel="stylesheet" href="css/main.css">
<!-- The TeX bundle is the one large download; start it with the page. -->
<link rel="preload" href="vendor/texlive/texlive.bundle.gz" as="fetch" crossorigin="anonymous">
</head>
<body>
<!-- ============================================================= App bar -->
<header class="appbar">
<a class="appbar-brand" href="./">
<img class="appbar-logo" src="favicon.svg" alt="" width="26" height="26">
<span>Math<span class="appbar-brand-thin"> PDF Generator</span></span>
</a>
<p id="engine-status" class="engine-status" role="status">
<i class="fas fa-circle-notch fa-spin"></i>
Loading the LaTeX engine…
</p>
<div class="appbar-actions">
<button type="button" class="icon-btn theme-toggle-btn" title="Toggle theme" aria-label="Toggle theme">
<i class="fas fa-moon"></i>
</button>
<a class="icon-btn" href="https://github.com/sankeer28/Math-PDF-Generator-Web"
target="_blank" rel="noopener noreferrer" title="View on GitHub" aria-label="View on GitHub">
<i class="fab fa-github"></i>
</a>
</div>
</header>
<!-- ========================================================== Workspace -->
<main class="workspace">
<!-- ------------------------------------------------ Settings column -->
<div class="settings-column">
<div class="step-nav" role="tablist" aria-label="Settings sections">
<button type="button" class="step-link" role="tab" aria-controls="step-level" aria-selected="true">
<span class="step-num">1</span>Level
</button>
<button type="button" class="step-link" role="tab" aria-controls="step-content" aria-selected="false">
<span class="step-num">2</span>Content
</button>
<button type="button" class="step-link" role="tab" aria-controls="step-format" aria-selected="false">
<span class="step-num">3</span>Format
</button>
<button type="button" class="step-link" role="tab" aria-controls="step-appearance" aria-selected="false">
<span class="step-num">4</span>Appearance
</button>
<button type="button" class="step-link" role="tab" aria-controls="step-history" aria-selected="false">
<span class="step-num">5</span>History
</button>
</div>
<form id="pdfForm" class="settings-form">
<!-- ------------------------------------------------ 1. Level -->
<section class="settings-panel" id="step-level" role="tabpanel" aria-label="Level">
<p class="settings-panel-hint">Who is this worksheet for?</p>
<div class="settings-panel-body">
<div class="field">
<label for="gradeLevel" class="field-label">Grade level</label>
<select id="gradeLevel" class="form-select">
<!-- Populated from the curriculum data by FormManager -->
</select>
</div>
<div class="field">
<label for="difficulty" class="field-label">
Difficulty
<output id="difficultyLabel" class="field-value">Medium</output>
</label>
<input type="range" id="difficulty" class="range-input" min="1" max="3" value="2"
aria-describedby="difficulty-scale">
<div class="range-scale" id="difficulty-scale">
<span>Easy</span><span>Medium</span><span>Hard</span>
</div>
</div>
</div>
</section>
<!-- ---------------------------------------------- 2. Content -->
<section class="settings-panel" id="step-content" role="tabpanel" aria-label="Content">
<p class="settings-panel-hint">Which mathematics appears on the page</p>
<div class="settings-panel-body">
<div class="field">
<div class="field-label-row">
<span class="field-label">Subjects</span>
<label class="toggle-all">
<input type="checkbox" id="subject-all" class="checkbox-input" checked>
<span>All</span>
</label>
</div>
<div id="subjectSelection" class="chip-grid">
<!-- Populated by FormManager -->
</div>
</div>
<div class="field" id="operationsSection">
<span class="field-label">Operations</span>
<div class="chip-grid chip-grid-4">
<label class="chip">
<input type="checkbox" id="op-addition" class="checkbox-input" value="addition" checked>
<span class="chip-text"><b>+</b> Addition</span>
</label>
<label class="chip">
<input type="checkbox" id="op-subtraction" class="checkbox-input" value="subtraction" checked>
<span class="chip-text"><b>−</b> Subtraction</span>
</label>
<label class="chip">
<input type="checkbox" id="op-multiplication" class="checkbox-input" value="multiplication" checked>
<span class="chip-text"><b>×</b> Multiplication</span>
</label>
<label class="chip">
<input type="checkbox" id="op-division" class="checkbox-input" value="division" checked>
<span class="chip-text"><b>÷</b> Division</span>
</label>
</div>
</div>
<div class="field">
<div class="field-label-row">
<span class="field-label">Topics</span>
<label class="toggle-all">
<input type="checkbox" id="topic-all" class="checkbox-input" checked>
<span>All</span>
</label>
</div>
<p class="field-help">
Only topics the chosen grade covers are listed. Open one to set its
number range and other details.
</p>
<div id="topicSelection" class="topic-list custom-scrollbar">
<!-- Populated by FormManager -->
</div>
</div>
</div>
</section>
<!-- ----------------------------------------------- 3. Format -->
<section class="settings-panel" id="step-format" role="tabpanel" aria-label="Format">
<p class="settings-panel-hint">How many, and in what shape</p>
<div class="settings-panel-body">
<div class="field-row">
<div class="field">
<label for="problemType" class="field-label">Problem type</label>
<select id="problemType" class="form-select">
<option value="equations" selected>Equations only</option>
<option value="word">Word problems only</option>
<option value="visual">Diagrams only</option>
<option value="mixed">Mixed (alternating pages)</option>
</select>
</div>
<div class="field">
<label for="answerKey" class="field-label">Answer key</label>
<select id="answerKey" class="form-select">
<option value="separate">On a separate page</option>
<option value="none">No answer key</option>
</select>
</div>
</div>
<div class="field-row">
<div class="field">
<label for="numPDFs" class="field-label">Worksheets</label>
<input type="number" id="numPDFs" class="form-input" value="1" min="1" max="100">
<p class="field-help">Each gets its own problems.</p>
</div>
<div class="field">
<label for="numPages" class="field-label">Pages each</label>
<input type="number" id="numPages" class="form-input" value="1" min="1" max="50">
<p class="field-help">Before the answer key.</p>
</div>
</div>
</div>
</section>
<!-- ------------------------------------------- 4. Appearance -->
<section class="settings-panel" id="step-appearance" role="tabpanel" aria-label="Appearance">
<p class="settings-panel-hint">What the printed page looks like</p>
<div class="settings-panel-body">
<div class="field">
<label for="pdfTitle" class="field-label">Worksheet title</label>
<input type="text" id="pdfTitle" class="form-input" value="Math Practice" maxlength="80">
</div>
<div class="field-row">
<div class="field">
<label for="showTitle" class="field-label">Show title on</label>
<select id="showTitle" class="form-select">
<option value="first">First page only</option>
<option value="all">Every page</option>
<option value="no">No page</option>
</select>
</div>
<div class="field">
<label for="paperSize" class="field-label">Paper size</label>
<select id="paperSize" class="form-select">
<option value="letter">Letter (8.5 × 11 in)</option>
<option value="a4">A4 (210 × 297 mm)</option>
</select>
</div>
</div>
<div class="field">
<span class="field-label">Header fields</span>
<div class="chip-grid chip-grid-4">
<label class="chip">
<input type="checkbox" id="showName" class="checkbox-input">
<span class="chip-text">Name</span>
</label>
<label class="chip">
<input type="checkbox" id="showDate" class="checkbox-input">
<span class="chip-text">Date</span>
</label>
<label class="chip">
<input type="checkbox" id="showScore" class="checkbox-input">
<span class="chip-text">Score</span>
</label>
<label class="chip">
<input type="checkbox" id="showGrade" class="checkbox-input">
<span class="chip-text">Grade</span>
</label>
</div>
</div>
<div class="field-row">
<div class="field">
<label for="pageNumberPosition" class="field-label">Page numbers</label>
<select id="pageNumberPosition" class="form-select">
<option value="bottom-center">Bottom centre</option>
<option value="bottom-left">Bottom left</option>
<option value="bottom-right">Bottom right</option>
<option value="top-right">Top right</option>
<option value="none">Hidden</option>
</select>
</div>
<div class="field">
<span class="field-label">Decoration</span>
<div class="switch-list">
<label class="switch-row">
<span>Page border</span>
<input type="checkbox" id="showPageBorder" class="checkbox-input">
</label>
<label class="switch-row">
<span>Box around page number</span>
<input type="checkbox" id="showPageNumberBox" class="checkbox-input">
</label>
<label class="switch-row">
<span>Circled question numbers</span>
<input type="checkbox" id="showNumberCircles" class="checkbox-input">
</label>
</div>
</div>
</div>
</div>
</section>
<!-- ---------------------------------------------- 5. History -->
<section class="settings-panel" id="step-history" role="tabpanel" aria-label="History" hidden>
<p class="settings-panel-hint">Worksheets you have downloaded before</p>
<div class="settings-panel-body">
<div class="field">
<div class="field-label-row">
<span class="field-label">Recent downloads</span>
<button type="button" id="historyClear" class="quiet-btn">
<i class="fas fa-trash-can"></i>
Clear
</button>
</div>
<p class="field-help">
Each entry keeps the exact settings that produced it. Load one to put
those settings back, then download again. Stored in this browser only.
</p>
<div id="historyList" class="history-list custom-scrollbar">
<!-- Populated by FormManager -->
</div>
</div>
</div>
</section>
</form>
</div>
<!-- ------------------------------------------------- Preview column -->
<aside class="preview-column">
<div class="preview-sticky">
<div class="preview-actions">
<button type="submit" form="pdfForm" class="btn btn-success btn-lg">
<i class="fas fa-download"></i>
Download
</button>
</div>
<!-- The preview keeps itself current; this only re-rolls the problems. -->
<div class="preview-toolbar">
<span class="preview-toolbar-label">Live preview</span>
<button type="button" id="previewBtn" class="quiet-btn">
<i class="fas fa-rotate"></i>
Regenerate preview
</button>
</div>
<div id="progress-container" class="progress-container">
<div class="progress-bar">
<div id="progress-fill" class="progress-fill"></div>
</div>
<div id="progress-message" class="progress-message">Initializing...</div>
</div>
<div id="preview-container" class="preview-container">
<div id="preview-content" class="preview-content custom-scrollbar">
<div class="preview-empty">
<i class="fas fa-file-lines"></i>
<p>Your worksheet appears here.</p>
<p class="preview-empty-hint">
Press <strong>Preview</strong> to typeset one, or
<strong>Generate</strong> to download.
</p>
</div>
</div>
</div>
</div>
</aside>
</main>
<!-- Application Script (ES6 Module) -->
<script type="module" src="js/app.js"></script>
</body>
</html>