forked from Lia-mon/hackathon-serres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.html
245 lines (232 loc) · 6.79 KB
/
start.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
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Tiles - Ser Hackathon 5</title>
<link rel="stylesheet" href="stylesheet.css">
<style>
body{
background-color : #f0efef;
max-width: 60%;
/* margin:auto; */
margin-left:auto;
margin-right:auto;
}
canvas{
border: 2px solid black;
/* border-radius: 4px; */
background-color: #b8b8b8;
}
.grid_fields{
max-width: 35%;
max-height: fit-content;
margin-top: 5px;
margin-bottom: 5px;
}
.gridputs{
overflow-x: scroll;
}
.form input[type="number"] {
width: 50px;
}
.container{
overflow: auto;
width: 800px;
max-height: 400px;
white-space: nowrap;
}
.grid{
position: sticky;
width: 800px;
max-width: min-content;
table-layout: fixed;
/* box-sizing: initial; */
overflow: auto;
/* background-color: #b8b8b8; */
}
.grid td{
width: var(--cell-size);
height: var(--cell-size);
font-size: var(--cell-font);
/* margin: var(--cell-margin); */
}
#options{
display:inline-block;
}
#options > *
{
float:left;
}
#shapeDraw{
/* width: calc(var(--cell-size)*6);
height: calc(var(--cell-size)*6); */
background-color: white;
border: black 3px solid;
border-radius: 2px;
}
#shapeDraw td{
width: var(--cell-size);
height: var(--cell-size);
font-size: var(--cell-font);
/* margin: var(--cell-margin); */
}
#permutations{
/* width: calc(var(--cell-size)*6);
height: calc(var(--cell-size)*6); */
background-color: white;
border: black 3px solid;
border-radius: 2px;
margin:auto;
display: grid;
height:calc(15*var(--cell-size));
width:auto;
max-height: fit-content;
justify-items: center;
align-items: center;
}
#permutations table{
width: max-content;
height:max-content;
margin:10%;
}
#permutations td{
width: var(--cell-size);
height: var(--cell-size);
font-size: var(--cell-font);
/* margin: var(--cell-margin); */
}
.grid .empty{
background-color: rgb(255, 255, 255);
}
.grid .hole{
background-color: black;
}
.checkboxes{
width:10em;
height: 10em;
}
#gridString{
overflow-x:hidden;
white-space: nowrap;
/* border:black 1px solid; */
background-color: white;
height: 1.1em;
}
</style>
<!-- <script type ="text/javascript" src="script.js"></script> -->
<!-- <script type ="text/javascript" src="shapes.js"></script> -->
<script src="js_src/definitions.js" defer></script>
<script src="js_src/dancings_links.js" defer></script>
<script src="js_src/helperFunctions.js"defer></script>
<script src="js_src/styling.js" defer></script>
<script src="js_src/main.js" defer></script>
</head>
<body>
<p>Hello :D, This will be our grid we can basically put things in here yay :D</p>
<!-- TODO remove border added for visualization -->
<div class="form">
<label for="gridw">Width: </label>
<input type="number" min="1" max="100" required id="gridw" class="numberField">
<label for="gridh">Height: </label>
<input type="number" min="1" max="100" required id="gridh" class="numberField">
<label for="gString">From string: </label>
<input type="input" required id="gString" style ="height:1em; width:300px ; overflow-x: auto;">
</div>
<div>
<br>
<div>
<label for="c_size">Cell Size:</label>
<input type="number" min="10" max="100" required id="c_size" class="numberField">
<button onclick = "updateSize()">Resize</button>
</div>
<br>
<!-- <input type="button" value="Generate Grid" id = "gridDraw" > -->
<button onclick = "drawGrid()">Generate interactive - hole Grid</button>
<button onclick = "drawGridFromS()">Draw Grid from string</button>
</div>
<div class ='container'>
<table id="grid1" class="grid"></table>
</div>
<br>
<div style="display:none"> <button onclick = "timeFunction(()=>printGrid())">Grid String</button></div>
<div id="gridString">
</div>
<br>
<div>Select Shapes to use:</div>
<input type="checkbox" onclick="toggle(this);">Select All Shapes <br>
<div id = options>
<table class="checkboxes">
<tr>
<td>F<input type="checkbox" id="checkF" name="checkF"></td>
<td>I<input type="checkbox" id="checkI" name="checkI"></td>
<td>L<input type="checkbox" id="checkL" name="checkL"></td>
</tr>
<tr>
<td>N<input type="checkbox" id="checkN" name="checkN"></td>
<td>P<input type="checkbox" id="checkP" name="checkP"></td>
<td>T<input type="checkbox" id="checkT" name="checkT"></td>
</tr>
<tr>
<td>U<input type="checkbox" id="checkU" name="checkU"></td>
<td>V<input type="checkbox" id="checkV" name="checkV"></td>
<td>W<input type="checkbox" id="checkW" name="checkW"></td>
</tr>
<tr>
<td>X<input type="checkbox" id="checkX" name="checkX"></td>
<td>Y<input type="checkbox" id="checkY" name="checkY"></td>
<td>Z<input type="checkbox" id="checkZ" name="checkZ"></td>
</tr>
</table>
<table id="thonking">
<tr>
<td>
<input type="button" onclick="timeFunction(()=>gsolve(getShapes(),wcanvas))" value="Solve the grid">
<input type="button" value="Load previous data" onclick ="document.getElementById('myfile').click()">
<input type="button" value="Download data" onclick="downloadConfig()" on>
<input type="file" style="display:none" onclick ="loadConfig()" id="myfile" accept =".json">
</td>
</tr>
<tr>
<td>Time to solve: <span id="timetaken"></span></td>
</tr>
<tr></tr>
<td id = "aaaaaaa">
aaaaaaa
</td>
</tr>
<tr id="buttonSOON"></tr>
<tr id="Status" ></tr>
</table>
</div>
<div>Show a shape
Rotate it and what not</div>
<div>
<label for="shapes">Choose a shape:</label>
<select id="shapes" name="shapes">
<option value="F">F</option>
<option value="I">I</option>
<option value="L">L</option>
<option value="N">N</option>
<option value="P">P</option>
<option value="T">T</option>
<option value="U">U</option>
<option value="V">V</option>
<option value="W">W</option>
<option value="X">X</option>
<option value="Y">Y</option>
<option value="Z">Z</option>
</select>
<input type="submit" onClick ="fillShapeTable()" value="Submit">
</div>
<table id="shapeDraw"></table>
<div >
<button onclick = "timeFunction( () => redrawShape(rotateR))">Rotate 90deg R</button>
<button onclick = "timeFunction( () => redrawShape(rotateL))">Rotate 90deg R</button>
<button onclick = "timeFunction( () =>redrawShape(flipX))">Flip Vertically</button>
<button onclick = "timeFunction( () =>redrawShape(flipY))">Flip Horizontally</button>
<button onclick = "timeFunction( () =>drawPermutations(generatePermutations(shownShape)))">Generate all permutations</button>
</div>
<div id="permutations"></div>
<br>
<div><img src="shapes_all.png" width ="766px" height="533px" alt="shapes_here"></div>
</body>
</html>