From 18054da55396dbd77ecbd294cb86b3f59f857ab0 Mon Sep 17 00:00:00 2001 From: Phil Norton Date: Tue, 18 Mar 2025 08:56:36 +0000 Subject: [PATCH] 19: Converted styles to be injected as the canvas is set up. --- docs/demo/forward/index.html | 14 -------------- docs/demo/forx/index.html | 14 -------------- docs/demo/fourbytwo/index.html | 14 -------------- docs/demo/index.html | 2 +- docs/demo/test/index.html | 14 -------------- four.js | 7 +++++++ 6 files changed, 8 insertions(+), 57 deletions(-) diff --git a/docs/demo/forward/index.html b/docs/demo/forward/index.html index d48f0b7..449d610 100644 --- a/docs/demo/forward/index.html +++ b/docs/demo/forward/index.html @@ -14,20 +14,6 @@ - -
diff --git a/docs/demo/forx/index.html b/docs/demo/forx/index.html index 423d13b..a52eb27 100755 --- a/docs/demo/forx/index.html +++ b/docs/demo/forx/index.html @@ -14,20 +14,6 @@ - -
diff --git a/docs/demo/fourbytwo/index.html b/docs/demo/fourbytwo/index.html index 9d88ac4..cb4afcf 100755 --- a/docs/demo/fourbytwo/index.html +++ b/docs/demo/fourbytwo/index.html @@ -14,20 +14,6 @@ - -
diff --git a/docs/demo/index.html b/docs/demo/index.html index 513e04e..1422c80 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -35,7 +35,7 @@

Test

A demo showing some random colours and all of the available numbers.

See demo -

For By Two

+

Four By Two

A memory game where pairs of colours are matched together. Use your mouse pointer to click on item in the grid to match colours. Once you have matched the colour it will stay on the grid. Complete all of the colours to get your score.

See demo diff --git a/docs/demo/test/index.html b/docs/demo/test/index.html index c4c3f4d..234e494 100755 --- a/docs/demo/test/index.html +++ b/docs/demo/test/index.html @@ -14,20 +14,6 @@ - -
diff --git a/four.js b/four.js index 5747cfc..5da8464 100644 --- a/four.js +++ b/four.js @@ -331,6 +331,13 @@ function gameLoop() { // Initialise the canvas. function initCanvas(id) { canvas = document.getElementById(id); + + canvas.style.cursor = 'crosshair'; + canvas.style.background = 'white'; + canvas.style.border = '2px solid black'; + canvas.style.margin = '0 auto 0 auto'; + canvas.style.display = 'flex'; + ctx = canvas.getContext('2d'); width = canvas.width;