Skip to content

Instantly share code, notes, and snippets.

@tankred
Last active October 19, 2020 13:43
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 tankred/9699210 to your computer and use it in GitHub Desktop.
Save tankred/9699210 to your computer and use it in GitHub Desktop.
Today-painting
<canvas id="OnKawara" width="501" height="345"></canvas>
var canvas = document.getElementById("OnKawara");
var context = canvas.getContext("2d");
context.fillStyle = "white";
context.font = "42pt 'Gill Sans MT',sans-serif";
var monthNames = [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE",
"JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" ];
d = new Date();
t = monthNames[d.getMonth()];
t += d.getDate().toString();
t += ',';
t += d.getFullYear().toString();
var x = canvas.width / 2;
var y = canvas.height / 2;
context.textAlign = 'center';
context.fillText(t, x,y);
#OnKawara {background:#37383d;border:1px solid #69686d;}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment