From 1e65219401b5ca82d44f82dcfd97ae3e99336f55 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Sat, 13 May 2023 12:09:59 -0400 Subject: [PATCH] Start setting up the basic board --- kifu/kifu-pwa/src/components/Board.ts | 13 ++++++++----- kifu/kifu-pwa/src/kifu.css | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/kifu/kifu-pwa/src/components/Board.ts b/kifu/kifu-pwa/src/components/Board.ts index ced024a..b7065ed 100644 --- a/kifu/kifu-pwa/src/components/Board.ts +++ b/kifu/kifu-pwa/src/components/Board.ts @@ -5,18 +5,21 @@ export class GoBoard extends HTMLCanvasElement { constructor() { super(); - - console.log("Go Board constructor"); } connectedCallback() { - console.log("connected callback"); + this.setAttribute("width", "500"); + this.setAttribute("height", "500"); + this.classList.add("go-board"); const ctx = this.getContext("2d"); if (!ctx) { alert("could not get the canvas context"); return; } - ctx.fillStyle = "green"; - ctx.fillRect(10, 10, 150, 150); + ctx.fillStyle = "rgb(128, 128, 128)"; + ctx.fillRect(10, 10, 50, 50); + + ctx.fillStyle = "rgba(0, 0, 200, 0.5)"; + ctx.fillRect(30, 30, 50, 50); } } diff --git a/kifu/kifu-pwa/src/kifu.css b/kifu/kifu-pwa/src/kifu.css index 892f5d1..cff95ab 100644 --- a/kifu/kifu-pwa/src/kifu.css +++ b/kifu/kifu-pwa/src/kifu.css @@ -13,3 +13,7 @@ body { display: grid; } +.go-board { + width: 100%; + height: 100%; +}