-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.html
72 lines (61 loc) · 2.7 KB
/
main.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
<!DOCTYPE html>
<title>Billiard Simulation</title>
<meta charset="utf-8"/>
<code mode="text/html">
<html>
<head>
<!-- LOADING LIBRARIES -->
<!-- Load the Paper.js library -->
<script type="text/javascript" src="./Modules/paper-full.js"></script>
<!-- Load the Math.js library -->
<script type="text/javascript" src="./Modules/math.js"></script>
<script type="text/javascript" src="./Modules/FileSaver.js"></script>
<!-- Define inlined PaperScript associate it with b_table -->
<script type="text/javascript" src="./Modules/myTable.js" canvas = "b_table"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="window">
<!-- CANVAS FOR DRAWING -->
<canvas id="b_table" resize="true" style="padding: 10px 10px"></canvas>
</div>
<!-- TABLE -->
<center>
<div style="padding:5px">
<input type="radio" id="rectangle" name="table_shape" value="rectangle">
<label for="rectangle">Rectangle</label>
<input type="radio" id="circle" name="table_shape" value="circle">
<label for="circle">circle</label> <input type="radio" id="polygon" name="table_shape" value="polygon" checked >
<label for="polygon">polygon</label>
</div>
<button onclick="run()" id="run"> Run </button>
Number of Iterations: <input type="text" name="num_iter" value="100" id="num_iter">
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Add Pts / Clear All</button>
<div id="myDropdown" class="dropdown-content">
<a href="#" id="addPoint" onclick="addWall()">Add Wall</a>
<a href="#" id="clear" onclick="clearAll()">Clear All</a>
</div>
</div>
<button onclick="exportSVG()" id="export_svg">Export SVG</button>
<button onclick="exportStates()" id="export_states">Export States</button>
</center>
<table>
<tr>
<td>Initial Position:</td>
<td><input type="text" name="position" value="30, 30" id="position"></td>
</tr>
<tr>
<td>Initial Heading:</td>
<td><input type="text" name="heading" value="(0, 1)" id="heading"></td>
<td class="slidecontainer" colspan=2><input type="range" min="0" max="360" value="180" class="slider" id="theta" oninput="slideToVec(this.value)"></td>
</tr>
<tr>
<td> Width:</td>
<td><input type="text" name="table_width" value="200" id="table_width"></td>
<td>Height:</td>
<td><input type="text" name="table_height" value="300" id="table_height"></td>
</tr>
</table>
</body>
</html>