-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
41 lines (34 loc) · 1.17 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
<!DOCTYPE html>
<html>
<head>
<title>Let's Draw!</title>
<link rel='stylesheet' type='text/css' href='stylesheet.css' />
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
</head>
<body>
<canvas id="canvas" style='position:absolute; left:0px; top:0px;'>
This text is displayed if your browser does not support HTML5 Canvas.
</canvas>
<script type='text/javascript' src='script.js'></script>
<script>
(function () {
var htmlCanvas = document.getElementById('canvas')
initialize();
function initialize() {
// Register an event listener to call the resizeCanvas() function
// each time the window is resized.
// window.addEventListener('resize', resizeCanvas, false);
// Draw canvas border for the first time.
resizeCanvas();
}
// Runs each time the DOM window resize event fires.
// Resets the canvas dimensions to match window,
// then draws the new borders accordingly.
function resizeCanvas() {
htmlCanvas.width = window.innerWidth;
htmlCanvas.height = window.innerHeight;
}
})();
</script>
</body>
</html>