diff --git a/script.js b/script.js index dfea0ef..b6c4162 100644 --- a/script.js +++ b/script.js @@ -92,6 +92,22 @@ function isXyOutside(x, y) { || (y > 5 && x < y - 5); } +/** + * Get if a coordinate is on the board border. + * + * @param x + * @param y + * @return {boolean|boolean} + */ +function isXyBorder(x, y) { + return x === 0 + || x === 10 + || y === 0 + || y === 10 + || (y <= 5 && x === 5 + y) + || (y > 5 && x === y - 5); +} + /** * Game board * @@ -335,6 +351,7 @@ class Board { `); this.$bg.appendChild(polygon); @@ -361,6 +378,18 @@ class Board { this.$bg.appendChild(elem); }); + // inner fill so the inner tiles don't have to use blur shadow + // The color is precisely the shadow in the middle of the border shadows + // superimposed over the background brown. + let polygon2 = Svg.fromXML(` + + `); + this.$bg.appendChild(polygon2); + this.buf1.forEach((elem) => { this.$bg.appendChild(elem); }); @@ -449,7 +478,7 @@ class Board { const scaleShadow = scale + 0.1; this.tileShadowTpl = Svg.fromXMLg(` - +