forked from ManishPoduval/pong-starter-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (16 loc) · 614 Bytes
/
Copy pathscript.js
File metadata and controls
24 lines (16 loc) · 614 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
let canvas = document.querySelector('canvas')
canvas.style.backgroundColor = "#302c2c"
// getting the paintbrush
let ctx = canvas.getContext('2d')
// The DOM of the start and the restart buttons
let startBtn = document.querySelector('#start')
let restartBtn = document.querySelector('#restart')
//Everything begins here
window.addEventListener('load', () => {
startBtn.addEventListener('click', () => {
// do something when the user clicks the start button
})
restartBtn.addEventListener('click', () => {
// do something when the user clicks the restart button
})
})