-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
440 lines (293 loc) · 17.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
<!-- <meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'"> -->
<!-- <meta name="viewport" content="width=1024"> -->
<!-- <link rel="shortcut icon" href=""> -->
<script src="//cdnjs.cloudflare.com/ajax/libs/seedrandom/3.0.5/seedrandom.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="codemirror/codemirror-5.60.0/lib/codemirror.css">
<link rel="stylesheet" href="codemirror/codemirror-5.60.0/theme/night.css">
<link rel="stylesheet" href="codemirror/codemirror-5.60.0/theme/midnight.css">
<script src="codemirror/codemirror-5.60.0/lib/codemirror.js"></script>
<script src="codemirror/codemirror-5.60.0/mode/javascript/javascript.js"></script>
<!-- <link href="PROJ_default.json"> -->
<!-- <title>GenArt.Layers</title> -->
<title>genartlayers</title>
</head>
<body>
<div id="container">
<!-- <div>window-container</div> -->
<div class="window-frame">
<!-- <div class="additional-controls-bar-left"></div> -->
<!-- <div class="additional-controls-bar-middle"></div> -->
<div class="project-controls-bar">
<h3>Project:</h3>
<input class="filename-input" id="fpath">
<button type="button" class="open_project_button" id="read-json-button">Open</button>
<div style="display:flex; flex-direction: row; align-items:center; height:var(--height_window_frame);">
<button type="button" class="save_project_button" id="save-json-button">Save</button>
</div>
</div>
<!-- <button class="navbuttons" id="Tab99_Button" name="MainTab" style="margin-left:auto;">Info</button> -->
<a id="help_link" href="https://github.com/gaw1ik/genartlayers/wiki" target="_blank" rel="noopener noreferrer" style="margin-left:auto;">Documentation</a>
<button class="navbuttons" id="Tab98_Button" name="DocPropsTab" style="margin-left:auto;">Doc Props</button>
</div>
<div class="app-container">
<!-- DRAWING -->
<div class="app_left_side_container">
<div id="drawing_container_tool_bar">
<button class="drawing_container_tool_bar_button" id="axesOn_Button">
<img src="icons/icon - axesOn.svg" width=20 height=20>
</button>
<button class="drawing_container_tool_bar_button" id="gridOn_Button">
<img src="icons/icon - gridOn.svg" width=20 height=20>
</button>
</div>
<!-- THE CANVASES -->
<div id="drawing-container">
<canvas class="myCanvas" id="canvas4Wall"></canvas>
<canvas class="myCanvas" id="canvas4WallShadow"></canvas>
<canvas class="myCanvas" id="canvas4Export"></canvas>
<canvas class="myCanvas" id="canvas0"></canvas>
<canvas class="myCanvas" id="canvas1"></canvas>
<canvas class="myCanvas" id="canvas2"></canvas>
<canvas class="myCanvas" id="canvas3"></canvas>
<canvas class="myCanvas" id="canvas4"></canvas>
<canvas class="myCanvas" id="canvas5"></canvas>
<canvas class="myCanvas" id="canvas6"></canvas>
<canvas class="myCanvas" id="canvas7"></canvas>
<canvas class="myCanvas" id="canvas8"></canvas>
<canvas class="myCanvas" id="canvas4Frame"></canvas>
<canvas class="myCanvas" id="canvas4WallShot"></canvas>
</div>
</div>
<!-- GUI -->
<div class="app-container-item">
<!-- THE GUI -->
<div class="input-form-container" id="input-form-container">
<!-- INPUT FORM -->
<!-- <div class="input-form-container-2"> -->
<div id="input-form">
<!-- Main -->
<div id="Tab99" class="tabcontent" style="display:none">
<h2 style="text-align:center; font-weight:normal;"">Welcome!</h2>
<div id="Tab99Panel">
<h3></h3>
<p>Genartlayers is an app for coding, manipulating, and exporting generative art.</p>
<h4>If you're brand new here:</h4>
<p>Click the little [1] over there to the right. This will open up Layer 1 of the default project.
This project is just an example, but it's pretty fun to mess around with! Move the controls around
and see what happens.
</p>
<br>
<h4>To make your own algorithms:</h4>
<p>Select a layer from the right panel (e.g. [1] or [0]), and then click the <b>Code</b> tab. This will open up the code editors.</p>
<p>
The editor on the top is for Parameters which are variables you can control (like hue, width, etc), and the editor on the bottom is the Draw Function,
which is the code that tells genartlayers how to draw your art.
</p>
<p>
Take note of the example codes in the default project. Observe how parameters are defined and how the code is written.
Code in genartlayers is written in javascript, but there are many simplifications and included functions provided to you in genartlayers.
</p>
<p>
Poke around in the examples a bit to see how things get drawn. There's a lot of code in there, but everything comes down to drawing simple shapes
including rectangles, circles, and paths.
</p>
<h4>Basic shape functions:</h4>
<p>Genartlayers provides functions for drawing these basic shapes which are as follows:</p>
<UL>
<li>drawRect(x, y, width, height, lineWidth, hue, saturation, lightness, alpha, fillMode)</li>
<li>drawCircle(x, y, radius, lineWidth, hue, saturation, lightness, alpha, fillMode)</li>
<li>drawPath(path, lineWidth, hue, saturation, lightness, fillMode, close)</li>
</UL>
<h4>Saving Algorithms and Projects</h4>
<p>
After you make changes to your code, hit the SaveCode button to implement them. Make sure you give your code a unique name in the text field above the editors.
The layer that the code is on should redraw immediately unless there's an error in your code. Pro-tip: open your browser's console (ctrl+shift+i) to debug while you code.
</p>
<p>
You should also save your projects. A project is a collection of all the layers, algorithms, and parameter values that you have defined for a particular generative art piece.
</p>
<p>
To save a project, give it a name in the text field located top-left next to "Project:" and hit Save. When you return to genartlayers, type in your project's name and hit Open.
</p>
<p>Genartlayers uses your browser's local storage, so as long as you're accessing genartlayers from the same computer and internet browser, you can return to
your files and pick up where you left off.
</p>
<h4>Exporting images</h4>
<p>
I will add some buttons for this later, but for now, if you want to export an image of your piece type exportImg(width) into your browser's console
and hit enter. "width" is the width of the image in pixels you desire.
</p>
<p>Example: exportImg(2048)</p>
<p>Your browser should prompt you to download your image.</p>
<h4>A couple more things to know...</h4>
<UL>
<li>Units (e.g. x, y, radius, width, lineWidth, etc.) are fractional, meaning between 0 and 1. A height of 0.1 means 10% of the height of the canvas.
This ensures that no matter what size you want to export, your design will always look the same.
</li>
<li>The fillMode parameter in the basic shape functions is valued either 0 (for fill) or 1 (for stroke)</li>
</UL>
<p>Genartlayers uses the HSL color system and the value ranges are as follows:</p>
<UL>
<li>Hue: 0-359</li>
<li>Saturation: 0-100</li>
<li>Lightness: 0-100</li>
<li>Alpha: 0-255</li>
</UL>
<p>
I will provide more documentation soon, but hopefully if you're here, this can get you started. Please feel free to DM me on @genartlayers on instagram
at any time if you have any questions about how to do something in this application. I am here to answer your questions!
</p>
<p>-Brian </p>
<br>
</div>
<!-- <h4>Recent Saved Projects:</h4> -->
<div class="subsection" style="display:none">
<div id="recent-projects-list" ></div>
</div>
<div>
<a id="save_img_link"></a>
</div>
<!-- <h4>Save Project</h4> -->
<!-- <div class="subsection">
<div class="grid-container-Nx1">
</div>
</div> -->
</div>
<!-- Doc Properties -->
<div id="Tab98" class="tabcontent" style="display:none">
<!-- <br> -->
<h2 style="text-align:center; font-weight:normal;">Document Properties</h2>
<div id="Tab98ControlsPanel"></div>
</div>
<div id="Tab97" class="tabcontent" style="display:none">
<div id="UIandCodeTab">
<!-- <button type="button" class="reseed" id="openControlsPanel_Button">Controls</button>
<button type="button" class="reseed" id="openCodePanel_Button">Code</button> -->
<div id="Tab97" class="grid-container-Nx3" style="display:none; grid-template-columns: 6rem 1fr auto; grid-gap:0.2rem; padding:0; margin:1rem 0 1rem 0;">
<h3 id="layer_header"></h3>
</div>
<div class="editor_tools_bar">
<div style="display:flex; flex-direction: row; margin-right:auto; align-items:center;">
<h3>ALG:</h3>
<input class="layer_geom_input" name="LayerGeomInput">
<button type="button" class="load_code_button" id="load_code_button" style="width:3rem">Load</button>
</div>
<div style="display:flex; flex-direction: row; margin-right:auto; align-items:center;">
<button type="button" class="panel_buttons active" id="controls_panel_button">Controls</button>
<button type="button" class="panel_buttons" id="code_panel_button">Code</button>
</div>
<!-- <input type="range" class="controls_code_toggle" min="0" max="1" step:="1" value="0" id="ControlsCodeToggle"></input> -->
<!-- <button type="button" class="reseed" id="eval_code_button">Eval</button> -->
<button type="button" class="save_code_button" id="save_code_button">SaveAlg</button>
<!-- <input type="text" id="load_code_name_input"></input> -->
</div>
</div>
<div id="Tab97ControlsPanel"></div>
<div id="Tab97CodePanel"></div>
</div>
</div>
<!-- TABS -->
<div class="layer_controls_bar">
<h5 style="margin:5rem 0 1rem 0;">Layers</h5>
<div class="tab-bar" id="tabs">
<div class="layer_add_delete_container" id="add_delete_layer_buttons"">
<button class="layer_list_add_delete_buttons" id="LayerList_Add_Button" >
<img src="icons/icon - addLayer.svg" width=19 height=19>
</button>
<button class="layer_list_add_delete_buttons" id="LayerList_Delete_Button" >
<img src="icons/icon - deleteLayer.svg" width=19 height=19>
</button>
<button class="layer_list_add_delete_buttons" id="LayerList_MoveUp_Button">
<img src="icons/icon - moveLayerUp.svg" width=19 height=19>
</button>
<button class="layer_list_add_delete_buttons" id="LayerList_MoveDown_Button">
<img src="icons/icon - moveLayerDown.svg" width=19 height=19>
</button>
<button class="layer_list_add_delete_buttons" id="LayerList_Duplicate_Button">
<img src="icons/icon - duplicate.svg" width=19 height=19>
</button>
</div>
<div class="layers-container" id="layers-container">
<div class="tab-bar-layers-container" id="tab-bar-layers-container">
</div>
<div class="layer_vis_buttons_container" id="layer_vis_buttons_container">
</div>
</div>
</div>
</div>
<!-- </div> -->
</div>
</div>
<script>
// code_editor = document.getElementById("code_editor")
// editor = CodeMirror.fromTextArea(code_editor, {
// lineNumbers: true,
// mode: "javascript",
// theme: "midnight",
// });
// editor.setSize(null,"15rem");
</script>
</div>
<!-- Utilities -->
<script src="js/utilities01.js"></script>
<script src="js/jsUtilities.js"></script>
<script src="js/setTheme.js"></script>
<script src="js/updateDocObject.js"></script>
<!-- <script src="js/addLayer.js"></script> -->
<script src="js/layerCotrolStuff_02.js"></script>
<script src="js/randomizeParams.js"></script>
<script src="js/save2svg.js"></script>
<!-- <script src="js/codeEditorStuff2.js"></script> -->
<script src="js/codeEditorStuff_03.js"></script>
<!-- <script src="js/fromAlgorithm2Code.js"></script> -->
<!-- <script src="js/fromAlgorithm2Code_02.js"></script> -->
<script src="js/fromAlgorithmText2Code.js"></script>
<script src="js/bringInUserAlgs.js"></script>
<!-- <script src="js/bringInIncludedAlgs.js"></script> -->
<script src="js/bringInIncludedAlgs_02.js"></script>
<script src="js/drawAxes.js"></script>
<script src="js/drawGrid.js"></script>
<script src="js/drawing_container_tool_bar_stuff.js"></script>
<script src="js/quickParams.js"></script>
<!-- Doc -->
<script src="js/docDict.js"></script>
<!-- Basic Shape Drawing Functions -->
<script src="js/basicShapeFunctions/drawCircle.js"></script>
<script src="js/basicShapeFunctions/drawRect.js"></script>
<script src="js/basicShapeFunctions/drawPath.js"></script>
<script src="js/basicShapeFunctions/drawEllipse.js"></script>
<script src="js/basicShapeFunctions/drawArc.js"></script>
<script src="js/basicShapeFunctions/drawBezierPath.js"></script>
<script src="js/basicShapeFunctions/drawText.js"></script>
<!-- <script src="js/drawBlob.js"></script> -->
<!-- <script src="js/drawCircleBrushed_02.js"></script> -->
<!-- ALGORITHMS -->
<!-- <script src="/bg.txt"></script> -->
<!-- <script src="js/algorithms/trinket_06.js"></script>
<script src="js/algorithms/signature_01.js"></script>
<script src="js/algorithms/randomCircs_03.js"></script>
<script src="js/algorithms/stars_01.js"></script>
<script src="js/algorithms/fractalCirc_03.js"></script>
<script src="js/algorithms/clouds_01.js"></script>
<script src="js/algorithms/circleBrushed_01.js"></script> -->
<!-- Main Scripts -->
<script src="js/makeGUI_Sections.js"></script>
<!-- <script src="js/sketch.js"></script> -->
<script src="js/sketch_02.js"></script>
<script src="js/readWrite.js"></script>
<script src="js/layout.js"></script>
<script src="js/tabsScript.js"></script>
<script src="js/dashboard.js"></script>
<script src="js/saveImg.js"></script>
<script src="js/other/usefulConsoleUtilities.js"></script>
<!-- OTHER (Brian's Special Secret Functions Don't Use Unless Authorized) -->
<!-- <script src="js/other/updatePROJ_Tabs2Layers.js"></script> -->
</body>
</html>