September 2018
Intermediate to advanced
328 pages
9h 10m
English
Create a folder in your project folder named /public. Add a new file named index.html to the /public folder and populate it with the following contents:
<!doctype html><html lang="en-us"><head> <title>Tetris</title> <link rel="stylesheet" type="text/css" href="styles.css" /></head><body> <div class="wrapper"> <h1>Tetris</h1> <div> <canvas id="canvas"></canvas> <div class="scoreWrapper"> <span>ROWS:</span><span id="score"></span> </div> </div> </div> <script type="application/javascript" src="index.js"></script> <script type="application/javascript"> Module({ canvas: (() => document.getElementById('canvas'))() }) </script></body></html>
The index.js file being loaded in the first <script> tag doesn't exist yet; that'll ...
Read now
Unlock full access