-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
173 lines (153 loc) · 4.59 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Simulação de Contágio</title>
<style>
html,
body {
height: 100%;
text-align: center;
background-color: black;
font-family: Arial, Helvetica, sans-serif;
color: white;
}
a {
color: #FFF;
}
#canvas {
background-color: black;
border: 2px solid rgb(131, 131, 131);
}
#config {
margin: 5px auto;
padding: 10px;
width: 500px;
border: 1px solid #FFF;
box-sizing: border-box;
}
#config .row {
justify-content: space-between;
}
#graph {
background-color: #5fc1cf;
border: 2px solid rgb(131, 131, 131);
}
#label {
margin: 15px auto;
padding: 15px;
width: 500px;
border: 1px solid #FFF;
box-sizing: border-box;
}
.row {
display: flex;
}
.row p {
margin: 0;
padding-left: 10px;
}
.indicator {
width: 15px;
height: 15px;
border-radius: 100%;
}
.susceptible {
background-color: #5fc1cf;
}
.infected {
background-color: #f5644f;
}
.removed {
background-color: #505050;
}
.dead {
border: 1px solid #505050;
box-sizing: border-box;
}
</style>
</head>
<body>
<form id="config">
<div class="row">
<label>
Quantity of people
</label>
<input type="text" id="peopleQuantity" pattern="(\d*\.)?\d+" value="100">
</div>
<div class="row">
<label>
Speed
</label>
<input type="text" id="speed" pattern="(\d*\.)?\d+" value="2">
</div>
<div class="row">
<label>
Person size
</label>
<input type="text" id="size" pattern="(\d*\.)?\d+" value="5">
</div>
<div class="row">
<label>
Probability of change in direction [0, 1[
</label>
<input type="text" id="probDirection" pattern="(\d*\.)?\d+" value="0.2">
</div>
<div class="row">
<label>
Probability of infection [0, 1[
</label>
<input type="text" id="probInfection" pattern="(\d*\.)?\d+" value="0.2">
</div>
<div class="row">
<label>
Probability of dead [0, 1[
</label>
<input type="text" id="probDead" pattern="(\d*\.)?\d+" value="0.2">
</div>
<div class="row">
<label>
Max turning angle (degres)
</label>
<input type="text" id="maxDirectionAngle" pattern="(\d*\.)?\d+" value="0.2">
</div>
<div class="row">
<label>
Infection time length (ms)
</label>
<input type="text" id="infectionTime" pattern="(\d*\.)?\d+" value="3000">
</div>
<div class="row">
<label>
Infection radius
</label>
<input type="text" id="infectionRadius" pattern="(\d*\.)?\d+" value="3">
</div>
<button id="configSubmit">Submit</button>
</form>
<canvas width="500px" height="500px" id="canvas"></canvas><br>
<canvas width="500px" height="250px" id="graph"></canvas><br>
<div id="label">
<div class="row">
<div class="indicator susceptible"></div>
<p> Susceptible</p>
</div>
<div class="row">
<div class="indicator infected"></div>
<p> Infected</p>
</div>
<div class="row">
<div class="indicator removed"></div>
<p> Removed</p>
</div>
<div class="row">
<div class="indicator dead"></div>
<p> Dead</p>
</div>
</div>
<a href="https://www.youtube.com/watch?v=ArcEYuyY01E" target="_blank">Simulação de Contágio - Video da live.</a>
<script defer src="classes.js"></script>
<script defer src="scripts.js"></script>
</body>
</html>