-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (109 loc) · 4.43 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Chaos Game Application">
<meta name="keywords" content="mathematics, maths, chaos, chaos game, chaos game application, educational">
<meta name="author" content="Matteo Bramardi">
<title>Chaos Game</title>
<link rel="icon" type="image/png" href="images/icon.png" />
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/chaosgame.css">
</head>
<body style="display: block; padding: 0; margin: 0; overflow: hidden; background-color: #000000;">
<!-- Controls -->
<div class="controls non-selectable">
<!-- Settings Dot -->
<span class="control-button settings-dot" tabindex="0" onclick="toggleSettings()"></span>
<!-- Reload -->
<span style="margin-left: 10px;">
<span class="control-button reload" onclick="resetRender()">
↻
</span>
</span>
</div>
<!-- Settings Menu Panel -->
<div id="settings-panel" class="side-nav">
<!-- Figure -->
<div style="margin-top: 5px;">
<span class="text">
# vertices:
<input id="vertices" class="input-box" type="text" maxlength="2" value="5"
onchange="changeFigure(this.value);">
</span>
</div>
<!-- Rules -->
<div style="margin-top: 10px;">
<span class="text">
prevent previous
<input id="preventPrevious" class="input-box" type="text" maxlength="2" value="0"
onchange="changeRules(this.value, this.id);">
</span>
</div>
<div style="margin-top: 10px;">
<span class="text">
if previous
<input id="endEqual" class="input-box" type="text" maxlength="2" value="2"
onchange="changeRules(this.value, this.id);">
are =,
</span>
<br>
<span class="text">
can't be placed
<input id="removedDistance" class="input-box" type="text" maxlength="2" value="1"
onchange="changeRules(this.value, this.id);">
</span>
away
<span class="text">
<br>
from previous
<input id="compareIndex" class="input-box" type="text" maxlength="2" value="1"
onchange="changeRules(this.value, this.id);">
</span>
</div>
<div style="margin-top: 10px;">
<span class="text">
factor:
<input id="chaosFactor" class="input-box" type="text" maxlength="4" value="0.5" style="width: 30px;"
onchange="changeRules(this.value, this.id);">
</span>
</div>
<!-- Style-->
<div style="margin-top: 10px;">
<span class="text">
point width:
<input id="pointWidth" class="input-box" type="text" maxlength="4" value="0.1" style="width: 30px;"
onchange="changeStyle(this.value, this.id);">
</span>
<br>
<span class="text">
iterations:
<input id="iterations" class="input-box" type="text" maxlength="7" value="1000" style="width: 60px;"
onchange="changeStyle(this.value, this.id);">
</span>
<br>
<span class="text">
pts per iteration:
<input id="drawingSpeed" class="input-box" type="text" maxlength="4" value="500" style="width: 35px;"
onchange="changeStyle(this.value, this.id);">
</span>
</div>
<div style="margin-top: 10px;">
</div>
</div>
<!-- Canvas Container -->
<div id="main" style="position: absolute; top: 0"></div>
<script>
let settingsOpen = true;
function toggleSettings() {
settingsOpen = !settingsOpen;
document.getElementById("settings-panel").style.left = settingsOpen ? "0" : "-350px";
}
</script>
<script src="https://cdn.jsdelivr.net/npm/p5@1.3.1/lib/p5.js"></script>
<script src="js/chaosgame.js"></script>
</body>
</html>