JSFiddle - React, Tailwind, and code Playground

by b_g_v

HTML

<!DOCTYPE html>
<html style="height: 100%">
   <head>
       <meta charset="utf-8">
   </head>
   <body style="height: 100%; margin: 0">
<canvas id="canv" width="100" height="200"></canvas>
<script>
var canvas = document.getElementById('canv');
var ctx = canvas.getContext('2d');
var img=new Image();
//img.crossOrigin='anonymous';
img.onload=function(){
  // draw the image onto the canvas
var width = (img.width-100)/2;
var height = (img.height-200)/2;
  ctx.drawImage(img,width,height,100,200,0,0,100,200);
}
img.src = "https://newsone.ua/img/article/1263/75_main_big.jpeg";
</script>
<img src="https://newsone.ua/img/article/1263/75_main_big.jpeg">
   </body>
</html>