forked from selenebun/reactor-p5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
194 lines (185 loc) · 8.27 KB
/
index.html
File metadata and controls
194 lines (185 loc) · 8.27 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="xithiox">
<title>reactor</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Oswald:500"
rel="stylesheet">
<link href="styles/style.css" rel="stylesheet">
<script src="scripts/libraries/p5.min.js" defer></script>
<script src="scripts/libraries/p5.dom.min.js" defer></script>
<script src="scripts/neutron.js" defer></script>
<script src="scripts/tile.js" defer></script>
<script src="scripts/absorber.js" defer></script>
<script src="scripts/control_rod.js" defer></script>
<script src="scripts/coolant.js" defer></script>
<script src="scripts/fuel.js" defer></script>
<script src="scripts/moderator.js" defer></script>
<script src="scripts/horizontal_reflector.js" defer></script>
<script src="scripts/vertical_reflector.js" defer></script>
<script src="scripts/wall.js" defer></script>
<script src="scripts/sketch.js" defer></script>
</head>
<body>
<div id="container">
<header>
<h1>reactor</h1>
</header>
<main>
<div id="side-panel">
<div id="monitor">
<ul>
<li id="ncount">Neutron count:</li>
</ul>
</div>
<div id="help">
<h2>Help</h2>
<p>
Build a simple nuclear reactor by placing tiles and
watching them interact.
</p>
<p>
Fuel rods randomly emit neutrons through radioactive
decay. When they absorb neutrons, they produce heat
and emit several more neutrons.
</p>
<p>
Heat is generated by fuel rods and must be dissipated
by nearby tiles.
</p>
<h3>Tiles</h3>
<ul>
<li><span class="control">A</span> - Neutron absorber</li>
<li><span class="control">C</span> - Coolant cell</li>
<li><span class="control">F</span> - Fuel rod</li>
<li><span class="control">G</span> - Control rod</li>
<li><span class="control">M</span> - Moderator</li>
<li><span class="control">W</span> - Wall</li>
<li><span class="control">,</span> - Vertical reflector</li>
<li><span class="control">.</span> - Horizontal reflector</li>
</ul>
<h3>Other Controls</h3>
<ul>
<li>
<span class="control">Left click</span> - Place selected tile
</li>
<li>
<span class="control">D</span> - Toggle movement direction
</li>
<li><span class="control">H</span> - Toggle heat view</li>
<li><span class="control">Q</span> - Toggle control rods</li>
<li><span class="control">X</span> - Empty board</li>
<li><span class="control">Z</span> - Delete all neutrons</li>
</ul>
</div>
</div>
<div id="sketch-panel">
<div id="sketch-container"></div>
<div id="config">
<hr>
<h2>Configuration</h2>
<form id="vars">
<div class="form-col">
<h3>General</h3>
<input id="nCardDir" name="nCardDir" type="checkbox">
<label for="nCardDir">
Neutrons only travel in cardinal directions
</label><br>
<input id="renderGlow" name="renderGlow" type="checkbox">
<label for="renderGlow">Show glow effect</label>
<h3>Heat Settings</h3>
<label for="heatMax">Max heat</label>
<input id="heatMax" name="heatMax" type="number" min="0"
max="10000"><br>
<label for="heatTransfer">Heat transfer (percent)</label>
<input id="heatTransfer" name="heatTransfer" type="number"
min="0" max="100" step="1"><br>
<h3>Neutrons</h3>
<label for="nSpeedMin">Min neutron speed</label>
<input id="nSpeedMin" name="nSpeedMin" type="number" min="0"
max="10"><br>
<label for="nSpeedMax">Max neutron speed</label>
<input id="nSpeedMax" name="nSpeedMax" type="number" min="0"
max="10">
</div>
<div class="form-col">
<h3>Cooling</h3>
<label for="absorberCool">Absorber cooling</label>
<input id="absorberCool" name="absorberCool" type="number"
min="0"><br>
<label for="controlRodCool">Control rod cooling</label>
<input id="controlRodCool" name="controlRodCool" type="number"
min="0"><br>
<label for="coolantCool">Coolant cell cooling</label>
<input id="coolantCool" name="coolantCool" type="number"
min="0"><br>
<label for="fuelCool">Fuel rod cooling</label>
<input id="fuelCool" name="fuelCool" type="number"
min="0"><br>
<label for="moderatorCool">Moderator cooling</label>
<input id="moderatorCool" name="moderatorCool" type="number"
min="0"><br>
<label for="reflectorCool">Reflector cooling</label>
<input id="reflectorCool" name="reflectorCool" type="number"
min="0"><br>
<h3>Neutron Capture</h3>
<label for="absorberChance">Absorber capture chance</label>
<input id="absorberChance" name="absorberChance" type="number"
min="0" max="100">
<label for="controlRodChance">
Control rod capture chance
</label>
<input id="controlRodChance" name="controlRodChance"
type="number" min="0" max="100">
<label for="fuelChance">Fuel rod capture chance</label>
<input id="fuelChance" name="fuelChance" type="number"
min="0" max="100">
</div>
<div class="form-col">
<h3>Fuel Rods</h3>
<label for="fuelHeat">Heat per fission event</label>
<input id="fuelHeat" name="fuelHeat" type="number"
min="0"><br>
<label for="nSpawnMin">Min neutrons per fission event</label>
<input id="nSpawnMin" name="nSpawnMin" type="number" min="1"
max="3"><br>
<label for="nSpawnMax">Max neutrons per fission event</label>
<input id="nSpawnMax" name="nSpawnMax" type="number" min="1"
max="3"><br>
<label for="fuelSpontChance">Radioactive decay chance</label>
<input id="fuelSpontChance" name="fuelSpontChance"
type="number" min="0" max="100"><br>
<label for="fuelSpontHeat">Radioactive decay heat</label>
<input id="fuelSpontHeat" name="fuelSpontHeat" type="number"
min="0" max="100">
<h3>Neutron Collisions</h3>
<label for="absorberHeat">Heat from absorber</label>
<input id="absorberHeat" name="absorberHeat" type="number"
min="0"><br>
<label for="controlRodHeat">Heat from control rod</label>
<input id="controlRodHeat" name="controlRodHeat"
type="number" min="0"><br>
<label for="reflectorHeat">Heat from reflector</label>
<input id="reflectorHeat" name="reflectorHeat"
type="number" min="0">
</div>
<hr>
<input type="button" value="Update variables" onclick="vars();">
</form>
</div>
</div>
</main>
<footer>
<p id="copyright">© 2017, xithiox</p>
</footer>
</div>
</body>
</html>
<!--
const CONFIG = {
absorberHeat: 2, // heat generated per collision
controlRodHeat: 4, // heat generated per collision
reflectorHeat: 1, // heat generated per reflection
};
-->