html
html
1
<canvas id="canvas"></canvas>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
body {
position:fixed ;
}
canvas{
background: linen;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
window.onload = function (){
var c = document.querySelector("#canvas");
var cx = c.getContext("2d");
c.width = window.innerWidth - 15;
c.height = window.innerHeight - 15;
cx.fillStyle = "red";
c.ontouchmove = function(e){
cx.fillRect(
e.changedTouches[0].pageX,
e.changedTouches[0].pageY,
3,
3
);
}
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run