-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJuggletest.html
51 lines (51 loc) · 1.54 KB
/
Juggletest.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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="Juggle.js">
</script>
<script type="text/javascript">
function startJuggling() {
var i=0;
while (document.getElementsByName("style")[i].checked == false) i++;
var style = document.getElementsByName("style")[i].value;
sswani.setSiteswap(document.getElementById("ssw").value,document.getElementById("steps").value, style);
sswani.startAnimation();
}
</script>
<style type="text/css">
div.container {
position: relative;
height: 500px;
width: 250px;
border: 1px solid;
}
img.ball {
position: absolute;
height: 25px;
width: 25px;
visibility: hidden;
}
</style>
</head>
<body>
<h2>Simple Javascript Siteswap animator</h2>
<table><tr>
<td>Steps: </td><td><input type="text" name="Steps" value="20" id="steps" /> </td>
</tr><tr>
<td>Pattern: </td><td><input type="text" value="7531" id="ssw" /></td>
</tr><tr>
<td>Style:</td><td>
<input type="radio" id="style" name="style" value="new Array(100,0,50,0)" checked="checked">Normal<br />
<input type="radio" id="style" name="style" value="new Array(50,0,100,0)">Reverse<br />
</td></tr>
</table>
<input type="button" value="Start" onclick='startJuggling()' />
<input type="button" value="Stop" onclick='sswani.stopAnimation()' />
<br /><br />
<div class="container" id="JuggleContainer">
</div>
<script type="text/javascript">
var sswani = new SiteswapAnimator(document.getElementById("JuggleContainer"));
</script>
</body>
</html>