-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
191 lines (181 loc) · 4.92 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
<html>
<head>
<title>Emscripten Box2D demo</title>
<script src='box2d.js'></script>
<script type="text/javascript" src="embox2d-helpers.js"></script>
<script type="text/javascript" src="embox2d-html5canvas-testbed.js"></script>
<script type="text/javascript" src="draw.js"></script>
<script type="text/javascript" src="level1.js"></script>
<script type="text/javascript" src="level2.js"></script>
<script type="text/javascript" src="level3.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
//console.log(canvas)
//Module.TOTAL_MEMORY =256*1024*1024;
window.onload = function() {
$("#start").click(function(){
$("#cover").fadeOut("fast");
//$("#transition").fadeOut("fast");
});
setInterval(function(){
$("#arrow").toggleClass("blink");
},1000);
$("#replay").click(function(){
console.log("entered");
$("#transition").css('zIndex',-1);
resetScene();
});
$("#next").click(function(){
console.log("entered");
level +=1;
$("#transition").css('zIndex',-1);
resetScene();
});
$("#previous").click(function(){
console.log("entered");
$("#transition").css('zIndex',-1);
level -=1;
resetScene();
});
img = new Image();
img.src ='sprites/paper.jpg';
using(Box2D, "b2.+")
init();
changeTest();
animate();
};
</script>
<style>
#cover{
display:block;
background-color:rgba(173,237,45,0.5);
position:absolute;
left:0;right:0;top:9px;
margin:auto;
width:1200px;
padding:2px;
text-align:center;
height:600;
font-family:Colored Crayons;font-size:500%;
}
#start{
margin:auto;
background-image:url('sprites/start2.png');
background-size: 288px 89px;
background-position:center;
background-repeat:no-repeat;
height:100px;
width:300px;
border: 2px solid;
border-color:#B1D000;
border-radius:15px;
background-color:rgba(200,255,50,0.5);
transition:0.5s;
}
.glow:hover{
background-color:transparent;
border: 2px solid;
border-color: #FEca00;
box-shadow: 0 0 20px #99ca00;
}
#transition{
display:block;
margin :auto;
padding:2px;
left:0;right:0;top:9px;
background-color : rgba(173,237,45,0.5);
background-position:center;
background-repeat:no-repeat;
position : absolute;
width : 1200px;
height :600px;
}
#analysis{
display :block;
margin :auto;
padding :2px;
left : 300px;
top : 50px;
text-align :center;
width : 900px;
height : 200px;
font-size : 150;
}
#replay{
background-image :url('sprites/replay_trans.png');
left :500px;
top : 300px;
}
#next{
background-image : url('sprites/next.png');
left :800px;
top : 300px;
}
#previous{
background-image : url('sprites/previous.png');
left :150px;
top : 300px;
}
.button{
background-repeat :no-repeat;
display :block;
margin :auto;
width :200px;
height :90px;
position : absolute;
border:2px solid #Fe00F0;
border-radius : 15px;
}
.blink{
opacity:0 !important;
}
#arrow{
background:url('sprites/arrow.png');
background-size:150px 50px;
background-repeat:no-repeat;
height:50px;
width:150px;
margin-left:63%;
margin-top:-70px;
transition:0.5s;
}
</style>
</head>
<body>
<div id="transition" style="z-index : -1">
<div id="analysis"></div>
<div id="replay" class ="glow button"></div>
<div id ="next" class="glow button"></div>
<div id="previous" class="glow button"></div>
</div>
<div id="cover">
Welcome to<br> Numpty Physics
<br><br>
<div id="start" class ="glow"></div><div id="arrow"></div>
</div>
<div style='text-align:center'>
<!--
If you change the size of the canvas, you'll also need to change
the value of 'viewCenterPixel' in embox2d-html5canvas-testbed.js
-->
<div style="margin:auto;width:1200px;padding:2px;border:1px solid #888;text-align:left">
<canvas id="canvas" width="1200" height="600" tabindex='1'style='background-color:rgba(0,0,10,1);'></canvas>
<div style="width:1196px;padding:2px;background-color:rgba(128,256,128,0.1)">
<div style="text-align:center">
<button id="reloadButton" onclick="resetScene();">Reset</button>
<button id="pauseButton" onclick="pause();">Pause</button>
<button id="stepButton" onclick="step();">Single step</button>
</div>
</div>
</div>
</div>
<script>
/*$("#start").click(function(){
$("#cover").fadeOut("fast");
});
setInterval(function(){
$("#arrow").toggleClass("blink");
},1000)*/
</script>
</body>
</html>