JSFiddle - React, Tailwind, and code Playground
by psycketom
HTML
<canvas id="smiley" width="400" height="400"></canvas>
CSS
body
{
background: -webkit-canvas(#smiley);
background: -moz-background(#smiley);
background-position: center top;
background-repeat: no-repeat;
}
JavaScript
var smileyElement = document.getElementById('smiley');
var smileyCanvas = smileyElement.getContext('2d');
var smiley = new Image();
smiley.src = 'http://images4.wikia.nocookie.net/__cb20080915185924/emoticon/images/1/16/Blue_smiley_face.png';
smiley.onload = function()
{
smileyCanvas.shadowColor = 'rgba(0, 0, 0, 0.5)';
smileyCanvas.shadowOffsetX = -10;
smileyCanvas.shadowOffsetY = -10;
smileyCanvas.shadowBlur = 10;
smileyCanvas.drawImage(this, 0, 0);
setTimeout(function() {
smileyElement.style.position = 'absolute';
smileyElement.style.left = '-400px';
smileyElement.style.top = '-400px';
}, 2000); // a noticeable delay
};