This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const setBg = () => { | |
| const square = document.querySelector('.items'); | |
| const randomColor = Math.floor(Math.random()*16777215).toString(16); | |
| console.log(square); | |
| square.style.background = "#" + randomColor; | |
| // console.log(square); | |
| } | |
| setInterval(setBg,1000); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const canva = document.getElementById('canva'); | |
| let ctx = canva.getContext('2d'); | |
| load(); | |
| let interval = setInterval(run,1000/60); | |
| function run() | |
| { | |
| update(); |