From 3e88cf6ff728836d0a82bd5483138d2bc8eba577 Mon Sep 17 00:00:00 2001 From: rshig <90143161+rshigg@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:45:52 -0330 Subject: [PATCH] feat: increase element sizing and color contrast for better accessibility --- src/channels/minesweeper/Face.tsx | 5 ++++- src/channels/minesweeper/Tile.tsx | 8 ++++++-- src/channels/minesweeper/constants.ts | 14 ++++++++------ src/channels/minesweeper/index.tsx | 18 ++++++++++-------- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/channels/minesweeper/Face.tsx b/src/channels/minesweeper/Face.tsx index 51ccd14..86c837d 100644 --- a/src/channels/minesweeper/Face.tsx +++ b/src/channels/minesweeper/Face.tsx @@ -5,6 +5,9 @@ import type { FaceType } from './types'; import faces from './assets/faces.png'; +const SPRITES_PER_ROW = 5; +const SPRITESHEET_ROWS = 1; + function getFaceOffset(face: FaceType) { const faceIndex = FACE_ORDER.indexOf(face); return faceIndex * FACE_DIMENSION; @@ -18,11 +21,11 @@ export function Face({ face }: FaceProps) { return (
); diff --git a/src/channels/minesweeper/Tile.tsx b/src/channels/minesweeper/Tile.tsx index 4c5b08f..c93f4dd 100644 --- a/src/channels/minesweeper/Tile.tsx +++ b/src/channels/minesweeper/Tile.tsx @@ -5,16 +5,20 @@ import type { TileData } from './types'; import tiles from './assets/tiles.png'; +const SPRITES_PER_ROW = 8; +const SPRITESHEET_ROWS = 2; + export function Tile({ tileType }: TileData) { const [x, y] = tileType; return ( ); diff --git a/src/channels/minesweeper/constants.ts b/src/channels/minesweeper/constants.ts index 038fb6a..ee65ac9 100644 --- a/src/channels/minesweeper/constants.ts +++ b/src/channels/minesweeper/constants.ts @@ -1,12 +1,14 @@ -export const FACE_DIMENSION = 24; +import type { TileData } from './types'; + +export const FACE_DIMENSION = 36; export const FACE_ORDER = ['smile', 'smile_pressed', 'open_mouth', 'sunglasses', 'heart_eyes'] as const; export const MINE_CHANCE = 0.17; export const GRID_ROWS = 16; -export const GRID_COLUMNS = 67; +export const GRID_COLUMNS = 66; -export const TILE_DIMENSION = 16; +export const TILE_DIMENSION = 16.24; export const TILE_MAP = { HIDDEN: [0, 0], @@ -21,7 +23,7 @@ export const TILE_MAP = { EMPTY: [1, 0], FLAGGED: [2, 0], QUESTION_MARK: [3, 0], -} as const; +} satisfies Record