psychotherapy/src/main/js/Main.ts

30 lines
692 B
TypeScript

// @ts-ignore
const {$, doAfterLoad} = window.fwdekker;
doAfterLoad(() => {
$("main").classList.remove("hidden");
const canvas = $("#art");
const ctx = canvas.getContext("2d");
const draw = () => {
ctx.fillStyle = "#000000";
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.beginPath();
ctx.fillStyle = "#ffffff";
ctx.arc(canvas.width / 2 - 20, canvas.height / 2 - 20, 20, 0, 2 * Math.PI);
ctx.fill();
};
const resize = () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
draw();
};
window.addEventListener("resize", resize, false);
resize();
});