// MIT License - James Milner 2021

const mandelbrotBmp = {
  width: 176,
  height: 176,
  bpp: 8,
  transparent: 254,
  buffer: require("heatshrink").decompress(
    atob(
      "[encoded data, 22680 characters]"
    )
  ),
};

function draw() {
  g.drawImage(mandelbrotBmp);
  // work out how to display the current time
  const d = new Date();
  const h = d.getHours(),
    m = d.getMinutes();
  const time = h + ":" + ("0" + m).substr(-2);

  // Reset the state of the graphics library
  g.reset();
  g.setColor(1, 1, 1);
  g.setFont("Vector", 30);
  g.drawString(time, 70, 68, false);
}

g.clear();

// draw immediately at first
draw();
var secondInterval = setInterval(draw, 1000);
