forked from ElizabethHudnott/algorithmic-art
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
1022 lines (988 loc) · 45.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
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
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mathematical Art with Elizabeth</title>
<meta property="og:title" content="Mathematical Art with Elizabeth">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' http://localhost:*; img-src 'self' http://localhost:* blob:; style-src 'self' http://localhost:* 'unsafe-inline'; form-action 'self'; frame-src 'none'; object-src 'none'">
<!-- Preloads -->
<link rel="preload" as="style" href="fonts/pacifico.css">
<link rel="preload" as="style" href="fonts/alfa-slab-one.css">
<link rel="preload" as="style" href="fonts/america.css">
<link rel="preload" as="fetch" href="sketches.json" crossorigin>
<!-- Stylesheets -->
<link rel="stylesheet" href="lib/bootstrap.min.css">
<link rel="stylesheet" href="css/math-art.css">
<!-- <link rel="stylesheet" href="css/dark-mode.css" media="(prefers-color-scheme: dark)"> -->
<!-- Libraries -->
<script src="lib/jquery-3.6.0.slim.min.js"></script>
<script src="lib/bootstrap.bundle.min.js"></script>
<!-- JavaScript -->
<script src="js/util.js" defer></script>
<script src="js/math-art.js" defer></script>
<link rel="icon" href="img/spirograph.png">
<meta name="viewport" content="initial-scale=1, minimum-scale=1">
<meta name="description" content="Geometric art. Alter numerous parameters to make your own creations. Combine my programming, your crafted customizations and computer randomization. Create videos and still images. Visual sensory seeking stimulation for people with autism and everyone.">
<meta property="og:image" content="img/social/square.png">
<meta property="og:image:width" content="1009">
<meta property="og:image:height" content="1009">
<!--
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebApplication",
"name": "Mathematical Art with Elizabeth",
"offers": {
"@type": "Offer",
"price": "0"
},
TODO Add a review here https://developers.google.com/search/docs/data-types/review-snippet
"applicationCategory": "DesignApplication"
}
</script>
-->
</head>
<body style="background-color: #ffffff" class="m-0 overflow-hidden vh-100">
<div class="alert alert-danger alert-dismissible fade position-absolute top-2 center-x" role="alert" id="error-alert" style="z-index: 2000">
<span></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="alert alert-success alert-dismissible fade position-absolute top-2 center-x" role="alert" id="success-alert" style="z-index: 2000">
<span></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<canvas id="background-canvas"></canvas>
<svg id="canvas-overlay" xmlns="http://www.w3.org/2000/svg">
<rect fill="hsla(210, 50%, 50%, 0.55)">
</svg>
<div id="author-hitbox" class="position-absolute" style="left: 0; bottom: 0; background-color: transparent">
<form class="position-absolute bg-black p-2" hidden style="bottom: 0; width: 300px; z-index: 3" id="author-form">
<div class="form-row">
<label class="col-2 my-auto col-form-label col-form-label-sm" for="author">
Name
</label>
<div class="col-8 my-auto">
<input type="text" class="form-control form-control-sm" id="author" placeholder="your name">
</div>
<div class="col-2">
<button type="submit" class="btn btn-primary btn-sm" id="btn-author-submit">
OK
</button>
</div>
</div>
</form>
</div>
<div id="overlay" class="fade2">
<!-- The toolbar ends up here on mobile. -->
<div class="overlay-content">
</div>
</div>
<button id="btn-floating-action" hidden title="Open actions list">
<img src="img/palette.png" width="56" height="56" alt="Palette">
</button>
<div class="d-flex" role="toolbar" aria-label="Toolbar" id="toolbar" style="z-index: 2" hidden>
<div class="d-inline mt-auto mb-1 mr-2" style="max-height: 46px">
<a href="https://www.patreon.com/bePatron?u=23440273" class="patreon" title="Become a patron">
<img src="img/patreon.svg" width="16" height="15" alt="Patreon">
<span class="ml-2">Become a patron</span>
</a>
</div>
<div class="btn-toolbar" id="toolbar-main">
<button type="button" class="btn toolbar-btn" data-toggle="modal" data-target="#sketches-modal" title="Choose another sketch">
<img src="img/module.png" width="32" height="32" alt="Sketch">
<span class="overlay-label">Change Sketch</span>
</button>
<button type="button" class="btn toolbar-btn" data-toggle="modal" data-target="#layers-modal" title="Layers">
<img src="img/layers.png" width="32" height="32" alt="Layers">
<span class="overlay-label">Layers</span>
</button>
<button type="button" class="btn toolbar-btn" data-toggle="modal" data-target="#background-gen-modal" title="Change parameters">
<img width="32" height="32" src="img/gear_in.png" alt="Parameters">
<span class="overlay-label">Parameters</span>
</button>
<div class="btn-group" role="group" aria-label="Randomization controls" id="generate-btn-group">
<button type="button" class="btn toolbar-btn" id="btn-generate-background" title="Randomize">
<img width="32" height="32" src="img/dice.png" alt="Dice">
<span class="overlay-label">Randomize</span>
</button>
<button type="button" class="btn toolbar-btn dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Randomization options">
<span class="sr-only">Toggle randomization options</span>
</button>
<div class="dropdown-menu dropdown-menu-right bg-black">
<form class="px-2" id="random-seed-form">
<div class="form-group">
<label for="random-seed">Seed</label>
<textarea class="form-control text-right" id="random-seed" rows="8" minlength="7" style="resize: none"></textarea>
</div>
<div class="text-right">
<button type="submit" class="btn btn-primary btn-sm">Set Seed</button>
</div>
</form>
</div>
</div>
<button type="button" class="btn toolbar-btn" id="btn-start-frame" title="Set start frame">
<img width="32" height="32" src="img/timeline_marker_start.png" alt="Start Frame">
<span class="overlay-label">Start frame</span>
</button>
<button type="button" class="btn toolbar-btn" id="btn-end-frame" title="Set end frame">
<img width="32" height="32" src="img/timeline_marker_end.png" alt="End Frame">
<span class="overlay-label">End frame</span>
</button>
<button type="button" class="btn toolbar-btn" id="btn-both-frames" title="Set start & end frames">
<img width="32" height="32" src="img/timeline_marker_both.png" alt="Both Frames">
<span class="overlay-label">Both frames</span>
</button>
<div class="btn-group position-static" role="group" aria-label="Animation controls" id="play-btn-group">
<button type="button" class="btn toolbar-btn position-relative" id="btn-play" title="Play animation">
<img width="32" height="32" src="img/control_play_blue.png" alt="Play">
<img width="16" height="16" src="img/record.png" style="position: absolute; top: 4px; right: 5px" id="play-badge" hidden>
<span class="overlay-label">Play</span>
</button>
<button type="button" class="btn toolbar-btn dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Animation options" id="btn-anim-controls">
<span class="sr-only">Toggle playback options</span>
</button>
<div class="dropdown-menu dropdown-menu-abs-right bg-black" style="width: min(100%, 500px)" id="anim-controls">
<form class="px-2">
<div class="form-row">
<div class="col-7">
<label for="anim-position">Position</label>
</div>
<div class="col-2 text-right">
<output id="anim-position-readout">10s</output>
</div>
<div class="col-3 pl-3">
<label for="anim-length">Length</label>
</div>
</div>
<div class="form-row mb-2">
<div class="col-9 center-mark">
<input type="range" min="0" max="1" step="any" value="1" class="form-control-range mt-2" id="anim-position">
</div>
<div class="col-3 pl-3 pr-2">
<div class="input-group input-group-sm">
<input type="number" min="1" value="10" class="form-control text-right" id="anim-length" aria-describedby="anim-length-units">
<div class="input-group-append">
<span class="input-group-text bg-dark text-white" id="anim-length-units">s</span>
</div>
</div>
</div>
</div>
<div class="form-row" id="play-preview-row">
<div class="col-5">
<div class="form-check mt-1">
<input class="form-check-input" type="radio" name="play-preview" id="play-preview-fast" value="1">
<label class="form-check-label small" for="play-preview-fast">
High performance preview
</label>
</div>
</div>
<div class="col-3">
<div class="form-check mt-1">
<input class="form-check-input" type="radio" name="play-preview" id="play-preview-detail" value="0">
<label class="form-check-label small" for="play-preview-detail">
Full detail
</label>
</div>
</div>
<div class="col-1 text-right">
<button type="button" class="btn btn-sm" title="Rewind animation" id="btn-rewind">
<img src="img/control_rewind_blue.png" width="24" height="24" alt="Rewind">
</button>
</div>
<div class="col-3 pl-3 pr-2">
<button type="button" class="btn btn-sm btn-dark w-100" id="btn-anim-opts" title="Advanced animation options">More…</button>
</div>
</div>
</form>
</div>
</div>
<button type="button" class="btn toolbar-btn" data-toggle="modal" data-target="#save-pic-modal" title="Download picture">
<img width="32" height="32" src="img/picture_save.png" alt="Download">
<span class="overlay-label">Save image</span>
</button>
<button type="button" class="btn toolbar-btn" id="btn-video-opts" title="Create video">
<img width="32" height="32" src="img/film.png" alt="Video">
<span class="overlay-label">Video</span>
</button>
<div class="btn-group" id="save-dropdown" hidden>
<button type="button" class="btn toolbar-btn" id="btn-save-form" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="Save parameters">
<img width="32" height="32" src="img/diskette.png" alt="Save">
<span class="overlay-label">Save</span>
</button>
<div class="dropdown-menu dropdown-menu-right bg-black" aria-labelledby="btn-save-form" style="width: 375px">
<form class="px-2" id="save-form">
<div class="form-group">
<label for="work-title">Title</label>
<input type="text" required class="form-control form-control-sm" id="work-title" autocomplete="off" pattern="\s*\S\S.*" title="Must be at least 2 characters long.">
</div>
<div class="form-group">
<label for="work-keywords">Keywords</label>
<input type="text" class="form-control form-control-sm" id="work-keywords" aria-describedby="work-keywords-help">
<small id="work-keywords-help" class="form-text text-muted">
Separate your keywords using commas.
</small>
</div>
<output id="save-result"></output>
<div class="text-right">
<button type="submit" class="btn btn-primary btn-sm" id="btn-save">Save & Share</button>
</div>
</form>
</div>
</div>
<button type="button" class="btn toolbar-btn" id="btn-full-screen" title="Toggle full screen">
<img width="32" height="32" src="img/slideshow_full_screen.png" alt="Full Screen">
<span class="overlay-label">Toggle Full Screen</span>
</button>
<button type="button" class="btn toolbar-btn" id="btn-what-is-this" title=""What's This?" Help">
<img width="32" height="32" src="img/what-is-this.svg" alt="What's This?">
<span class="overlay-label">What's this?</span>
</button>
<button type="button" class="btn toolbar-btn" data-toggle="modal" data-target="#help-modal" title="Help">
<img width="32" height="32" src="img/help_32.png" alt="Help">
<span class="overlay-label">General help</span>
</button>
</div>
</div>
<div class="modal modal-floating fade p-0" id="background-gen-modal" tabindex="-1" role="dialog" aria-labelledby="background-gen-modal-label" aria-hidden="true" data-backdrop="false">
<div class="modal-dialog m-0" role="document">
<div class="modal-content">
<div class="modal-header d-none d-md-flex">
<h6 class="modal-title" id="background-gen-modal-label"></h6>
<button type="button" class="window-gadget collapse-gadget" title="Collapse">
<img src="img/collapse.svg" width="13" height="13" alt="Collapse">
</button>
<button type="button" class="window-gadget close" data-dismiss="modal" title="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body collapse show" id="background-gen-options">
<!-- JavaScript generated content goes here.-->
</div>
</div>
</div>
</div>
<div class="modal modal-floating fade p-0 max-w-fit" id="layers-modal" tabindex="-1" role="dialog" aria-labelledby="layers-modal-title" aria-hidden="true" data-backdrop="false" style="min-width: 300px">
<div class="modal-dialog m-0" role="document">
<div class="modal-content">
<div class="modal-header d-none d-md-flex">
<h6 class="modal-title" id="layers-modal-title">Layers</h6>
<button type="button" class="window-gadget collapse-gadget" title="Collapse">
<img src="img/collapse.svg" width="13" height="13" alt="Collapse">
</button>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body collapse show">
<ul class="nav nav-tabs mb-3" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="background-layer-tab" data-toggle="tab" href="#background-layer" role="tab" aria-controls="background-layer" aria-selected="true">
Background
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="layers-tab" data-toggle="tab" href="#layers" role="tab" aria-controls="layers" aria-selected="false">
Sketch
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="background-layer" role="tabpanel" aria-labelledby="background-layer-tab">
<div class="form-row form-group">
<label class="col-3 col-form-label col-form-label-sm" for="background-preset">
Backdrop
</label>
<div class="col-9">
<select class="form-control form-control-sm" id="background-preset">
<option value="color">One Colour</option>
<option value="brick">Brick Wall</option>
<option value="brick-close-up">Brick (Close-Up)</option>
<option value="cardboard">Cardboard</option>
<option value="carpet">Carpet</option>
<option value="clay">Clay</option>
<option value="concrete">Concrete</option>
<option value="cork-board">Cork Board</option>
<option value="grass">Grass</option>
<option value="laminate">Laminate</option>
<option value="leaves">Leaves</option>
<option value="log">Log</option>
<option value="paper">Paper</option>
<option value="slate">Slate</option>
<option value="stone">Stone</option>
<option value="stone-2">Stone 2</option>
<option value="stone-wall">Stone Wall</option>
<option value="stone-wall-2">Stone Wall 2</option>
<option value="water">Water</option>
<option value="wood">Wood</option>
<option value="wood-2">Wood 2</option>
<option value="wood-3">Wood 3</option>
<option value="wood-4">Wood 4</option>
<option value="wood-floor">Wood Floor</option>
<option value="wood-floor-2">Wood Floor 2</option>
</select>
</div>
</div>
<div class="form-row collapse show" id="background-color-row">
<label class="col-3 col-form-label col-form-label-sm" for="background-color">
Colour
</label>
<div class="col-2">
<input type="color" value="#ffffff" class="w-100 mt-1" id="background-color">
</div>
</div>
</div>
<div class="tab-pane" id="layers" role="tabpanel" aria-labelledby="layers-tab" style="width: 460px">
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-2 col-form-label col-form-label-sm" for="layer-opacity">
Opacity
</label>
<div class="col-9">
<input type="range" min="0" max="1" step="0.004" value="1" class="form-control-range mt-2" id="layer-opacity">
</div>
</div>
<div class="form-row mb-2">
<div class="col-1"></div>
<label class="col-2 col-form-label col-form-label-sm" for="layer-rotation">
Rotation
</label>
<div class="col-7">
<input type="range" min="-1" max="1" value="0" step="0.002" class="form-control-range mt-2" id="layer-rotation">
</div>
<div class="col-2 text-center">
<button type="button" class="btn btn-light py-0" id="layer-rotation-reset" title="Reset rotation">
<img width="16" height="16" src="img/cross.png" alt="Reset">
</button>
</div>
</div>
<div class="form-row form-group" id="rotation-sizing-row" style="height: 160px">
<div class="col-4" title="No adjustment">
<div class="form-check text-center px-2 pb-1 rounded-lg">
<label class="form-check-label mb-2" for="rotation-size-screen">
<img src="img/rotate-as-is.png" class="w-100" loading="lazy" alt="No adjustment">
</label>
<input type="radio" name="rotation-sizing" value="1" id="rotation-size-screen" aria-label="Rotate without any size adjustment" checked>
</div>
</div>
<div class="col-4" title="Fit screen">
<div class="form-check text-center px-2 pb-1 rounded-lg">
<label class="form-check-label mb-2" for="rotation-size-square">
<img src="img/rotate-square.png" class="w-100" loading="lazy" alt="Fit screen">
</label>
<input type="radio" name="rotation-sizing" value="0" id="rotation-size-square" aria-label="Fit everything on screen when rotating">
</div>
</div>
<div class="col-4" title="Fill screen">
<div class="form-check text-center px-2 pb-1 rounded-lg">
<label class="form-check-label mb-2" for="rotation-size-fill">
<img src="img/rotate-hypotenuse.png" class="w-100" loading="lazy" alt="Fill screen">
</label>
<input type="radio" name="rotation-sizing" value="2" id="rotation-size-fill" aria-label="Always fill the screen when rotating">
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-2 col-form-label col-form-label-sm" for="layer-scale">
Size
</label>
<div class="col-9">
<input type="range" min="0" max="1" step="0.005" value="1" class="form-control-range mt-2" id="layer-scale">
</div>
</div>
<div class="form-row">
<label class="col-1"></label>
<label class="col-2 col-form-label col-form-label-sm" for="layer-blur">
Blur
</label>
<div class="col-9">
<input type="range" min="0.4" max="1" step="0.01" value="0.4" class="form-control-range mt-2" id="layer-blur">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade2" id="sketches-modal" tabindex="-1" role="dialog" aria-labelledby="sketches-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="sketches-modal-title">Choose A Sketch</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close" hidden>
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="card-deck btn-group-toggle thumbnails m-0 px-1 border" data-toggle="buttons" id="sketch-list" style="min-height: calc(5.45rem + 174px)">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" hidden>Cancel</button>
<button class="btn btn-primary" id="btn-open-sketch" disabled>Select</button>
</div>
</div>
</div>
</div>
<div id="background-gen-image" hidden>
<input type="file" id="background-gen-image-upload" accept="image/*" hidden>
<label class="btn btn-form btn-sm mb-0" for="background-gen-image-upload">Browse…</label>
</div>
<div class="modal fade2" id="assign-bg-change-modal" tabindex="-1" role="dialog" aria-labelledby="assign-bg-change-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="assign-bg-change-modal-title">Unsaved Changes</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p class="form-text">
You have outstanding changes. How do you wish to proceed?
</p>
<ul class="list-unstyled mb-0">
<li class="mb-2">
<button type="button" class="btn btn-primary w-100" id="btn-start-frame2" data-dismiss="modal">
Change start frame
</button>
</li>
<li class="mb-2">
<button type="button" class="btn btn-primary w-100" id="btn-end-frame2" data-dismiss="modal">
Change end frame
</button>
</li>
<li class="mb-2">
<button type="button" class="btn btn-secondary w-100" id="btn-both-frames2" data-dismiss="modal">
Change both frames
</button>
</li>
<li class="mb-2">
<button type="button" class="btn btn-danger w-100" id="btn-bg-change-discard" data-dismiss="modal">
Discard changes
</button>
</li>
<li>
<button type="button" class="btn btn-secondary w-100" data-dismiss="modal">
Cancel
</button>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="modal fade2" id="play-mode-modal" tabindex="-1" role="dialog" aria-labelledby="play-mode-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="play-mode-modal-title">Playback Mode</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p class="form-text">
How do you wish to play this animation?
</p>
<ul class="list-unstyled">
<li class="mb-2">
<button type="button" class="btn btn-primary w-100 text-left" id="btn-play-fast" value="1" data-dismiss="modal">
<h5>High Performance Preview Mode</h5>
<div class="font-italic pl-1">
Some finer details not drawn but smoother animation.
</div>
</button>
</li>
<li>
<button type="button" class="btn btn-dark w-100 text-left" id="btn-play-detail" value="0" data-dismiss="modal">
<h5>Fully Detailed Playback</h5>
<div class="font-italic pl-1">
All details drawn but might be more jerky.
</div>
</button>
</li>
</ul>
<p class="form-text">
You can change your mind at any time by clicking on the arrow next to the play button. When you save an image or a video it always includes every detail.
</p>
</div>
</div>
</div>
</div>
<div class="modal fade2" id="anim-opts-modal" tabindex="-1" role="dialog" aria-labelledby="anim-opts-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="anim-opts-modal-title">Animation Options</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-row form-group">
<div class="col-1"></div>
<div class="col-3 col-form-label col-form-label-sm">
Looping
</div>
<div class="col-7">
<div class="form-check mt-1">
<input class="form-check-input" type="checkbox" id="anim-loop">
<label class="form-check-label small" for="anim-loop">
Rollback some parameters to their start positions
</label>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm">
Full Rotations
</label>
<div class="col-2">
<input type="number" min="0" value="0" id="background-rotations" class="form-control form-control-sm">
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="modal fade2" id="video-modal" tabindex="-1" role="dialog" aria-labelledby="video-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="video-modal-title">Video Rendering</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="video-modal-body">
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm" for="video-resolution">
Resolution
</label>
<div class="col-7 col-md-5">
<select class="form-control form-control-sm w-100" id="video-resolution">
<option value="640x360">360p</option>
<option value="854x480">480p</option>
<option value="1280x720">720p</option>
<option value="1920x1080">1080p</option>
</select>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm" for="video-framerate">
Frame Rate
</label>
<div class="col-7 col-md-5">
<div class="input-group input-group-sm">
<input type="number" min="1" value="50" class="form-control" id="video-framerate" list="framerate-list" aria-describedby="framerate-units">
<datalist id="framerate-list">
<option>60</option>
<option>50</option>
<option>30</option>
<option>25</option>
<option>20</option>
<option>15</option>
<option>12</option>
<option>10</option>
<option>6</option>
<option>5</option>
<option>4</option>
<option>3</option>
<option>2</option>
<option>1</option>
</datalist>
<div class="input-group-append w-60">
<span class="input-group-text w-100" id="framerate-units">FPS</span>
</div>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm" for="video-format">
Format
</label>
<div class="col-7 col-md-5">
<select class="form-control form-control-sm" id="video-format">
<option value="webm" selected>WebM Video</option>
<option value="jpg">JPEG Images</option>
<option value="png">PNG Images</option>
<option value="webp">WebP Images</option>
</select>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm" for="video-quality">
Quality
</label>
<div class="col-5 col-md-4">
<input type="range" min="0" max="100" value="85" class="form-control-range mt-2" id="video-quality" aria-describedby="video-quality-readout">
</div>
<div class="col-2 col-md-1">
<output id="video-quality-readout" class="small">85%</output>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<label class="col-3 col-form-label col-form-label-sm" for="motion-blur">
Motion Blur
</label>
<div class="col-7 col-md-5">
<div class="input-group input-group-sm">
<input type="number" min="0" value="0" class="form-control" id="motion-blur" aria-describedby="motion-blur-units">
<div class="input-group-append w-60">
<span class="input-group-text w-100" id="motion-blur-units">frames</span>
</div>
</div>
</div>
</div>
<div class="form-row form-group align-items-center invisible" id="video-progress-row">
<div class="col-1"></div>
<div class="col-2 col-form-label col-form-label-sm">
Progress
</div>
<div class="col-1">
<img src="img/record.png" width="16" height="16" loading="lazy" alt="Recording" id="recording-indicator">
</div>
<div class="col-8">
<div class="progress bg-dark" style="height: 20px">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0; transition: unset" id="video-progress">0%</div>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-1"></div>
<div class="col-11">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="notify-video-render">
<label class="form-check-label small" for="notify-video-render">
Show a pop-up notification when finished.
</label>
</div>
</div>
</div>
<div class="alert alert-danger fade" id="video-error" hidden></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" id="btn-cancel-video-render">
Close
</button>
<button type="button" class="btn btn-dark" hidden id="btn-pause-video-render" style="width: 7em;"><img width="16" height="16" src="img/control_pause.png" class="mr-1">
Pause
</button>
<button type="button" class="btn btn-primary" id="btn-render-video">
Make Video
</button>
</div>
</div>
</div>
</div>
<div class="modal fade2" id="save-pic-modal" tabindex="-1" role="dialog" aria-labelledby="save-pic-modal-title" aria-hidden="true">
<div class="modal-dialog" role="document">
<form id="export-form" class="modal-content">
<div class="modal-header">
<h6 class="modal-title" id="save-pic-modal-title">Export Picture</h6>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="form-row form-group">
<label class="col-3 col-form-label col-form-label-sm" for="pic-resolution-x">
Resolution
</label>
<div class="col-6">
<div class="input-group input-group-sm">
<input type="number" min="40" step="10" list="pic-resolution-x-px" class="form-control" id="pic-resolution-x">
<datalist id="pic-resolution-x-px">
<option>1920</option>
<option>1366</option>
<option>1280</option>
<option>1024</option>
<option>640</option>
</datalist>
<div class="input-group-prepend input-group-append">
<span class="input-group-text">×</span>
</div>
<input type="number" min="40" step="10" list="pic-resolution-y-px" class="form-control" id="pic-resolution-y">
<datalist id="pic-resolution-y-px">
<option>1080</option>
<option>768</option>
<option>720</option>
<option>480</option>
<option>360</option>
</datalist>
</div>
</div>
<div class="col-auto pl-0">
<select id="pic-resolution-units" class="form-control form-control-sm">
<option value="px">pixels</option>
<option value="in">in</option>
<option value="mm">mm</option>
</select>
</div>
</div>
<div class="form-row form-group collapse">
<label class="col-3 col-form-label col-form-label-sm" for="pic-dpi">
DPI
</label>
<div class="col-3">
<input type="number" min="50" step="50" value="300" class="form-control form-control-sm" id="pic-dpi">
</div>
</div>
<div class="form-row form-group">
<label class="col-3 col-form-label col-form-label-sm" for="pic-format">
Format
</label>
<div class="col-3">
<select class="form-control form-control-sm" id="pic-format">
<option value="jpg">JPEG</option>
<option value="png" selected>PNG</option>
<option value="webp">WebP</option>
</select>
</div>
</div>
<div class="form-row form-group">
<label class="col-3 col-form-label col-form-label-sm" for="pic-quality">
Quality
</label>
<div class="col-7">
<input type="range" min="0" max="100" value="85" disabled class="form-control-range mt-2" id="pic-quality" aria-describedby="pic-quality-readout">
</div>
<div class="col-auto">
<output id="pic-quality-readout" class="small">N/A</output>
</div>
</div>
<div class="form-row form-group">
<div class="col-3 col-form-label col-form-label-sm">
Rendering
</div>
<div class="col-8">
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-render" id="pic-render-resize" value="0" checked>
<label class="form-check-label small" for="pic-render-resize">
Enlarge or reduce the currently displayed image
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-render" id="pic-render-redraw" value="1">
<label class="form-check-label small" for="pic-render-redraw">
Create an image as if the window was the this size
</label>
</div>
<div>
<small class="form-text text-muted">
Tip: Leave either the width or the height empty to minimize distortion caused by resizing.
</small>
</div>
</div>
</div>
<div class="form-row form-group" id="pic-same-orientation" hidden>
<div class="col-3 col-form-label col-form-label-sm">
Orientation
</div>
<div class="col-8">
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-rotation" id="pic-rotation-0" value="0">
<label class="form-check-label small" for="pic-rotation-0">
As is
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-rotation" id="pic-rotation-180" value="180">
<label class="form-check-label small" for="pic-rotation-180">
Upside down
</label>
</div>
</div>
</div>
<div class="form-row form-group" id="pic-other-orientation" hidden>
<div class="col-3 col-form-label col-form-label-sm">
Orientation
</div>
<div class="col-8">
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-rotation" id="pic-rotation-90" value="90">
<label class="form-check-label small" for="pic-rotation-90">
Clockwise rotation
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="pic-rotation" id="pic-rotation-270" value="270">
<label class="form-check-label small" for="pic-rotation-270">
Anticlockwise rotation
</label>
</div>
</div>
</div>
<div class="form-row form-group">
<div class="col-3 col-form-label col-form-label-sm">
Background
</div>
<div class="col-8">
<div class="form-check">
<input class="form-check-input" type="radio" name="paper-type" id="paper-type-color" value="color" checked>
<label class="form-check-label small" for="paper-type-color">
Include background colour
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="paper-type" id="paper-type-transparent" value="transparent">
<label class="form-check-label small" for="paper-type-transparent">
Transparent background
</label>
</div>
</div>
</div>
<div class="form-row form-group align-items-center invisible">
<div class="col-3 col-form-label col-form-label-sm">
Progress
</div>
<div class="col-1">
<img src="img/record.png" width="16" height="16" loading="lazy" alt="Rendering" id="rendering-indicator">
</div>
<div class="col-auto col-form-label col-form-label-sm" id="pic-progress">
</div>
</div>
<div class="form-row form-group">
<div class="col-3"></div>
<div class="col-8">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="notify-pic-render">
<label class="form-check-label small" for="notify-pic-render">
Show a pop-up notification when finished.
</label>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" id="btn-cancel-pic-render">
Close
</button>
<button type="button" class="btn btn-dark" hidden id="btn-pause-pic-render" style="width: 7em;"><img width="16" height="16" src="img/control_pause.png" class="mr-1">
Pause
</button>
<a class="btn btn-primary" href="#" id="btn-render-pic" role="button">
Export Picture
</a>
</div>
</form>
</div>
</div>
<div class="modal fade2" id="help-modal" tabindex="-1" role="dialog" aria-labelledby="help-intro-tab" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<ul class="nav nav-tabs bg-transparent p-0" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="help-intro-tab" data-toggle="tab" href="#help-intro" role="tab" aria-controls="help-intro" aria-selected="true">
Help
</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" id="help-sketch-tab" data-toggle="tab" href="#help-sketch" role="tab" aria-controls="help-sketch">
About this Sketch
</a>
</li>
</ul>
<button type="button" class="window-gadget close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" class="align-text-top">×</span>
</button>
</div>
<div class="modal-body pt-2">
<div class="tab-content px-1 text-justify-md">
<div class="tab-pane show active h-100" id="help-intro" role="tabpanel" aria-labelledby="help-intro-tab">
<h5>Welcome to Mathematical Art With Elizabeth!</h5>
<p>Mathematical art, also known as algorithmic art, generative art or creative coding is using geometry to make art. I've created a collection of sketches, each of which produces a simple figure as a starting point for creation. Your task is to adjust the parameters to create something visually appealing. The finished piece will combine my programming, your choice of parameter settings, and in some cases pseudorandom aspects generated by the computer. Most activities are initiated using either the parameters window (which will appear shortly) or the buttons located in the bottom-right corner. On mobile devices, click on <img src="img/palette.png" width="37" height="37" alt="Palette"> to reveal other buttons. Click on <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/help.png" alt="Help"></span> at any time to see this window again. Under <i>About this Sketch</i> at the top of this window you can read some introductory information about the current sketch. Use the "What's this?" button <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/what-is-this.svg" alt="What's This?" width="16"></span> to get help with a particular item.</p>
<h5>Animation</h5>
Use the parameters window to edit the image. You may need to scroll down to see some parameters. When you're happy with the result then click to capture the image for use as either the start frame <span class="btn btn-sm toolbar-btn btn-black"><img src="img/timeline_marker_start.png" alt="Start Frame" width="16" height="16"></span> or the end frame <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/timeline_marker_end.png" alt="End Frame" width="16" height="16"></span>. That picture will become either the starting point or the finishing point of the animation respectively. After you have one frame marked for animation then change the parameters to design a second image that you'd like to appear at the other end of the animation. Mark this image as an animation frame too. Once you have both a start frame and an end frame marked then you're ready to play back your animation <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/control_play_blue.png" alt="Play" width="16" height="16"></span>. You can make the animation longer or shorter by clicking on the arrow next to the play icon. With a subsequent click on the <span class="btn btn-sm btn-dark d-inline-block">More…</span> button you can find more advanced animation options.</p>
<h5>Saving</h5>
<p>To save your animation as a video file click on <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/film.png" alt="Video" width="16" height="16"></span>. Alternatively, click <span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/picture_save.png" alt="Download" width="16" height="16"></span> to save the current image as a photo. You can even add an artist's signature to your creations by clicking in the bottom-left corner of the main display.</p>
<h5>Other Icons</h5>
<dl class="row mx-1">
<dt class="col-1 mb-2">
<span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/module.png" alt="Sketch" width="16" height="16"></span>
</dt>
<dd class="col-11">
Let's you choose a different sketch to experiment with.
</dd>
<dt class="col-1 mb-2">
<span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/gear_in.png" alt="Parameters" width="16" height="16"></span>
</dt>
<dd class="col-11">
Opens or closes the sketch parameters window.
</dd>
<dt class="col-1 mb-2">
<span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/dice.png" alt="Dice" width="16" height="16"></span>
</dt>
<dd class="col-11">
Creates a new image using a different set of random numbers (only available in certain sketches).
</dd>
<dt class="col-1 mb-2">
<span class="btn btn-sm toolbar-btn btn-black d-inline-block"><img src="img/layers.png" width="16" height="16" alt="Layers"></span>
</dt>
<dd class="col-11">
Opens the layers window, which lets you place a background behind your creation. You can also rotate and resize the sketch layer from here.
</dd>
</dl>
<h5>Getting Involved</h5>
<p>If you find anything broken then please report it on <a href="https://github.com/mathematical-art/mathematical-art.github.io/issues" target="_blank" rel="noopener"> GitHub</a>. Feel free to make suggestions for future enhancements there too. I hope you enjoy the site, whether your interests are art, maths, entertainment, relaxing visual stimuli, or something else. If you want to and are able to then please consider supporting my work via <a href="https://www.patreon.com/bePatron?u=23440273" target="_blank" rel="noopener">Patreon</a> or by sharing a link on social media.</p>
<h5 id="licence">Licence Agreement</h5>
<p>This website may be used without charge subject to the following conditions.</p>
<ol>
<li class="mb-2">
Images and videos produced by the software may only be used for non-commercial or educational purposes.
</li>
<li class="mb-2">
If you distribute images or videos produced by the software to others, including as part of a derivative work, then you must include the text "Made with <span id="site-url"></span>" in an 11pt font or larger and make it a hyperlink if possible.
</li>
<li class="mb-2">
All computer code is copyright © Elizabeth Hudnott 2019–2022, except for third-party libraries found in /lib. All rights reserved.
</li>
</ol>
<p>
Contact me via the app's <a href="https://www.facebook.com/MathArtLizzy" target="_blank" rel="noopener">Facebook page</a> to arrange alternative licensing if you want to use images or videos for commercial purposes.
</p>
<p>The background images were produced by <a href="http://www.highresolutiontextures.com/hello-world" target="_blank" rel="noopener">highresolutiontextures.com</a> and other free sites. This site contains icons licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> from <a target="_blank" rel="noopener" href="http://www.fatcow.com/free-icons">fatcow.com</a> and <a target="_blank" rel="noopener" href="https://www.iconshock.com">iconshock</a>. You may use these backgrounds and icons in your own projects.</p>
<div class="form-check">
<input class="form-check-input" id="accept-licence" type="checkbox">
<label class="form-check-label" for="accept-licence">
I have read and accept the terms of the licence agreement.
</label>
</div>
<div class="form-check">
<input class="form-check-input" id="show-welcome" type="checkbox" checked>
<label class="form-check-label" for="show-welcome">
Show this window at start-up.