JSFiddle - React, Tailwind, and code Playground

by heldersepu

HTML

<!doctype html>
<canvas id="c"></canvas>

CSS

canvas {
  border: 1px solid #d3d3d3;
  float: left;
}

JavaScript

const canvas = document.getElementById('c');
const context = canvas.getContext('2d');


let img = new Image();
img.src = "https://raw.githubusercontent.com/idexo-io/awsinfra/6096731f8c58f97dd0ac62aef6c5a2d0ffd98e55/functions/telegram/images/logodark.png?token=AAEFFQVMBBAECDECCZ7SDNLARGPKO"

img.onload = () => {
	canvas.height = img.height
  canvas.width = img.width
  context.drawImage(img, 100, 100, img.width, img.height);
  context.fillText('Hello world', 100, 100);
}