JSFiddle - React, Tailwind, and code Playground
HTML
<canvas id="canvas" ></canvas> <div id="backDrop"><input type="text" id = "myText" /></div>
CSS
#backDrop {width:100%; height:100%; background-repeat: no-repeat;}
#backDrop input{margin: 10px ; width:60px;}
#canvas {display:none;}
JavaScript
var img = new Image;
var myCanvas = document.getElementById('canvas');
var ctx = myCanvas.getContext('2d');
var img = new Image;
img.onload = function(){
ctx.drawImage(img,0,0); // Or at whatever offset you like
$('#backDrop').css('background-image', "url(" + myCanvas.toDataURL() + ")");
};
img.src = "../img/top-bg.png";