diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index ee50873..c16589b 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -10,8 +10,11 @@ Guidelines for contributors and automated assistants - Use the provided Docker and docker-compose workflows for development and building. The repository's `Dockerfile` and `docker-compose.yml` are the canonical way to install dependencies and run the app. -- If you need to run a command locally for quick checks, prefer run commands in - the project's container environment. Example (copy-paste): +- For development mode (hot-reload), set `PRODUCTION=0` and run `./launch.sh`. +- For production mode (static build), set `PRODUCTION=1` and run `./launch.sh`. +- For manual building of the production image, run `docker-compose build`. +- If you need to run a command for quick checks, use the project's container + environment. Example (copy-paste): ```bash docker compose run --rm peddlers-of-ketran bash @@ -20,12 +23,6 @@ Guidelines for contributors and automated assistants npm run build ``` -- For lightweight commands, you can run one-off containers: - - ```bash - docker run --rm -v "$PWD":/app -w /app node:20 bash -lc 'cd client && npm ci && npm run type-check' - ``` - - Do not suggest or perform `npm install` or `npm ci` on the host machine in repository files, PRs, or automated edits. If a change requires dependency updates, update package.json and lockfiles via a CI job or in-container run, diff --git a/client/src/HouseRules.tsx b/client/src/HouseRules.tsx index 83355c2..fba924a 100644 --- a/client/src/HouseRules.tsx +++ b/client/src/HouseRules.tsx @@ -23,8 +23,22 @@ import TableRow from "@mui/material/TableRow"; // import "./HouseRules.css"; +import boardImg from "./assets/category-board.png"; +import expansionImg from "./assets/category-expansion.png"; +import rollingImg from "./assets/category-rolling.png"; +import rulesImg from "./assets/category-rules.png"; +import volcanoTile from "./assets/single-volcano.png"; + import { GlobalContext } from "./GlobalContext"; import { Placard } from "./Placard"; +import Box from "@mui/material/Box/Box"; + +const categoryImages: { [key: string]: string } = { + board: boardImg, + expansion: expansionImg, + rolling: rollingImg, + rules: rulesImg, +}; /* eslint-disable @typescript-eslint/no-explicit-any */ @@ -111,13 +125,36 @@ const Volcano: React.FC = ({ ws, rules, field, disabled }) => { }; return ( -
-
- The Volcano replaces the Desert. When the Volcano erupts, roll a die to - determine the direction the lava will flow. One of the six intersections - on the Volcano tile will be affected. If there is a settlement on the - selected intersection, it is destroyed! -
+ + + {"Volcano"} +
+ The Volcano replaces the Desert. When the Volcano erupts, roll a die + to determine the direction the lava will flow. One of the six + intersections on the Volcano tile will be affected. If there is a + settlement on the selected intersection, it is destroyed! +
+
Remove it from the board (its owner may rebuild it later). If a city is located there, it is reduced to a settlement! Replace the city with a @@ -129,38 +166,53 @@ const Volcano: React.FC = ({ ws, rules, field, disabled }) => { from erupting.
- Roll {number} and the Volcano erupts! -  /  - + Roll {number} and the Volcano erupts! +  /  +
-
-
- Volcanoes have gold!: Volcano can produce resources when its - number is rolled. -
-
- toggleGold()} - {...{ disabled }} - /> -
-
-
- Volcanoes tend to be rich in valuable minerals such as gold or gems. - Each settlement that is adjacent to the Volcano when it erupts may - produce any one of the five resources it's owner desires. -
-
- Each city adjacent to the Volcano may produce any two resources. This - resource production is taken before the results of the volcano eruption - are resolved. Note that while the Robber can not prevent the Volcano - from erupting, he does prevent any player from producing resources from - the Volcano hex if he has been placed there. -
-
+ + + + + Volcanoes have gold! +
+ Volcano can produce resources when its number is rolled. +
+ + toggleGold()} + {...{ disabled }} + /> + +
+ {gold && ( + + + +
+ Volcanoes tend to be rich in valuable minerals such as gold + or gems. Each settlement that is adjacent to the Volcano + when it erupts may produce any one of the five resources + it's owner desires. +
+
+ Each city adjacent to the Volcano may produce any two + resources. This resource production is taken before the + results of the volcano eruption are resolved. Note that + while the Robber can not prevent the Volcano from erupting, + he does prevent any player from producing resources from the + Volcano hex if he has been placed there. +
+
+
+
+ )} +
+
+ ); }; @@ -205,9 +257,9 @@ const VictoryPoints: React.FC = ({ ws, rules, field }) => { return (
- {points} points. -  /  - + {points} points. +  /  +
); }; @@ -336,7 +388,7 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { }, { key: "most-developed", - label: "You are so developed", + label: "You are so developed!", description: "The player with the most development cards (more than 4) receives 2VP.", category: "expansion", @@ -345,7 +397,7 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { }, { key: "port-of-call", - label: "Another round of port", + label: "Another round of port?", description: "The player with the most harbor ports (more than 2) receives 2VP.", category: "expansion", @@ -354,7 +406,7 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { }, { key: "slowest-turn", - label: "Why you play so slowf", + label: "Why you play so slow?", description: "The player with the longest turn idle time (longer than 2 minutes) so far loses 2VP.", category: "expansion", @@ -395,7 +447,7 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { defaultChecked: false, element: <>, }, - ], + ].sort((a, b) => a.category.localeCompare(b.category)), [rules, setRules, state, ws, setRule, name, gameState] ); @@ -404,12 +456,21 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { } return ( - - + House Rules - +
{ruleList.map((item) => { const defaultChecked = item.defaultChecked; @@ -426,11 +487,20 @@ const HouseRules: React.FC = ({ houseRulesActive }) => { return ( - - {item.label} + + {/* Fixed width for image */} + {item.category} - {item.description} - + + {item.label} +
+ {item.description} +
+