render_frame = (target) => {
const [w,h] = [target.width, target.height];
const r = Math.min(w, h) / 5;
const x = (Math.sin(Date.now() / 1000) + 1) / 2 * (w - 2*r) + r;
const c2d = target.getContext('2d');
c2d.clearRect(0,0, w,h);
c2d.fillStyle = 'darkgrey';
c2d.fillRect(0,0, w,h);
c2d.fillStyle = (document.fullscreenElement) ? 'red' : 'blue';
c2d.beginPath();
c2d.arc(x, h/2, r, 0, 2*Math.PI);
c2d.fill();
}