forked from pystub/webmona
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (45 loc) · 3.16 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>webmona</title>
<link rel="stylesheet" type="text/css" href="webmona.css">
<script type="text/javascript" src="webmona.js"></script>
</head>
<body onload="init()">
<canvas id="input-canvas" width="256px" height="256px"></canvas>
<canvas id="best-canvas" width="256px" height="256px"></canvas>
<canvas id="test-canvas" width="256px" height="256px"></canvas>
<br>
<input type='file' id='image-input' />
<small style="color:#555;">Image should be small (~200x200 pixels), otherwise fitness computation is very slow.
</small>
<br>
<button id="start" onclick="start()">Start</button><br>
<span id="fitness">95.77%</span> Fitness
<span id="step_benefit">3249</span> Improvements
<span id="step_total">585555</span> Mutations<br>
<button id="stop" onclick="stop()" style="display: none;">Stop</button>
<span id="time">52m 11s</span> Elapsed time<br>
<span id="mutsec">189.6</span> Mutations per second<br>
<textarea name="clipboard" id="clipboard" onclick="select_all();"></textarea><br>
<button id="b_export_dna" onclick="export_dna()">Export DNA</button>
<button id="b_export_svg" onclick="export_dna_as_svg()">Export SVG</button>
<button id="b_import_dna" onclick="import_dna()">Import DNA</button>
<br>
Mutation
<button id="b_mut_gauss" onclick="setMutation('gauss')" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">Gaussian</button>
<button id="b_mut_soft" onclick="setMutation('soft')" style="color: white; background-color: orange; background-position: initial initial; background-repeat: initial initial;">Soft</button>
<button id="b_mut_med" onclick="setMutation('medium')" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">Medium</button>
<button id="b_mut_hard" onclick="setMutation('hard')" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">Hard</button>
<button id="b_mut_new" onclick="setMutation('new')" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">new</button>
<br>
<button onclick="removePolygon()">-</button> <button onclick="addPolygon()">+</button> <span class="parname pargeo"><span id="polygons">50</span> Polygons</span>
<button onclick="removeVertex()">-</button> <button onclick="addVertex()">+</button> <span class="parname pargeo"><span id="vertices">6</span> Vertices</span>
<br>
Initialize DNA
<button id="b_dna_random" onclick="setDnaRandom()" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">Color</button>
<button id="b_dna_white" onclick="setDnaColor(254,254,254)" style="color: white; background-color: orange; background-position: initial initial; background-repeat: initial initial;">White</button>
<button id="b_dna_black" onclick="setDnaColor(0,0,0)" style="color: white; background-color: black; background-position: initial initial; background-repeat: initial initial;">Black</button>
</body>
</html>