-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
454 lines (422 loc) · 16.3 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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Mapline</title>
<meta
name="viewport"
content="initial-scale=1,maximum-scale=1,user-scalable=no"
/>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://api.mapbox.com/mapbox-gl-js/v1.13.0/mapbox-gl.css"
integrity="sha384-d39gPzQ4eGpLy/1l4u2mLAT8KkPTOVrpoo8W4C8GtWBaJ+loWbZnKfvNtlmGsB12"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="./css/style.css" />
</head>
<body>
<div class="container-fluid">
<header>
<h1>
<a href="/">Mapline. </a
><small data-trn="subtitle" class="text-muted"></small>
</h1>
</header>
<noscript>
<div
data-trn="msg_js_required"
class="alert alert-danger"
role="alert"
></div>
</noscript>
<!-- alert/error box -->
<div
class="alert alert-danger alert-dismissible hidden"
id="alertbox"
role="alert"
>
<button type="button" class="close" aria-hidden="true">×</button>
<div id="alert-msg"></div>
</div>
<!-- main content -->
<div id="main" class="row">
<!-- user input -->
<section class="col-md-3">
<form id="config" class="mb-3">
<!-- track file input -->
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<!-- <label data-trn="track" for="trackFile"></label> -->
<a
data-trn="example"
href="#"
class="small float-end mb-1 link-dark"
id="example-gpx"
></a>
<!-- Show open file button -->
<label
id="trackBtn"
class="input-group hidable"
for="trackFile"
>
<!-- FIXME: focus button and open file dialog using keys -->
<span
class="btn btn-primary btn-lg w-100"
data-trn="open_file"
>
<input
type="file"
class="hidden"
id="trackFile"
accept=".geojson,.gpx,.kml"
/>
</span>
</label>
<!-- or chosen track name and remove track button -->
<div id="trackField" class="hidable hidden input-group">
<input
type="text"
id="trackFileName"
class="form-control"
readonly
/>
<div id="remove-track" class="input-group-append">
<div class="input-group-text close">×</div>
</div>
</div>
</div>
</div>
</div>
<!-- track details -->
<div id="trackDetails" class="row hidable hidden mb-3">
<div class="col-md-12">
<!-- <label>Details</label> -->
<table id="trackDetailsTable" class="table table-sm"></table>
</div>
</div>
<div class="accordion" id="settingsccordion">
<div class="accordion-item">
<h2 class="accordion-header" id="headingOne">
<button
class="accordion-button"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseOne"
aria-expanded="true"
aria-controls="collapseOne"
data-trn="settings"
></button>
</h2>
<div
id="collapseOne"
class="accordion-collapse collapse show"
aria-labelledby="headingOne"
data-bs-parent="#settingsccordion"
>
<div class="accordion-body">
<!-- map styles -->
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<label for="style" data-trn="map_style"></label>
<select id="style" class="form-control">
<option value="outdoors">Outdoors</option>
<option value="light">Light</option>
<option value="dark">Dark</option>
<option value="streets">Streets</option>
<option value="satellite">Satellite</option>
<option value="satellite-streets">
Satellite Streets
</option>
</select>
</div>
</div>
</div>
<!-- map scale -->
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<label for="scale" data-trn="scale"></label>
<div class="input-group">
<div class="input-group-prepend">
<div class="input-group-text">1:</div>
</div>
<input
id="scale"
type="number"
class="form-control disableable"
disabled
min="5000"
step="1000"
value="75000"
/>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
</div>
</div>
<!-- PDF format -->
<div class="row mb-3">
<div class="col-md-12">
<div class="form-group">
<label
for="paperformat"
data-trn="pdf_format"
></label>
<select
id="paperformat"
class="form-control disableable"
disabled
>
<option value="a5" selected>A5</option>
</select>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingThree">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseThree"
aria-expanded="false"
aria-controls="collapseThree"
data-trn="pois"
></button>
</h2>
<div
id="collapseThree"
class="accordion-collapse collapse"
aria-labelledby="headingThree"
data-bs-parent="#settingsccordion"
>
<div class="accordion-body">
<div id="pois" data-bs-parent="#collapse-group">
<!-- toggle waypoints -->
<div class="form-group">
<div class="form-check form-check-inline">
<input
id="showWaypoints"
type="checkbox"
class="form-check-input disableable"
disabled
checked
/>
<label
class="form-check-label"
for="showWaypoints"
data-trn="show_waypoints"
></label>
</div>
</div>
<div class="dropdown-divider"></div>
<p class="poi" data-trn="pois_header"></p>
<!-- download via turbo overpass -->
<div class="form-group" id="overpass">
<!-- filled in index.js -->
</div>
</div>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="headingTwo">
<button
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapseTwo"
aria-expanded="false"
aria-controls="collapseTwo"
data-trn="advanced"
></button>
</h2>
<div
id="collapseTwo"
class="accordion-collapse collapse"
aria-labelledby="headingTwo"
data-bs-parent="#settingsccordion"
>
<div class="accordion-body">
<!-- distance marker interval -->
<div class="form-group mb-3">
<label for="milemarkers" data-trn="milemarkers"></label>
<div class="input-group">
<input
id="milemarkers"
type="number"
class="form-control disableable"
disabled
min="0"
value="10"
/>
<div class="input-group-append">
<div class="input-group-text">km</div>
</div>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
<!-- map margin -->
<div class="form-group mb-3">
<label for="margin" data-trn="margin"></label>
<div class="input-group">
<input
id="margin"
type="number"
class="form-control disableable"
disabled
min="0"
value="10"
/>
<div class="input-group-append">
<div class="input-group-text">mm</div>
</div>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
<!-- track padding -->
<div class="form-group mb-3">
<label for="padding" data-trn="padding"></label>
<div class="input-group">
<input
id="padding"
type="number"
class="form-control disableable"
disabled
min="0"
value="10"
/>
<div class="input-group-append">
<div class="input-group-text">mm</div>
</div>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
<!-- pdf resolution -->
<div class="form-group mb-3">
<label for="dpi" data-trn="dpi"></label>
<div class="input-group">
<input
id="dpi"
type="number"
class="form-control disableable"
disabled
min="0"
value="300"
/>
<div class="input-group-append">
<div class="input-group-text">dpi</div>
</div>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
<!-- track width -->
<div class="form-group mb-3">
<label for="trackWidth" data-trn="track_width"></label>
<div class="input-group">
<input
id="trackWidth"
type="number"
class="form-control disableable"
disabled
min="1"
value="3"
/>
<div class="input-group-append">
<div class="input-group-text">px</div>
</div>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
<!-- track color -->
<div class="form-group mb-3">
<label for="trackColor" data-trn="track_color"></label>
<div class="input-group">
<input
id="trackColor"
type="color"
class="form-control disableable"
value="#ff69b4"
disabled
/>
</div>
<div class="form-control-feedback small hidden"></div>
</div>
</div>
</div>
</div>
</div>
</form>
<!-- generate button -->
<div class="row mb-3">
<div class="col-md-12">
<button
type="submit"
class="btn btn-primary btn-lg disableable w-100"
id="generate-btn"
data-trn="generate"
disabled
></button>
</div>
</div>
</section>
<!-- preview map view -->
<section class="col-md-9">
<div id="map"></div>
<div id="credits" class="float-end small text-muted">
<a href="https://github.com/sgelb">Made by <em>sgelb</em></a>
(v__VERSION__)
</div>
</section>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="pdfModal">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 data-trn="generating_pdf"></h5>
</div>
<div class="modal-body">
<div id="progress-text" data-trn="initializing" class="mb-3"></div>
<div class="progress">
<div
class="progress-bar progress-bar-striped progress-bar-animated"
id="progress-bar"
style="width: 0%"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
></div>
</div>
</div>
<div class="modal-footer">
<button
type="button"
class="btn btn-danger"
id="cancel-button"
data-trn="cancel"
></button>
</div>
</div>
</div>
</div>
<!-- high-res map sheets are rendered here -->
<div id="hidden-map-container">
<div id="hidden-map"></div>
</div>
<script type="text/javascript" src="./src/index.js"></script>
</body>
</html>