-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (67 loc) · 3.03 KB
/
index.html
File metadata and controls
68 lines (67 loc) · 3.03 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
<!DOCTYPE html>
<html dir="ltr">
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="script.js" defer></script>
<script>var interval = null;</script>
</head>
<body style="direction: ltr; text-align: center;">
<div class="container">
<div id="content">
<div class="form-wrapper">
<div class="title-box" style="margin-bottom: 12px;">
<h2 style="color: #dcdcdc; margin: 0; font-size: 18px;">Percolation Simulation</h2>
</div>
<form id="inputs">
<div class="form-group">
<label for="gridSize">Grid Size (max 600):</label>
<input type="number" id="gridSize" value="20" min="1" max="400">
</div>
<div class="form-group">
<label>Simulation Speed:</label>
<div class="radio-group">
<input type="radio" name="speed" value="instant" id="instant">
<label class="radio-option" for="instant">Instant</label>
<input type="radio" name="speed" value="slow" id="slow">
<label class="radio-option" for="slow">Slow</label>
<input type="radio" name="speed" value="fast" id="fast" checked>
<label class="radio-option" for="fast">Fast</label>
</div>
</div>
<div class="form-group">
<div class="button-group single-button">
<button type="button" id="runBtn" class="btn btn-secondary" onclick="simulatePercolation()">Run Simulation</button>
</div>
<div class="button-group dual-button">
<button type="button" id="pauseBtn" class="btn btn-secondary btn-small" onclick="togglePause()" disabled>Pause</button>
<button type="button" id="resetBtn" class="btn btn-secondary btn-small" onclick="resetSimulation()">Reset</button>
</div>
</div>
<div class="form-group">
<label for="numSimulations">Number of Simulations for Statistics:</label>
<input type="number" id="numSimulations" value="10" min="1" max="100">
<button type="button" id="statsBtn" class="btn btn-secondary" onclick="runStatistics()" style="margin-top: 10px;">Run Statistics</button>
</div>
</form>
<div id="stats">
<p id="currentPercent">Sites opened: 0% (0/0)</p>
</div>
<div id="simulation-result" style="display: none;"></div>
</div>
<div class="canvas-wrapper">
<canvas id="animation" width="600" height="600"></canvas>
</div>
<div id="stats-modal" class="modal-overlay" style="display: none;">
<div class="modal-content">
<div class="modal-header">
<h2>📊 Statistics Results</h2>
<button class="modal-close" onclick="closeStatsModal()">×</button>
</div>
<div id="stats-content"></div>
</div>
</div>
</div>
</div>
</body>
</html>