JSFiddle - React, Tailwind, and code Playground

by Matthew Ekenstedt

HTML

<button onclick="startBlinking()">Start Blinking!</button>
<canvas id="canvas1" width="500px" height="500px" />

JavaScript

function startBlinking() {
    var c = document.getElementById("canvas1");
    var blinker = new Blinker();
    blinker.drawText(c, "Welcome to my webiste! Please sign my guestbook!", 30, 30);
}

function Blinker() {
    this.drawText = function (canvas, text, xloc, yloc) {
        var context = canvas.getContext("2d");
        context.fillText(text, xloc, yloc);
    };
}