Cleaned up file structure. Completed tutorial 1.5.

This commit is contained in:
dan
2022-12-16 00:10:35 -05:00
parent d769edc908
commit fce30321a7
8 changed files with 83 additions and 31 deletions

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css"
</head>
<body>
<canvas id="my-canvas"></canvas>
<script src="index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,23 @@
const canvas = document.getElementById('my-canvas');
const ctx = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// console.log(ctx);
ctx.beginPath();
// canvas.addEventListener('mousemove', function (e){
// console.log(e.x, e.y);
// ctx.rect(e.x,e.y,10,10);
// ctx.fill( );
// // ctx.stroke();
// });
const degreeToRad = (deg) =>{
return deg / 180 * Math.PI;
}
ctx.arc(100, 100, 50, 0, degreeToRad(360));
ctx.stroke();

View File

@@ -0,0 +1,8 @@
#my-canvas{
/* background-color: blue; */
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}