source-code/
snakey-extension
Public
codeCodeinfoIssues 0call_splitPull Requestsplay_circleActions
snakey-extension/src/game/constants.ts
typescript13 lines300 B
export const GRID_SIZE = 20;
export const CANVAS_WIDTH = 800;
export const CANVAS_HEIGHT = 600;
export const MOVE_INTERVAL = 120; // milliseconds per move

export const GAME_COLORS = {
  SNAKE_BODY: 0x3b82f6,
  SNAKE_HEAD: 0x1d4ed8,
  FOOD: 0xef4444,
  SPECIAL_FOOD: 0xff0000,
  OVERLAY: 0xffffff
};

About

Snakey Browser Extension is a cross-browser extension built using Manifest V3 that injects a playable Phaser 3 game onto any active tab. It parses the page DOM, turns HTML elements into target coordinates, and features custom chomp/collapse animations. It supports both Chromium (background service worker) and Firefox (background scripts), implements a Canvas-based rendering fallback to bypass strict WebGL CORS limitations, and applies fully container-scoped vanilla CSS overrides to prevent style bleeding on host pages.

Browser ExtensionChrome MV3Firefox MV3PhaserReactTypeScriptVite

Contributors

1