Skip to content

Commit f3148ca

Browse files
committed
Section 22: Stretching the Canvas
1 parent c753962 commit f3148ca

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

22-Javascript-with-the-Canvas-API/02-Maze copy/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<script src="https://cdnjs.cloudflare.com/ajax/libs/matter-js/0.19.0/matter.min.js"></script>
77
<title>Maze</title>
8+
<style>
9+
body {
10+
margin: 0
11+
}
12+
</style>
813
</head>
914
<body>
1015
<script src="index.js"></script>

22-Javascript-with-the-Canvas-API/02-Maze copy/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
const { Engine, Render, Runner, World, Bodies, Body, Events } = Matter
33

44
const cells = 6
5-
const width = 600
6-
const height = 600
5+
const width = window.innerWidth
6+
const height = window.innerHeight
77

88
const unitLength = width / cells
99

22-Javascript-with-the-Canvas-API/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,6 @@ console.log(grid)
9191

9292
## 26. 30 Detecting a Win
9393

94-
## 27. 31 Adding a Win Animation
94+
## 27. 31 Adding a Win Animation
95+
96+
## 28. 32 Stretching the Canvas

0 commit comments

Comments
 (0)