-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
711 lines (664 loc) · 49 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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
<!doctype html>
<html lang="en">
<head>
<!-- bootstrap requierement: responsive viewport meta tag -->
<meta charset="utf-8">
<meta name='description' content="A lightweight editor for modeling and simulation of planar linkages.">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>mecEdit</title>
<!-- meta -->
<link rel="canonical" href="https://mecedit.com/" />
<link rel='manifest' href='./manifest.json'>
<link rel="apple-touch-icon" sizes="180x180" href="./img/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./img/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./img/favicon/favicon-16x16.png">
<link rel="mask-icon" href="./img/favicon/safari-pinned-tab.svg" color="#343a40">
<link rel="shortcut icon" href="./img/favicon/favicon.ico">
<meta name="msapplication-TileColor" content="#343a40">
<meta name="msapplication-config" content="./img/favicon/browserconfig.xml">
<meta name="theme-color" content="#343a40">
<!-- styles -->
<link rel="stylesheet" href="./vendor/bootstrap4.1.3.min.css">
<link rel="stylesheet" href="./app.min.css">
<link rel="stylesheet" href="./vendor/codemirror/codemirror5.39.2.css" />
<link rel="stylesheet" href="./vendor/codemirror/lucario.css">
<link rel="stylesheet" href="./vendor/codemirror/mdn-like.css">
</head>
<body>
<!-- ========================== navbar ========================== -->
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top flex-nowrap" id="navbar">
<div class="mb-auto pt-custom">
<svg style="margin-left: -5pt;" class="flex-shrink-0 mr-2" version="1.0" xmlns="http://www.w3.org/2000/svg" width="23pt" height="23pt" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet">
<g transform="translate(0,512) scale(0.1,-0.1)" fill="white" stroke="none">
<path d="M1300 4786 c-345 -47 -603 -160 -734 -322 -50 -61 -115 -188 -143
-280 -24 -81 -23 -272 2 -369 58 -225 237 -425 380 -425 34 0 35 1 35 38 0 21
-5 43 -12 50 -15 15 -50 124 -94 294 -64 251 -45 366 83 493 173 171 430 243
823 232 286 -8 538 -52 845 -147 144 -44 205 -59 247 -60 32 0 40 4 54 33 9
17 34 53 55 79 22 26 39 57 39 70 0 44 -58 80 -212 130 -274 90 -481 140 -728
173 -156 22 -518 28 -640 11z" fill="orange"/>
<path d="M3217 4489 c-159 -37 -309 -189 -346 -350 -26 -111 -8 -266 41 -364
27 -51 120 -148 172 -179 151 -89 371 -90 519 -3 95 56 191 188 216 298 13 57
13 191 0 248 -37 163 -187 313 -350 350 -53 13 -199 12 -252 0z"/>
<path d="M2684 3899 c-31 -34 -183 -153 -261 -203 -139 -90 -328 -168 -520
-216 -24 -6 -43 -16 -43 -21 0 -6 22 -36 50 -66 55 -60 106 -157 116 -221 4
-27 12 -42 21 -42 8 0 51 31 96 69 202 169 431 285 685 346 39 9 72 22 72 27
0 6 -20 33 -45 60 -50 56 -100 152 -110 213 -14 83 -25 93 -61 54z"/>
<path d="M3954 3813 c-9 -21 -29 -67 -45 -102 -16 -35 -29 -77 -29 -95 0 -34
23 -64 174 -233 162 -180 257 -356 300 -550 20 -90 20 -139 0 -228 -9 -38 -20
-90 -24 -115 -4 -25 -14 -65 -23 -90 -55 -159 -51 -190 19 -190 34 0 121 61
167 117 44 53 101 167 129 257 25 81 34 232 19 336 -38 258 -212 556 -471 806
-135 131 -189 153 -216 87z" fill="orange"/>
<path d="M3659 3474 c-70 -48 -144 -66 -286 -72 -97 -3 -133 -8 -133 -17 0 -7
11 -37 24 -66 48 -110 125 -329 170 -484 88 -308 136 -618 162 -1052 7 -127
10 -129 72 -88 77 51 146 68 300 73 78 2 142 8 142 11 0 4 -18 54 -41 112
-208 529 -299 923 -331 1427 -13 203 -13 202 -79 156z"/>
<path d="M1297 3480 c-162 -41 -309 -190 -346 -351 -13 -57 -13 -191 0 -248
17 -74 58 -149 116 -212 99 -106 202 -149 358 -149 156 0 264 46 364 156 86
94 120 189 121 336 0 150 -44 253 -153 355 -93 86 -167 115 -312 119 -60 2
-127 -1 -148 -6z"/>
<path d="M1110 2333 c0 -149 -21 -275 -71 -425 -21 -65 -39 -122 -39 -127 0
-5 66 -11 148 -13 120 -4 158 -9 207 -27 33 -13 67 -25 76 -28 14 -4 15 15 15
164 0 186 14 266 73 416 17 43 31 81 31 86 0 5 -64 11 -142 13 -115 4 -155 9
-203 27 -105 40 -95 49 -95 -86z"/>
<path d="M978 1621 c-152 -49 -282 -189 -317 -342 -13 -57 -13 -191 0 -248 37
-163 187 -313 350 -350 57 -13 191 -13 248 0 163 37 313 187 350 350 13 57 13
191 0 248 -25 110 -121 242 -216 298 -110 64 -292 83 -415 44z"/>
<path d="M3828 1621 c-83 -27 -138 -62 -201 -130 -58 -63 -99 -138 -116 -212
-13 -57 -13 -191 0 -248 37 -163 187 -313 350 -350 57 -13 191 -13 248 0 163
37 313 187 350 350 13 57 13 191 0 248 -35 155 -166 294 -320 342 -81 25 -231
25 -311 0z"/>
</g>
</svg>
</div>
<a id="appname" class="navbar-brand order-0">mecEdit</a>
<button class="navbar-toggle btn btn-dark mb-auto pt-custom mr-2" type="button" data-toggle="collapse" data-target="#navcollapse"
aria-controls="navcollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse order-2" id="navcollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-inline-flex navafter" id="FileDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
File
</a>
<div class="dropdown-menu" aria-labelledby="FileDropdown">
<a class="dropdown-item" id="newModel">New Model</a>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Load Example
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="nav-example-crankrocker">Crank-Rocker</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-slidercrank">Slider-Crank</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-7r">Stephenson II</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-9r">9R</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-basictruss">Basic Truss</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-truss">Truss</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-pendulums">Pendulums</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-example-pumpjack">Pumpjack</a>
</div>
</div>
<div class="dropdown-divider"></div>
<label class="btn btn-default btn-file dropdown-item">Import Model from JSON
<input type="file" id="import" style="display: none;" accept="application/json">
</label>
<div class="dropdown-divider"></div>
<!-- <a class="dropdown-item" id="export">Export Model as JSON</a> -->
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Export Model
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="export-json">as JSON</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="export-html">as HTML</a>
</div>
</div>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-inline-flex navafter" id="EditDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Edit
</a>
<div class="dropdown-menu" aria-labelledby="EditDropdown">
<label class="d-flex dropdown-item" id="dragmodeTrigger" for="dragmode">
<label class="ctxm-input-label pl-0" for="dragmode">Editmode </label>
<input type="checkbox" id="dragmode" class="cbx d-none">
<label class="lbl ml-auto" for="dragmode"></label>
</label>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="model-edit">JSON-Editor</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-purgeelement">Purge Element</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-inline-flex navafter" id="ComponentsDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Components
</a>
<div class="dropdown-menu" aria-labelledby="ComponentsDropdown">
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Nodes
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="nav-addbasenode">Basenode</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-addnode">Node</a>
</div>
</div>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Constraints
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="nav-free">Free</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-tran">Tran</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-rot">Rot</a>
</div>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-drive">Drive</a>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Loads
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="nav-force">Force</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-spring">Spring</a>
</div>
</div>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Shapes
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="nav-fix">Fixed Node</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-flt">Floating Node</a>
</div>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="nav-addview">Views</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-inline-flex navafter" id="ViewDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
View
</a>
<div class="dropdown-menu" aria-labelledby="ViewDropdown">
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Toggle Graphics
</a>
<div class="dropdown-menu m-0">
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Linkage
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="toggleNodes">Nodes</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="toggleConstraints">Constraints</a>
</div>
</div>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
Labels
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" id="toggleNodeLabels">Nodes</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="toggleConstraintLabels">Constraints</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="toggleLoadLabels">Loads</a>
</div>
</div>
</div>
</div>
<div class="dropdown-divider"></div>
<label class="d-flex dropdown-item" id="darkmodeTrigger" for="darkmode">
<label class="ctxm-input-label pl-0" for="darkmode">Darkmode </label>
<input type="checkbox" id="darkmode" class="cbx d-none">
<label class="lbl ml-auto" for="darkmode"></label>
</label>
<div class="dropdown-divider"></div>
<label class="d-flex dropdown-item" id="nodescalingTrigger" for="nodescaling">
<label class="ctxm-input-label pl-0" for="nodescaling">Nodescaling </label>
<input type="checkbox" id="nodescaling" class="cbx d-none">
<label class="lbl ml-auto" for="nodescaling"></label>
</label>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="resetview">Reset Editor-View</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle d-inline-flex navafter" id="HelpDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Help
</a>
<div class="dropdown-menu" aria-labelledby="HelpDropdown">
<a class="dropdown-item" id="keysModal-trigger" role="button" data-toggle="modal" data-target="#keysModal"
aria-haspopup="true">
Keyboard Shortcuts
</a>
<div class="dropdown-divider"></div>
<div class="btn-group dropright d-block hoverexpand">
<a class="dropdown-item dropdown-toggle" data-toggle="dropdown" aria-haspopup="true"
aria-expanded="false">
User Guide
</a>
<div class="dropdown-menu m-0">
<a class="dropdown-item" role="button" href="https://github.com/jauhl/mecEdit/blob/master/docs/userguide_de.md"
target="_blank" rel="noopener" aria-label="mecEdit User Guide de" style="display:flex !important">
Deutsch
<svg xmlns="http://www.w3.org/2000/svg" width="15px" height="15px" viewBox="0 0 511.626 511.627" style="position:relative;top:5px;margin-left:auto;">
<g>
<path fill="currentColor" d="M392.857,292.354h-18.274c-2.669,0-4.859,0.855-6.563,2.573c-1.718,1.708-2.573,3.897-2.573,6.563v91.361
c0,12.563-4.47,23.315-13.415,32.262c-8.945,8.945-19.701,13.414-32.264,13.414H82.224c-12.562,0-23.317-4.469-32.264-13.414
c-8.945-8.946-13.417-19.698-13.417-32.262V155.31c0-12.562,4.471-23.313,13.417-32.259c8.947-8.947,19.702-13.418,32.264-13.418
h200.994c2.669,0,4.859-0.859,6.57-2.57c1.711-1.713,2.566-3.9,2.566-6.567V82.221c0-2.662-0.855-4.853-2.566-6.563
c-1.711-1.713-3.901-2.568-6.57-2.568H82.224c-22.648,0-42.016,8.042-58.102,24.125C8.042,113.297,0,132.665,0,155.313v237.542
c0,22.647,8.042,42.018,24.123,58.095c16.086,16.084,35.454,24.13,58.102,24.13h237.543c22.647,0,42.017-8.046,58.101-24.13
c16.085-16.077,24.127-35.447,24.127-58.095v-91.358c0-2.669-0.856-4.859-2.574-6.57
C397.709,293.209,395.519,292.354,392.857,292.354z" />
<path fill="currentColor" d="M506.199,41.971c-3.617-3.617-7.905-5.424-12.85-5.424H347.171c-4.948,0-9.233,1.807-12.847,5.424
c-3.617,3.615-5.428,7.898-5.428,12.847s1.811,9.233,5.428,12.85l50.247,50.248L198.424,304.067
c-1.906,1.903-2.856,4.093-2.856,6.563c0,2.479,0.953,4.668,2.856,6.571l32.548,32.544c1.903,1.903,4.093,2.852,6.567,2.852
s4.665-0.948,6.567-2.852l186.148-186.148l50.251,50.248c3.614,3.617,7.898,5.426,12.847,5.426s9.233-1.809,12.851-5.426
c3.617-3.616,5.424-7.898,5.424-12.847V54.818C511.626,49.866,509.813,45.586,506.199,41.971z" />
</g>
</svg>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" role="button" href="https://github.com/jauhl/mecEdit/blob/master/docs/userguide_en.md"
target="_blank" rel="noopener" aria-label="mecEdit User Guide en" style="display:flex !important">
English
<svg xmlns="http://www.w3.org/2000/svg" width="15px" height="15px" viewBox="0 0 511.626 511.627" style="position:relative;top:5px;margin-left:auto;">
<g>
<path fill="currentColor" d="M392.857,292.354h-18.274c-2.669,0-4.859,0.855-6.563,2.573c-1.718,1.708-2.573,3.897-2.573,6.563v91.361
c0,12.563-4.47,23.315-13.415,32.262c-8.945,8.945-19.701,13.414-32.264,13.414H82.224c-12.562,0-23.317-4.469-32.264-13.414
c-8.945-8.946-13.417-19.698-13.417-32.262V155.31c0-12.562,4.471-23.313,13.417-32.259c8.947-8.947,19.702-13.418,32.264-13.418
h200.994c2.669,0,4.859-0.859,6.57-2.57c1.711-1.713,2.566-3.9,2.566-6.567V82.221c0-2.662-0.855-4.853-2.566-6.563
c-1.711-1.713-3.901-2.568-6.57-2.568H82.224c-22.648,0-42.016,8.042-58.102,24.125C8.042,113.297,0,132.665,0,155.313v237.542
c0,22.647,8.042,42.018,24.123,58.095c16.086,16.084,35.454,24.13,58.102,24.13h237.543c22.647,0,42.017-8.046,58.101-24.13
c16.085-16.077,24.127-35.447,24.127-58.095v-91.358c0-2.669-0.856-4.859-2.574-6.57
C397.709,293.209,395.519,292.354,392.857,292.354z"/>
<path fill="currentColor" d="M506.199,41.971c-3.617-3.617-7.905-5.424-12.85-5.424H347.171c-4.948,0-9.233,1.807-12.847,5.424
c-3.617,3.615-5.428,7.898-5.428,12.847s1.811,9.233,5.428,12.85l50.247,50.248L198.424,304.067
c-1.906,1.903-2.856,4.093-2.856,6.563c0,2.479,0.953,4.668,2.856,6.571l32.548,32.544c1.903,1.903,4.093,2.852,6.567,2.852
s4.665-0.948,6.567-2.852l186.148-186.148l50.251,50.248c3.614,3.617,7.898,5.426,12.847,5.426s9.233-1.809,12.851-5.426
c3.617-3.616,5.424-7.898,5.424-12.847V54.818C511.626,49.866,509.813,45.586,506.199,41.971z" />
</g>
</svg>
</a>
</div>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" id="aboutModal-trigger" role="button" data-toggle="modal" data-target="#aboutModal"
aria-haspopup="true">
About
</a>
</div>
</li>
<li class="d-inline-flex">
<div class="btn-group ml-5 mobile-neg-margin" role="group" aria-label="controls-group">
<button type="button" id="run" class="btn btn-dark pt-0" aria-label="Run Button" data-toggle="popover" data-placement="bottom" data-content="Run / Idle">
<svg class="svg-icon" width="16px" height="16px" viewBox="0 0 448 512">
<path id="run-symbol" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z" fill="white"/>
</svg>
</button>
<button type="button" id="stop" class="btn btn-dark pt-0" aria-label="Stop Button" data-toggle="popover" data-placement="bottom" data-content="Stop">
<svg class="svg-icon" width="16px" height="16px" viewBox="0 0 448 512">
<path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z" fill="white"/>
</svg>
</button>
<button type="button" id="reset" class="btn btn-dark pt-0" aria-label="Reset Button" data-toggle="popover" data-placement="bottom" data-content="Reset">
<svg class="svg-icon" width="16px" height="16px" viewBox="0 0 512 512">
<path d="M212.333 224.333H12c-6.627 0-12-5.373-12-12V12C0 5.373 5.373 0 12 0h48c6.627 0 12 5.373 12 12v78.112C117.773 39.279 184.26 7.47 258.175 8.007c136.906.994 246.448 111.623 246.157 248.532C504.041 393.258 393.12 504 256.333 504c-64.089 0-122.496-24.313-166.51-64.215-5.099-4.622-5.334-12.554-.467-17.42l33.967-33.967c4.474-4.474 11.662-4.717 16.401-.525C170.76 415.336 211.58 432 256.333 432c97.268 0 176-78.716 176-176 0-97.267-78.716-176-176-176-58.496 0-110.28 28.476-142.274 72.333h98.274c6.627 0 12 5.373 12 12v48c0 6.627-5.373 12-12 12z" fill="white"/>
</svg>
</button>
</div>
<div class="d-inline-flex ml-2 text-light grav" >
<input type="checkbox" id="gravity" class="cbx d-none">
<label id="toggle-g" class="lbl mr-2" for="gravity" aria-label="Toggle Gravity" data-toggle="popover" data-placement="bottom" data-content="Toggle Gravity"></label>
g<svg id="g-arrow" class="svg-icon mr-1" width="16px" height="16px" viewBox="0 0 256 512">
<path d="M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z" fill="currentColor"/>
</svg>
</div>
<!-- <div class="btn-group ml-2" role="group" aria-label="gravity-group">
<button type="button" id="toggle-g" class="btn btn-dark" data-toggle="popover" data-placement="bottom" data-content="Toggle gravity"> g
<svg class="svg-icon" width="16px" height="16px" viewBox="0 0 256 512">
<path d="M168 345.941V44c0-6.627-5.373-12-12-12h-56c-6.627 0-12 5.373-12 12v301.941H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.569 9.373 33.941 0l86.059-86.059c15.119-15.119 4.411-40.971-16.971-40.971H168z" fill="white"/>
</svg>
</button>
</div> -->
</li>
</ul>
</div>
<div class="nav-item ml-auto mb-auto pt-custom order-3 d-inline-flex">
<a class="nav-link pb-0 pt-0 nav-svg-logo" href="https://github.com/jauhl/mecEdit" target="_blank"
rel="noopener" aria-label="mecEdit GitHub" data-toggle="tooltip" data-placement="left" data-title="mecEdit on GitHub">
<svg class="navbar-nav-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 499.36"
focusable="false">
<title>mecEdit GitHub</title>
<path d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"
fill="currentColor" fill-rule="evenodd" />
</svg>
</a>
<button id="sidebar-toggle" class="btn btn-dark order-3 mb-auto" style="color: #6c757d" type="button" aria-label="Toggle sidebar" data-toggle="popover" data-placement="bottom" data-content="Charts">
<!-- <svg class="navbar-nav-svg " viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'>
<path stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'>
</svg> -->
<svg xmlns="http://www.w3.org/2000/svg" width="1.5em" height="1.5em" viewBox="0 0 24 24">
<!-- <path fill="none" d="M0 0h24v24H0V0z"/> -->
<path stroke="currentColor" stroke-width="2" d="M2,2 L2,22 M1,21 L22,21" />
<!-- <path d="M3.5 18.49l6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99l1.5 1.5z"/> -->
<path d="M5 18 Q 9 3, 13 11 T 20 4" stroke="currentColor" stroke-width="2" fill="transparent" stroke-linecap="round"/>
</svg>
</button>
</div>
</nav>
<div id="wrapper" class="container-fluid">
<div class="row content">
<!-- ========================== left sidebar ========================== -->
<nav id="sb-l" class="col sidebar sb-l">
<ul class="nav nav-pills flex-column text-center">
<li class="nav-item mb-1">
<button type="button" id="addbasenode" aria-label="Add Basenode" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="Basenode">
<svg viewBox="0 0 60 60" transform="scale(.7)">
<circle cx="30" cy="30" r="20" stroke="white" stroke-width="3" fill="none" />
<path d='M 10,30
A 20 20 0 1 0 30,10
L 30,50
A 20 20 0 1 1 50,30
Z'
stroke="white" stroke-width="1" fill="white" />
</svg>
</button>
<button type="button" id="addnode" aria-label="Add Node" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="Node">
<svg viewBox="0 0 60 60" transform="scale(.7)">
<circle cx="30" cy="30" r="20" stroke="white" stroke-width="3" fill="white" />
</svg>
</button>
<button type="button" id="free" aria-label="Add Free" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="FREE">
<svg viewBox="-10 -20 60 60">
<path d='M8,6
C 12 2, 12 -2, 8 -6'
stroke="white" stroke-width="2" fill="transparent" stroke-linecap="round" transform="translate(0,30) rotate(-45) scale(1.2)" />
<path d='M 0,0
L 8,0
M 15,0
L 18,0
M 22,0
L 24,0
M 28,0
L 35,0
M 45,0
L 36,-3
C 37 -1, 37 1, 36 3
Z'
stroke="white" stroke-width="2" fill="white" stroke-linecap="round"
stroke-miterlimit="5" stroke-linejoin="miter" transform="translate(0,30) rotate(-45) scale(1.2)" />
</svg>
</button>
<button type="button" id="tran" aria-label="Add Tran" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="TRAN">
<svg viewBox="-10 -20 60 60">
<path d='M 0,0
L 12,0
M 16,0
L 18,0
M 22,0
L 24,0
M 28,0
L 35,0
M 45,0
L 36,-3
C 37 -1, 37 1, 36 3
Z'
stroke="white" stroke-width="2" fill="white" stroke-linecap="round"
stroke-miterlimit="5" stroke-linejoin="miter" transform="translate(0,30) rotate(-45) scale(1.2)" />
</svg>
</button>
<button type="button" id="rot" aria-label="Add Rot" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="ROT">
<svg viewBox="-10 -20 60 60">
<path d='M8,6
C 12 2, 12 -2, 8 -6'
stroke="white" stroke-width="2" fill="transparent" stroke-linecap="round" transform="translate(0,30) rotate(-45) scale(1.2)" />
<path d='M 0,0
L 8,0
M 15,0
L 35,0
M 45,0
L 36,-3
C 37 -1, 37 1, 36 3
Z'
stroke="white" stroke-width="2" fill="white" stroke-linecap="round"
stroke-miterlimit="5" stroke-linejoin="miter" transform="translate(0,30) rotate(-45) scale(1.2)" />
</svg>
</button>
<button type="button" id="drive" aria-label="Add Drive" class="btn btn-dark svg-btn mb-1" data-toggle="popover"
data-placement="right" data-content="Drive">
<!-- <i class="fas fa-cogs"></i> -->
<svg class="svg-icon" width="33px" height="33px" viewBox="0 0 640 512">
<path d="M512.1 191l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0L552 6.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zm-10.5-58.8c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.7-82.4 14.3-52.8 52.8zM386.3 286.1l33.7 16.8c10.1 5.8 14.5 18.1 10.5 29.1-8.9 24.2-26.4 46.4-42.6 65.8-7.4 8.9-20.2 11.1-30.3 5.3l-29.1-16.8c-16 13.7-34.6 24.6-54.9 31.7v33.6c0 11.6-8.3 21.6-19.7 23.6-24.6 4.2-50.4 4.4-75.9 0-11.5-2-20-11.9-20-23.6V418c-20.3-7.2-38.9-18-54.9-31.7L74 403c-10 5.8-22.9 3.6-30.3-5.3-16.2-19.4-33.3-41.6-42.2-65.7-4-10.9.4-23.2 10.5-29.1l33.3-16.8c-3.9-20.9-3.9-42.4 0-63.4L12 205.8c-10.1-5.8-14.6-18.1-10.5-29 8.9-24.2 26-46.4 42.2-65.8 7.4-8.9 20.2-11.1 30.3-5.3l29.1 16.8c16-13.7 34.6-24.6 54.9-31.7V57.1c0-11.5 8.2-21.5 19.6-23.5 24.6-4.2 50.5-4.4 76-.1 11.5 2 20 11.9 20 23.6v33.6c20.3 7.2 38.9 18 54.9 31.7l29.1-16.8c10-5.8 22.9-3.6 30.3 5.3 16.2 19.4 33.2 41.6 42.1 65.8 4 10.9.1 23.2-10 29.1l-33.7 16.8c3.9 21 3.9 42.5 0 63.5zm-117.6 21.1c59.2-77-28.7-164.9-105.7-105.7-59.2 77 28.7 164.9 105.7 105.7zm243.4 182.7l-8.2 14.3c-3 5.3-9.4 7.5-15.1 5.4-11.8-4.4-22.6-10.7-32.1-18.6-4.6-3.8-5.8-10.5-2.8-15.7l8.2-14.3c-6.9-8-12.3-17.3-15.9-27.4h-16.5c-6 0-11.2-4.3-12.2-10.3-2-12-2.1-24.6 0-37.1 1-6 6.2-10.4 12.2-10.4h16.5c3.6-10.1 9-19.4 15.9-27.4l-8.2-14.3c-3-5.2-1.9-11.9 2.8-15.7 9.5-7.9 20.4-14.2 32.1-18.6 5.7-2.1 12.1.1 15.1 5.4l8.2 14.3c10.5-1.9 21.2-1.9 31.7 0l8.2-14.3c3-5.3 9.4-7.5 15.1-5.4 11.8 4.4 22.6 10.7 32.1 18.6 4.6 3.8 5.8 10.5 2.8 15.7l-8.2 14.3c6.9 8 12.3 17.3 15.9 27.4h16.5c6 0 11.2 4.3 12.2 10.3 2 12 2.1 24.6 0 37.1-1 6-6.2 10.4-12.2 10.4h-16.5c-3.6 10.1-9 19.4-15.9 27.4l8.2 14.3c3 5.2 1.9 11.9-2.8 15.7-9.5 7.9-20.4 14.2-32.1 18.6-5.7 2.1-12.1-.1-15.1-5.4l-8.2-14.3c-10.4 1.9-21.2 1.9-31.7 0zM501.6 431c38.5 29.6 82.4-14.3 52.8-52.8-38.5-29.6-82.4 14.3-52.8 52.8z"
stroke="white" stroke-width="2" fill="white" stroke-linecap="round"
stroke-miterlimit="5" stroke-linejoin="miter" />
</svg>
</button>
</li>
</ul>
</nav>
<!-- ========================== canvas ========================== -->
<main id="main" class="col p-0 main-container">
<div class="d-flex">
<div id="canvas-container" class="p-0">
<canvas id="canvas" class="canvas dragover" width="1200" height="820"></canvas>
</div>
<div id="instructions"></div>
<div id="actuators-container" class="d-inline-flex flex-wrap"></div>
<div id="statbar" class="statbar d-flex flex-row flex-nowrap">
<div id="sbCoords" class="text-dark pl-1"></div>
<div id="sbDragmode" class="text-dark pl-1"></div>
<div id="sbDOF" class="text-dark pl-1"></div>
<div id="sbFPS" class="text-dark pl-1"></div>
<div id="sbGravity" class="text-dark pl-1"></div>
<div id="sbMode" class="text-dark pl-1"></div>
<div id="sbCartesian" class="text-dark pl-1"></div>
<div id="sbBtn" class="text-dark pl-1"></div>
<div id="sbDbtn" class="text-dark pl-1"></div>
<div id="sbState" class="text-dark pl-1"></div>
<div id="sbDragging" class="text-dark pl-1"></div>
</div>
<!-- padding must be set as style in element, not in stylesheet! -->
<div id="sb-r" style="padding-left:270px;">
<div id="sb-canvas-container" class="glass" style="width:100%; height:100%; "><!-- canvas-elements for charts go here --></div>
</div>
</div>
<div class="drop-info" style="display:none;">
<div class="drop-content">
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 486 486">
<g>
<path fill="currentColor" d="M452.5,285c15,0,27,12,27,27v147c0,15-12,27-27,27h-418c-15,0-28-12-28-27V312c0-15,13-27,28-27
s27,12,27,27v119h364V312C425.5,297,437.5,285,452.5,285z"/>
<path fill="currentColor" d="M152.5,156c-11,11-27,11-38,0s-11-27,0-38l110-110c5-5,12-8,19-8s14,3,19,8l110,110
c11,11,11,27,0,38c-5,5-12,8-19,8s-15-3-20-8l-63-63v234c0,15-12,27-27,27s-27-12-27-27V93L152.5,156z"/>
</g>
</svg>
<h2><br/>Drop to a <b>JSON</b> file to upload a model</h2>
</div>
</div>
</main>
</div>
</div>
<!-- ========================== Custom ContextMenu ========================== -->
<div id="contextMenu" class="card border-0 clearfix">
<div id="contextMenuHeader" class="card-header bg-dark text-white"></div>
<ul id="contextMenuBody" class="list-group bg-light list-group-flush"></ul>
</div>
<!-- ========================== Tooltip ========================== -->
<span id='info' class="badge badge-light text-left text-monospace" style="position:absolute;display:none;pointer-events:none;">tooltip</span>
<!-- ========================== Custom Editor Modal ========================== -->
<div id="modelModal" class="modal fade" role="dialog" aria-labelledby="modelModallabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header bg-dark text-white">
<h5 class="modal-title">model editor</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<textarea id="modalTextarea">no model</textarea>
</div>
<div class="modal-footer">
<div class="mr-auto modal-btn-container d-inline-flex">
<button type="button" class="btn btn-primary modal-svg" id="copyModel" data-toggle="popover" data-placement="bottom" data-content="Copy the model to the clipboard.">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path fill="none" d="M0 0h24v24H0V0z"/>
<path fill="currentColor" d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"/>
</svg>
</button>
<button type="button" class="btn btn-primary modal-svg" id="copyChart" data-toggle="popover" data-placement="bottom" data-content="Copy a chart template to the clipboard.">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path stroke="currentColor" stroke-width="2" d="M2,2 L2,22 M1,21 L22,21" />
<path d="M5 18 Q 9 3, 13 11 T 20 4" stroke="currentColor" stroke-width="2" fill="transparent" stroke-linecap="round"/>
</svg>
</button>
</div>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" id="modalAccept">Apply changes</button>
</div>
</div>
</div>
</div>
<!-- ========================== Custom Viewcomponent Modal ========================== -->
<div id="viewModal" class="modal fade" role="dialog" aria-labelledby="viewModallabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered viewmodal" role="document">
<div class="modal-content"></div>
</div>
</div>
<!-- ========================== About Modal ========================== -->
<div id="aboutModal" class="modal fade" role="dialog" aria-labelledby="aboutModallabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" style="max-width:400px" role="document">
<div class="modal-content">
</div>
</div>
</div>
<!-- ========================== Keys Modal ========================== -->
<div id="keysModal" class="modal fade" role="dialog" aria-labelledby="keysModallabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" style="max-width:400px" role="document">
<div class="modal-content">
<div class="modal-header bg-dark text-white">
<h5 class="modal-title">Keyboard Shortcuts</h5>
<button type="button" class="close text-white" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
</div>
<div class="modal-body text-center">
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Function</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><kbd>ESC</kbd></th>
<td>Cancel current function</td>
</tr>
<tr>
<th scope="row"><kbd>E</kbd></th>
<td>Open JSON editor</td>
</tr>
<tr>
<th scope="row"><kbd>R</kbd></th>
<td>Reset editor view</td>
</tr>
<tr>
<th scope="row"><kbd>I</kbd></th>
<td>Toggle Drag/Edit</td>
</tr>
<tr>
<th scope="row"><kbd>V</kbd></th>
<td>Add view component</td>
</tr>
<tr>
<th scope="row"><kbd>P</kbd></th>
<td>Purge element</td>
</tr>
<tr>
<th scope="row">Sidebar:<br> <kbd>CTRL</kbd>+<kbd>Leftclick</kbd></th>
<td>Chain adding nodes & constraints</td>
</tr>
<tr>
<th scope="row">Mouse:<br> <kbd>Middle-Button</kbd></th>
<td style="vertical-align: middle !important;">Pan the editor view</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- vendor scripts -->
<script src="./vendor/bootstrap-native-v4.min.js"></script>
<script src="./vendor/draggabilly.pkgd.min.js"></script>
<script src="./vendor/codemirror/codemirror5.39.2.min.js"></script>
<script src="./vendor/codemirror/codemirror.jsmode5.39.2.js"></script>
<script src="./vendor/codemirror/matchbrackets.js"></script> <!-- addon -->
<script src="./scripts/g2.js"></script>
<script src="./scripts/g2.editor.js"></script>
<script src="./scripts/mec2.min.js"></script>
<script src="./app.min.js"></script>
<script>
// handle Service Worker
if ('serviceWorker' in navigator) {
if (navigator.serviceWorker.controller) {
console.log('Service Worker found');
} else {
navigator.serviceWorker.register('sw.js', {scope: '/'})
.then((registration) => {
console.log('Service Worker registration successful, scope is:', registration.scope);
})
.catch((error) => {
console.error('Service Worker registration failed, error:', error);
});
}
}
</script>
</body>
</html>