-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·237 lines (228 loc) · 11.4 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Santa's 2022 Visualizer</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</head>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1EHELMX9X7"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1EHELMX9X7');
</script>
<style>
body {
overflow: hidden; /* Hide scrollbars */
}
body, html, .container-fluid {
height: 100%;
}
.config-table {
text-align: center;
background-color: lightblue;
}
.config-cell {
text-align: center;
}
.locked {
background-color: lightcoral;
}
.free {
background-color: lightgreen;
}
span {
pointer-events: none;
caret-color: transparent;
}
</style>
<body>
<div class="container-fluid">
<div id="menu">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">Santa 2022 Tools</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link active" href="#">Solution Plotter</a>
</li>
<li class="nav-item">
<a class="nav-link" href="colors.html">Color Visualization</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/danieloliveira56/kaggle-santa2022-tools" target="_blank"><img src="github.svg" alt="Bootstrap" width="30" height="30"></i></a>
</li>
</ul>
</div>
</nav>
<div class="input-group mt-2 w-75">
<label for="csv" class="input-group-text">Update submission.csv:</label>
<input id="csv" class="form-control" type="file" accept=".csv">
</div>
<div class="input-group mt-1">
<label for="fps" class="input-group-text">Framerate (<span id="current_fps">60</span> frames per
second)</label>
<input type="button" class="btn btn-outline-primary px-3" value="-" onclick="decrease_fps()">
<input type="range" class="mx-1" id="fps" min="1" max="60" value="60" step="1" onchange="update_fps()">
<input type="button" class="btn btn-outline-primary px-3" value="+" onclick="increase_fps()">
</div>
<div class="row mt-1">
<div class="col-auto pe-0">
<div class="input-group">
<label for="speed" class="input-group-text">Speed (<span id="current_speed"></span> pixels per
frame)</label>
<input type="button" class="btn btn-outline-primary px-3" value="-" onclick="decrease_speed()">
<input type="range" class="mx-1" id="speed" min="1" max="300" step="1" onchange="update_speed()">
<input type="button" class="btn btn-outline-primary px-3" value="+" onclick="increase_speed()">
</div>
</div>
<div class="col-auto">
<input type="button" class="btn btn-outline-primary px-3" value="1x" onclick="set_speed(1)">
<input type="button" class="btn btn-outline-primary px-3" value="5x" onclick="set_speed(5)">
<input type="button" class="btn btn-outline-primary px-3" value="10x" onclick="set_speed(10)">
<input type="button" class="btn btn-outline-primary px-3" value="300x" onclick="set_speed(300)">
<input type="checkbox" id="speed_reverse" class="ms-2">
<label class="form-check-label" for="speed_reverse">Reverse</label>
</div>
</div>
<div class="input-group mt-1">
<label for="pixel" class="input-group-text">Point (0-indexed) <span id="current_pixel"></span> of
<span id="solution_size"></label>
<input type="button" id="decrease_pixel" class="btn btn-outline-primary px-3" value=""
onclick="decrease_pixel()" disabled>
<input type="range" class="mx-1" id="pixel" min="0" max="66049" value="0" step="1" disabled>
<input type="button" id="increase_pixel" class="btn btn-outline-primary px-3" value=""
onclick="increase_pixel()" disabled>
</div>
<div class="input-group mt-1">
<label class="input-group-text">Points to plot (0-indexed)</label>
<div class="col-auto">
<input type="text" id="min_idx" class="form-control" value="0">
</div>
<div class="col-auto">
<input type="text" id="max_idx" class="form-control" value="0">
</div>
</div>
<div class="mt-1">
<input type="button" id="pause_btn" class="btn btn-outline-primary" value="Pause" onclick="pause()">
<input type="button" id="reset_btn" class="btn btn-primary" value="Reset" onclick="reset()">
<input type="checkbox" id="plot_path" class="ms-2">
<label class="form-check-label" for="plot_path">Plot Path</label>
<input type="checkbox" id="plot_heatmap" class="ms-2">
<label class="form-check-label" for="plot_heatmap">Plot Cost Heatmap</label>
<input type="checkbox" id="loop" class="ms-2">
<label class="form-check-label" for="loop">Loop animation</label>
</div>
</div>
<div class="row w-100 h-100 my-3">
<div id="canvas" class="col-8 border"></div>
<div id="configs" class="col-4">
<div class="row">
<div id="config-table" class="col-4">
<div class="row px-2">Configuration:</div>
<div class="row px-2">
<div id="x64" class="col border config-cell locked" status="locked" component="00">
<span>64</span>
</div>
<div id="y64" class="col border config-cell free" status="free" component="01">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x32" class="col border config-cell locked" status="locked" component="10">
<span>-32</span>
</div>
<div id="y32" class="col border config-cell free" status="free" component="11">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x16" class="col border config-cell locked" status="locked" component="20">
<span>-16</span>
</div>
<div id="y16" class="col border config-cell free" status="free" component="21">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x8" class="col border config-cell locked" status="locked" component="30">
<span>-8</span>
</div>
<div id="y8" class="col border config-cell free" status="free" component="31">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x4" class="col border config-cell locked" status="locked" component="40">
<span>-4</span>
</div>
<div id="y4" class="col border config-cell free" status="free" component="41">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x2" class="col border config-cell locked" status="locked" component="50">
<span>-2</span>
</div>
<div id="y2" class="col border config-cell free" status="free" component="51">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x1" class="col border config-cell locked" status="locked" component="60">
<span>-1</span>
</div>
<div id="y1" class="col border config-cell free" status="free" component="61">
<span>0</span>
</div>
</div>
<div class="row px-2">
<div id="x0" class="col border config-cell locked" status="locked" component="70">
<span>-1</span>
</div>
<div id="y0" class="col border config-cell free" status="free" component="71">
<span>0</span>
</div>
</div>
<div class="row px-2 mt-3">Legend:</div>
<div class="row px-2">
<div class="text-center border free" title="Scroll to move, Click to lock">
<span>Free</span>
</div>
</div>
<div class="row px-2">
<div class="text-center border locked" title="Click to flip">
<span>Locked</span>
</div>
</div>
</div>
<div class="col-8">
<div>Solution:</div>
<div class="form-floating mt-1 h-100">
<textarea class="form-control h-100" id="solution"></textarea>
<label for="solution">configuration</label>
</div>
<div class="mt-2">
<input type="button" id="export" class="btn btn-outline-primary" value="Export" onclick="export_solution();">
<input type="button" id="clear" class="btn btn-outline-primary" value="Clear" onclick="clear_solution();">
<input type="button" id="clipboard" class="btn btn-outline-primary" value="Copy to Clipboard" onclick="clip_solution();">
</div>
</div>
</div>
<div class="row">
</div>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="solution-plotter.js"></script>
</html>