-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBouncyBallExample.html
30 lines (30 loc) · 1 KB
/
BouncyBallExample.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
<!DOCTYPE HTML>
<html>
<head>
<title>Bouncy Ball Example</title>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
border: 0;
overflow: hidden; /* Disable scrollbars */
display: block; /* No floating content on sides */
}
</style>
</head>
<body>
<canvas id="bouncy-ball" height="300" width="300" style="background-color: #DDDDFF"></canvas>
<script src="BouncyBallGame.js"></script>
<script>
var bouncyBallsCanvas = document.getElementById("bouncy-ball");
var canvasContext = bouncyBallsCanvas.getContext("2d");
window.addEventListener('resize', resizeCanvas, false);
function resizeCanvas() {
bouncyBallsCanvas.width = window.innerWidth;
bouncyBallsCanvas.height = window.innerHeight;
}
resizeCanvas();
</script>
</body>
</html>