Canvas

In this example below you will see how to do a Canvas with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by 0dmg, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 0dmg ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Canvas</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta/css/bootstrap.min.css'>

  
  
</head>

<body>

  <head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
  <body>
    <div>
      <canvas id="myCanvas" width=1000 height=device-height style="border:1px solid red">
        
      </canvas>
    </div>
  </body>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/0dmg/canvas-MvzaMY */
var c = document.getElementById("myCanvas");
c.width = window.screen.availWidth - 100;
c.height = window.screen.availHeight - 800;
var ctx = c.getContext("2d");
ctx.moveTo(0,0);
ctx.lineTo(2000,1000);
ctx.stroke();

Comments