Skip to content

Instantly share code, notes, and snippets.

@mashiro
Created July 24, 2017 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mashiro/01991f162c8868c3c8b2d8ceda8add03 to your computer and use it in GitHub Desktop.
Save mashiro/01991f162c8868c3c8b2d8ceda8add03 to your computer and use it in GitHub Desktop.
<script>
(function() {
var body = document.getElementsByTagName("body")[0];
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 400;
canvas.height = 250;
ctx.font = "bold 48px sans-serif";
ctx.fillStyle = "rgba(0, 0, 0, 0.1)";
ctx.rotate(30 * Math.PI / 180);
ctx.textBaseline = "middle";
ctx.fillText("development", 30, 30);
body.style.backgroundImage = "url("+canvas.toDataURL()+")";
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment