forked from trpomoais2018/fg03-algebraicfractals
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
64 lines (64 loc) · 2.26 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
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="no-cache"/>
<script src="AlgFractals.js"></script>
<script>
HTMLCanvasElement.prototype.MouseCoords = function (event) {
var moveX = 0;
var moveY = 0;
var canvasX = 0;
var canvasY = 0;
var currentElement = this;
do {
moveX += currentElement.offsetLeft;
moveY += currentElement.offsetTop;
}
while (currentElement = currentElement.offsetParent)
canvasX = event.pageX - moveX;
canvasY = event.pageY - moveY;
canvasX = Math.round(canvasX * (this.width / this.offsetWidth));
canvasY = Math.round(canvasY * (this.height / this.offsetHeight));
return {
x: canvasX,
y: canvasY
}
}
</script>
</head>
<body onload="pressM(); run(0, 0, 'newtonPool');">
<canvas oncontextmenu="return false;" height='500' width='500' id='canvas'></canvas>
<table>
<tr>
<td colspan = "3">Fractal`s type:</td>
</tr>
<tr>
<td><button type="button" id = 'newtonPool' onclick="resetScale(); run(0, 0, 'newtonPool')">Newton Pool</button></td>
<td><button type="button" id = 'mandelbrotSet' onclick="resetScale(); resetScale(); run(0, 0, 'mandelbrotSet')">andelbrot</button></td>
<td><button type="button" id = 'juliaSet' onclick="resetScale(); run(0, 0, 'juliaSet')">Julia</button></td>
</tr>
<tr>
<td colspan = "3">Сoloring type:</td>
</tr>
<tr>
<td><button type="button" id = 'classicPaint' onclick="changeColor('classic')">Classic</button></td>
<td><button type="button" id = 'levelPaint' onclick="changeColor('levels')">Layer</button></td>
<td><button type="button" id = 'zebraPaint' onclick="changeColor('zebra')">Zebra</button></td>
</tr>
<tr>
<td colspan = "3">Julia characteristic:</td>
</tr>
<tr>
<td>Re: <input type ="number" id = "re" name = "re" value = "-0.12"></td>
<td>Im: <input type ="number" id = "im" name = "im" value = "0.74"></td>
</tr>
<tr>
<td colspan = "2">Max itteration <input type ="number" id = "n" name = "n" value = "200"></td>
</tr>
<tr>
<td><button type="button" onclick="resetScale(); run(0, 0)">Нарисовать</button></td>
</tr>
</table>
</body>
</html>