-
Notifications
You must be signed in to change notification settings - Fork 1
/
index2.html
311 lines (308 loc) · 13.7 KB
/
index2.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
<!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'">
<link href="./styles.css" rel="stylesheet">
<!-- You can also require other files to run in this process -->
<title>Fractal Generator</title>
</head>
<body>
<div class="main-container">
<!-- <header class="text-center">
<h1>Fractal Generator</h1>
</header> -->
<div class="canvas" id="canvas">
<!-- fractal image canvas goes here -->
</div> <!-- /.canvas -->
<div id="buttons" class="buttons text-center font-8 width-80">
<div class="tooltip">
<img class="button" id="btnReset" src="./resources/btnReset.png" />
<span class="tooltiptext">Reset settings</span>
</div>
<div class="tooltip">
<img class="button" id="btnZoomIn" src="./resources/btnZoomIn.png" />
<span class="tooltiptext">Zoom in</span>
</div>
<div class="tooltip">
<img class="button" id="btnZoomOut" src="./resources/btnZoomOut.png" />
<span class="tooltiptext">Zoom out</span>
</div>
<div class="tooltip">
<img class="button" id="btnZoomAnimate" src="./resources/btnZoomAnimate.png" />
<span class="tooltiptext">Zoom animation</span>
</div>
<div class="tooltip">
<img class="button" id="btnMode" src="./resources/btnMode.png" />
<span class="tooltiptext">Switch modes</span>
</div>
<div class="tooltip">
<img class="button" id="btnVariant" src="./resources/btnVariant.png" />
<span class="tooltiptext">Cycle variants</span>
</div>
<div class="tooltip">
<img class="button" id="btnExponent" src="./resources/btnExponent.png" />
<span class="tooltiptext">Cycle exponent (2-6)</span>
</div>
<div class="tooltip">
<img class="button" id="btnColor" src="./resources/btnColor.png" />
<span class="tooltiptext">Cycle color theme</span>
</div>
<div class="tooltip">
<img class="button" id="btnColorUp" src="./resources/btnColorUp.png" />
<span class="tooltiptext">Shift color theme up</span>
</div>
<div class="tooltip">
<img class="button" id="btnColorDown" src="./resources/btnColorDown.png" />
<span class="tooltiptext">Shift color theme down</span>
</div>
<div class="tooltip">
<img class="button" id="btnJuliaDown" src="./resources/btnJuliaDown.png" />
<span class="tooltiptext">Rotate Julia Set clockwise</span>
</div>
<div class="tooltip">
<img class="button" id="btnJuliaUp" src="./resources/btnJuliaUp.png" />
<span class="tooltiptext">Rotate Julia Set anti-clockwise</span>
</div>
<div class="tooltip">
<img class="button" id="btnJuliaSpin" src="./resources/btnJuliaSpin.png" />
<span class="tooltiptext">Julia Set spin animation</span>
</div>
<div class="tooltip">
<img class="button" id="btnSave" src="./resources/btnSave.png" />
<span class="tooltiptext">Save image</span>
</div>
<div class="tooltip">
<img class="button" id="btnSettings" src="./resources/btnSettings.png" />
<span class="tooltiptext">Display settings</span>
</div>
<div class="tooltip">
<img class="button" id="btnHelp" src="./resources/btnHelp.png" />
<span class="tooltiptext">Display help</span>
</div>
</div> <!-- /.buttons -->
<div id="status" class="status text-center font-8 width-80">
<span id="cOffset"></span><span id="cJulia"></span>
<span id="zoom"></span><span id="exponent"></span><br>
<span id="setmode"></span><span id="setvar"></span>
<span id="theme"></span><span id="duration"></span>
<span id="size"></span>
</div> <!-- /.status -->
<div id="settings" class="settings font-8 width-80">
<h3>Settings</h3>
<div class="float-left width-wide">
<label class="wid2" for="selmode">Mode:</label>
<select id="selmode" name="selmode"></select>
<label class="padl10" for="selvariant">Variant:</label>
<select id="selvariant" name="selvariant"></select>
<label class="padl10" for="inpexp">Exponent:</label>
<input type="number" id="inpexp" name="inpexp" min="2" max="8"></select><br>
<label class="wid2" for="inpcoffre">c Offset re:</label>
<input type="text" id="inpcoffre" name="inpcoffre">
<label class="wid2" for="inpcoffim">im:</label>
<input type="text" id="inpcoffim" name="inpcoffim"><br>
<label class="wid2" for="inpcjulre">c Julia re:</label>
<input type="text" id="inpcjulre" name="inpcjulre">
<label class="wid2" for="inpcjulim">im:</label>
<input type="text" id="inpcjulim" name="inpcjulim"><br>
<label class="wid2" for="inpzoom">Zoom:</label>
<input type="text" id="inpzoom" name="inpzoom">
<label class="wid2" for="inpzoominc">Zoom Inc:</label>
<input type="text" id="inpzoominc" name="inpzoominc"><br>
<label class="wid2" for="inpangle">Rotate:</label>
<input type="text" id="inpangle" name="inpangle">
<label class="wid2" for="inpspininc">Spin Inc:</label>
<input type="text" id="inpspininc" name="inpspininc"><br>
<label class="wid2" for="seltheme">Color Theme:</label>
<select id="seltheme" name="seltheme"></select>
<label class="wid2" for="inpshift">Col Shift:</label>
<input class="wid2" id="inpshift" type="range" min=0 max=100 value=0><br>
<label class="wid2" for="inpmaxiter">Max Iter:</label>
<input type="text" id="inpmaxiter" name="inpmaxiter">
<label class="wid2" for="chkautoiter">Auto Iter:</label>
<input type="checkbox" id="chkautoiter" name="chkautoiter" value="1"><br>
<label class="wid2" for="selinterpolate">Interpolation:</label>
<select id="selinterpolate" name="selinterpolate"></select><br>
<label class="wid2" for="chkswapaxes">Swap X/Y:</label>
<input type="checkbox" id="chkswapaxes" name="chkswapaxes">
</div>
<div class="float-right width-small">
<button id="btnApply">APPLY</button>
</div>
</div>
</div> <!-- ./settings -->
<div id="palette" class="palette">
<h3>Generate Custom Color Gradient from Palette</h3>
<div class="float-left width-wide">
<label class="wid2" for="selpdepth">Palette Depth:</label>
<select id="selpdepth" name="selpdepth"></select>
<label class="wid3" for="selgdepth">Gradient Depth:</label>
<select id="selgdepth" name="selgdepth"></select>
<label class="wid2" for="selinterp">Interpolation:</label>
<select id="selinterp" name="selinterp"></select>
<p></p>
<label class="wid2" for="colorpicker">Color Picker:</label>
<input type="color" id="colorpicker" value="#555555">
<span>Click palettes below to set color from picker.</span>
<p></p>
<input type="text" id="color1" class="colpal">
<input type="text" id="color2" class="colpal">
<input type="text" id="color3" class="colpal">
<input type="text" id="color4" class="colpal">
<input type="text" id="color5" class="colpal">
<input type="text" id="color6" class="colpal">
<input type="text" id="color7" class="colpal">
<input type="text" id="color8" class="colpal">
<br>
<input type="text" id="color9" class="colpal">
<input type="text" id="color10" class="colpal">
<input type="text" id="color11" class="colpal">
<input type="text" id="color12" class="colpal">
<input type="text" id="color13" class="colpal">
<input type="text" id="color14" class="colpal">
<input type="text" id="color15" class="colpal">
<input type="text" id="color16" class="colpal">
</div>
<div class="float-right width-small">
<button id="btnPaint">PAINT</button>
</div>
</div> <!-- ./palette -->
<div id="help" class="help font-8 width-80">
<h3>How to use Fractal Generator</h3>
<table>
<tr>
<td class="instruct" colspan=2>Click anywhere in the image to zoom in at the current cursor position by the
zoom
increment amount.</td>
</tr>
<tr>
<td class="instruct" colspan=2>Click, drag and release to zoom into drawn area.</td>
</tr>
<tr>
<td class="instruct" colspan=2>Ctrl + Click to zoom out at current cursor position by zoom increment amount.
</td>
</tr>
<tr>
<td class="instruct" colspan=2>Shift + Click to centre at current cursor position.</td>
</tr>
<tr>
<td class="instruct" colspan=2>Alt(Option) + Click to toggle between Mandelbrot and Julia modes at current
cursor position (useful points of interest can be found just outside the perimeter of the Mandelbrot set).
</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnReset.png" /></td>
<td>Reset to default settings.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnZoomIn.png" /></td>
<td>Zoom in.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnZoomOut.png" /></td>
<td>Zoom out.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnZoomAnimate.png" /></td>
<td>Turn zoom animation on/off.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnMode.png" /></td>
<td>Cycle modes (Mandelbrot, Julia).</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnVariant.png" /></td>
<td>Cycle variants (Standard, Burning Ship, Tricorn).</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnExponent.png" /></td>
<td>Cycle exponent (integer 2-6).</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnColor.png" /></td>
<td>Cycle colot theme.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnColorUp.png" /></td>
<td>Shift color theme up.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnColorDown.png" /></td>
<td>Shift color theme down.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnJuliaDown.png" /></td>
<td>Rotate Julia set clockwise.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnJuliaUp.png" /></td>
<td>Julia set anti-clockwise.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnJuliaSpin.png" /></td>
<td>Turn Julia spin animation on/off.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnSave.png" /></td>
<td>Save current image.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnSettings.png" /></td>
<td>Open/close settings panel.</td>
</tr>
<tr>
<td><img class="icon" src="./resources/btnHelp.png" /></td>
<td>Open/close help panel.</td>
</tr>
</table>
<div id="custom_palette">
<h3>Creating Custom Color Gradients</h3>
<ol>
<li>Choose a palette depth of 4, 8, 12 or 16 colors.</li>
<li>Choose a gradient depth of 16, 32, 64, 128, 256 or 512 levels.</li>
<li>Choose the color interpolation method ('None' or 'Linear').</li>
<li>Create the palette by picking colors using the color picker widget and applying the selection to each
palette slot in turn.</li>
<li>Click 'PAINT'. A color gradient will be created dynamically and applied to the displayed fractal. </li>
<li>The custom color gradient will also be added to the list of available color rendering themes in the format
'User_x_nnn', where 'x' is an auto-incremented number and 'nnn' is the number of levels.</li>
</ol>
</div> <!-- /.custom_palette -->
<div id="navigation">
<h3>Navigating Mandelbrot and Julia Sets</h3>
<p>The Mandelbrot set can be considered a map to an infinite number of Julia sets. Pressing
Alt(Option) + Click or <img class="icon_small" src="./resources/btnMode.png" /> at various points around the
Mandelbrot set (or its variants) produces a variety of
Julia sets. The most interesting images can be found just outside the perimeter of the Mandelbrot set.</p>
<div class="text-center">
<span><img id="mapofjulias" src="./resources/mandelbrot_julia_600px.png" /></span>
</div>
<p>Mandelbrot variants like the so-called 'Burning Ship' can map to extraordinarily beautiful Julia sets.</p>
<div class="text-center">
<span><img id="burningship" src="./resources/burningship_600px.png" /></span>
</div>
<p>Julia sets can be 'rotated' about their origin by applying a polar rotation transformation to the
complex coordinate c in the equation z = zⁿ + c. By successively incrementing the rotation angle by pressing
the <img class="icon_small" src="./resources/btnJuliaSpin.png" /> button, a 'spinning Julia' animation can be
produced.
The frame rate or speed of rotation is governed by the 'Spin Inc' setting; smaller values produce slower and
more intricate rotations.
</p>
<div class="text-center">
<span><img id="juliaspin" src="./resources/juliaspin.gif" /></span>
</div>
</div> <!-- /.navigation -->
<p>
© Algol Variables 2021. Information and source code on
<a href="https://github.com/Algol-Variables/fractal-generator">GitHub.</a>
</p>
</div> <!-- /.help -->
</div> <!-- /.main-container -->
</body>
<script src="./complexlite.js"></script>
<script src="./colorutils.js"></script>
<script src="./fractalutils.js"></script>
<script src="./app.js"></script>
<script src="./renderer.js"></script>
</html>