From 6ac641b65c65a4929ebf784723e8bd94f266a1a8 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 00:56:50 +0200 Subject: [PATCH 01/14] add notes --- README.md | 45 ++++++--------------------------------- daily.js | 51 +++++++++++++++++++++++++++++++++++++++++++++ notes/2024-09-11.md | 1 + package.json | 3 ++- 4 files changed, 60 insertions(+), 40 deletions(-) create mode 100644 daily.js create mode 100644 notes/2024-09-11.md diff --git a/README.md b/README.md index a75ac52..cca55b5 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,7 @@ -This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). +Playtest Sorcery TCG in the browser -## Getting Started - -First, run the development server: - -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev -``` - -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. - -[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. - -The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. - -This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. +## Todo +- [ ] landing page +- [ ] add realms app deck loader +- [ ] add solo turn rotator (play against yourself +- [ ] add websocket diff --git a/daily.js b/daily.js new file mode 100644 index 0000000..9d071e0 --- /dev/null +++ b/daily.js @@ -0,0 +1,51 @@ +const fs = require("fs"); +const path = require("path"); +const { execSync } = require("child_process"); + +// Get today's date in the required format +const today = new Date(); +const formattedDate = today.toISOString().split("T")[0]; // YYYY-MM-DD format +const formattedTime = today.toTimeString().split(" ")[0].slice(0, 5); // HH:MM format + +// Path to the daily note in the relative 'notes' folder +const notesDir = path.join(__dirname, "notes"); +const notePath = path.join(notesDir, `${formattedDate}.md`); + +// Check if the file exists, if not create it +if (!fs.existsSync(notePath)) { + fs.writeFileSync(notePath, ""); +} + +// Function to add an entry to the daily note +const addEntry = (entryText, isTodo) => { + // Read the file contents + const fileContent = fs.readFileSync(notePath, "utf-8"); + const lastTimeStamp = (fileContent.match(/#### (\d{2}:\d{2})/g) || []).pop(); + + let newContent = ""; + + // If the last timestamp is not equal to the current time, add a new timestamp + if (!lastTimeStamp || lastTimeStamp !== `#### ${formattedTime}`) { + newContent += `\n#### ${formattedTime}\n`; + } + + if (isTodo) { + newContent += `- [ ] ${entryText}\n`; + } else { + newContent += `- ${entryText}\n`; + } + + fs.appendFileSync(notePath, newContent); +}; + +// Main script +const command = process.argv[2]; +const entryText = process.argv.slice(3).join(" "); + +if (command === "add" || command === "todo") { + const isTodo = command === "todo"; + addEntry(entryText, isTodo); +} else { + // Open the note in the default editor + execSync(`vi "${notePath}"`, { stdio: "inherit" }); +} diff --git a/notes/2024-09-11.md b/notes/2024-09-11.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/notes/2024-09-11.md @@ -0,0 +1 @@ + diff --git a/package.json b/package.json index 7e9ea52..90b35bb 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "note": "node daily.js" }, "dependencies": { "@dnd-kit/core": "^6.1.0", From 117dfff39e24d77d9722a19dfa622b989b21fbd1 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 00:56:56 +0200 Subject: [PATCH 02/14] add docs for types --- src/types/card.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/types/card.ts b/src/types/card.ts index 935a00c..880d77f 100644 --- a/src/types/card.ts +++ b/src/types/card.ts @@ -6,6 +6,11 @@ type SorceryCardType = | "minion" | "magic"; +/** + * Static props needed to render a card + * img for display + * type only matters to rotate sites (sites are horizontal) + * */ export type SorceryCard = { img: string; // used with CDN type: SorceryCardType; // site card is rotated sideways @@ -13,16 +18,33 @@ export type SorceryCard = { /** * Card props used for playtesting + * id is used for drag-n-drop + * isTapped ...well yeah for tapping * */ type GameProps = { id: string; isTapped?: boolean; }; + /** * Card type used for game playtesting * */ export type GameCard = SorceryCard & GameProps; +/** + * Represents an array of cards. + * Every container of cards is a grid item. + * For example, hand, deck, discard, individual cell on the game grid. + * */ export type GridItem = GameCard[]; +/** + * The entire state of the board is an array of 36 arrays. + * 1-20 Game Grid (5x4 grid) + * 21-32 Aura intersections + * 33 HAND + * 34 DECK + * 35 ATLAS_DECK + * 36 GRAVE + * */ export type GameState = GridItem[]; From ee8ca029614026c6d22cf635ea78ddd859f59729 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 00:57:02 +0200 Subject: [PATCH 03/14] reduce text for drag props --- src/components/organisms/GameBoard/index.tsx | 43 +++---------------- .../organisms/GameBoard/useHandleDrag.ts | 27 +++++++++++- 2 files changed, 31 insertions(+), 39 deletions(-) diff --git a/src/components/organisms/GameBoard/index.tsx b/src/components/organisms/GameBoard/index.tsx index ef29c7d..73c3414 100644 --- a/src/components/organisms/GameBoard/index.tsx +++ b/src/components/organisms/GameBoard/index.tsx @@ -2,13 +2,7 @@ import { CardAtlas } from "@/components/atoms/mock-cards/atlas"; import { SortableContext, rectSortingStrategy } from "@dnd-kit/sortable"; import { GameLayout } from "./Layout"; import { DroppableGridItem } from "@/components/molecules/DropGridItem"; -import { - closestCenter, - closestCorners, - CollisionDetection, - DndContext, - DragOverlay, -} from "@dnd-kit/core"; +import { DndContext, DragOverlay } from "@dnd-kit/core"; import { useHandleDrag } from "./useHandleDrag"; import { CardImage } from "@/components/atoms/mock-cards/card"; import { CardImage as FullCard } from "@/components/atoms/card-view/card"; @@ -25,38 +19,13 @@ export type GameStateActions = { setGridItems: Dispatch>; }; export const GameBoard = ({ gridItems, setGridItems }: GameStateActions) => { - const { sensors, handleDragEnd, handleDragStart, activeId, activeCard } = - useHandleDrag({ - gridItems, - setGridItems, - }); - - const collision: CollisionDetection = (props) => { - // Access the current translated Y position of the dragged item - const currentY = props?.active?.rect?.current?.translated?.top; - - // Get the height of the viewport - const viewportHeight = window.innerHeight; - - // Check if the current Y position is within the bottom 170px of the page - const isInFooter = currentY && currentY > viewportHeight - 170; - - // Check if the current Y position is within the bottom 170px of the page - // If the item is in the bottom 170px, use closestCenter for the footer - if (isInFooter) { - return closestCenter(props); - } - - return closestCorners(props); - }; + const { activeCard, activeId, ...dragProps } = useHandleDrag({ + gridItems, + setGridItems, + }); return ( - + {gridItems?.slice(0, 20)?.map((cards, gridIndex) => ( { + // Access the current translated Y position of the dragged item + const currentY = props?.active?.rect?.current?.translated?.top; + + // Get the height of the viewport + const viewportHeight = window.innerHeight; + + // Check if the current Y position is within the bottom 170px of the page + const isInFooter = currentY && currentY > viewportHeight - 170; + + // Check if the current Y position is within the bottom 170px of the page + // If the item is in the bottom 170px, use closestCenter for the footer + if (isInFooter) { + return closestCenter(props); + } + + return closestCorners(props); +}; + export const useHandleDrag = ({ gridItems, setGridItems, @@ -49,9 +71,10 @@ export const useHandleDrag = ({ } return { + collision, sensors, - handleDragEnd, - handleDragStart, + onDragEnd: handleDragEnd, + onDragStart: handleDragStart, activeId: active?.id, activeCard: gridItems?.[active?.data?.current?.gridIndex]?.[ From 5ef532c535a50784c033101aeb46020450c1a5d8 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 01:17:54 +0200 Subject: [PATCH 04/14] make index more perm in auras --- .../organisms/GameBoard/Auras/index.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/organisms/GameBoard/Auras/index.tsx b/src/components/organisms/GameBoard/Auras/index.tsx index bcb71c4..ffb5062 100644 --- a/src/components/organisms/GameBoard/Auras/index.tsx +++ b/src/components/organisms/GameBoard/Auras/index.tsx @@ -12,14 +12,16 @@ import { CARD_CDN, GRIDS } from "../constants"; export const Auras = (props: GameStateActions) => { return ( - {Array.from({ length: 12 }).map((_, index) => ( - - ))} + {Array.from({ length: 12 }) + .map((_, index) => index) + .map((index) => ( + + ))} ); }; From f674b93e1e615a407ace0a4311dd8dc4850339b7 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 02:49:40 +0200 Subject: [PATCH 05/14] notes --- README.md | 4 +++- notes/2024-09-12.md | 9 +++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 notes/2024-09-12.md diff --git a/README.md b/README.md index cca55b5..b421d33 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ Playtest Sorcery TCG in the browser ## Todo +- [ ] add health counter - [ ] landing page - [ ] add realms app deck loader -- [ ] add solo turn rotator (play against yourself +- [ ] add solo turn rotator (play against yourself) + - use top header for info - [ ] add websocket diff --git a/notes/2024-09-12.md b/notes/2024-09-12.md new file mode 100644 index 0000000..cbd9202 --- /dev/null +++ b/notes/2024-09-12.md @@ -0,0 +1,9 @@ + +#### 02:37 +- im making progress in setting up the multiplayer but now im running into an issue of every player is updating the same thing + +#### 02:38 +- actually i might be getting somewhere + +#### 02:49 +- okay i got it working but now i have to solve auras From 0a35a8fc1370eb3f30e4b2c505c4977d767d6c06 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 02:49:45 +0200 Subject: [PATCH 06/14] playerstate type --- src/types/card.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/types/card.ts b/src/types/card.ts index 880d77f..e10ffcb 100644 --- a/src/types/card.ts +++ b/src/types/card.ts @@ -48,3 +48,5 @@ export type GridItem = GameCard[]; * 36 GRAVE * */ export type GameState = GridItem[]; + +export type PlayersState = Record & { GLOBAL: GameState }; From 2ca128dcbe58a962f0398d0420030bca1dda12b5 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 02:49:52 +0200 Subject: [PATCH 07/14] update readme on constants --- src/components/organisms/GameBoard/constants.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/GameBoard/constants.ts b/src/components/organisms/GameBoard/constants.ts index 0da08ba..9dbaaed 100644 --- a/src/components/organisms/GameBoard/constants.ts +++ b/src/components/organisms/GameBoard/constants.ts @@ -17,8 +17,8 @@ export const LAYOUT_HEIGHTS = { nav, footer, body }; * GRID ORDERING * * Contains the grid, auras, hand, deck, atlas deck, grave + * grave is last element in enum * */ - export enum GRIDS { GRID_1, GRID_2, @@ -57,3 +57,9 @@ export enum GRIDS { ATLAS_DECK, GRAVE, } + +/** + * Length of hand, deck, deck-atlas, and grave (4) + * used to splice playerstate from global state + * */ +export const GRIDS_PERSONAL_LENGTH = GRIDS.GRAVE - GRIDS.AURA_12; From 7dc133c8cf9f9306c4db1271e63465028b5e1dd5 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 02:49:59 +0200 Subject: [PATCH 08/14] add p1 p2 toggle --- src/components/organisms/GameBoard/Layout.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/organisms/GameBoard/Layout.tsx b/src/components/organisms/GameBoard/Layout.tsx index c1caefb..80ebe97 100644 --- a/src/components/organisms/GameBoard/Layout.tsx +++ b/src/components/organisms/GameBoard/Layout.tsx @@ -5,6 +5,7 @@ import { LAYOUT_HEIGHTS } from "./constants"; import { GameFooter } from "./Footer"; import { GameStateActions } from "."; import { Auras } from "./Auras"; +import Link from "next/link"; const { nav, body, footer } = LAYOUT_HEIGHTS; @@ -18,11 +19,20 @@ export const GameLayout = ( background: "rgba(0,200,0,0.2)", padding: "0.5rem", height: nav, + display: "flex", + gap: "2rem", }} >

Playtest cards on a grid. Click to tap. Right click to view big.

+ +

p1

+ + + +

p2

+ From ba1fa73b38f58fe5c40a25b307fa48ad7baba403 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 02:50:06 +0200 Subject: [PATCH 09/14] working swap --- src/components/organisms/GameBoard/index.tsx | 81 ++++++++++++-------- src/pages/game.tsx | 76 +++++++++++++++--- 2 files changed, 111 insertions(+), 46 deletions(-) diff --git a/src/components/organisms/GameBoard/index.tsx b/src/components/organisms/GameBoard/index.tsx index 73c3414..40a448a 100644 --- a/src/components/organisms/GameBoard/index.tsx +++ b/src/components/organisms/GameBoard/index.tsx @@ -10,46 +10,62 @@ import { SortableItem } from "@/components/molecules/SortItem"; import { Box } from "styled-system/jsx"; import { Modal } from "@/components/atoms/Modal"; -import { Dispatch, SetStateAction, useState } from "react"; +import { useState } from "react"; import { FullCardAtlas } from "@/components/atoms/card-view/atlas"; import { GameCard, GameState } from "@/types/card"; +import { GRIDS } from "./constants"; +import { useRouter } from "next/router"; export type GameStateActions = { gridItems: GameState; - setGridItems: Dispatch>; + setGridItems: (state: GameState) => void; }; export const GameBoard = ({ gridItems, setGridItems }: GameStateActions) => { + const { query } = useRouter(); + const { activeCard, activeId, ...dragProps } = useHandleDrag({ gridItems, setGridItems, }); + const isReversed = query?.name === "p2"; + return ( - {gridItems?.slice(0, 20)?.map((cards, gridIndex) => ( - - card.id)} - strategy={rectSortingStrategy} + {(isReversed + ? gridItems.slice(0, 20).reverse() + : gridItems.slice(0, 20) + )?.map((cards, _gridIndex) => { + // Adjust the gridIndex if array was reversed + const gridIndex = isReversed + ? GRIDS.GRID_20 - _gridIndex + : _gridIndex; + + return ( + - {cards.map((card, cardIndex) => ( - - ))} - - - ))} + card.id)} + strategy={rectSortingStrategy} + > + {cards.map((card, cardIndex) => ( + + ))} + +
+ ); + })}
{activeId ? ( @@ -88,16 +104,13 @@ const SortItemWrapper = ({ const isTapped = card.isTapped; function toggleTap() { - props.setGridItems(() => { - const newGrid = [...props.gridItems]; - const card = newGrid[gridIndex][cardIndex]; - newGrid[gridIndex][cardIndex] = { - ...card, - isTapped: !card.isTapped, - } as GameCard; - - return newGrid; - }); + const newGrid = [...props.gridItems]; + const card = newGrid[gridIndex][cardIndex]; + newGrid[gridIndex][cardIndex] = { + ...card, + isTapped: !card.isTapped, + } as GameCard; + props.setGridItems(newGrid); } return ( diff --git a/src/pages/game.tsx b/src/pages/game.tsx index ed25720..81c7477 100644 --- a/src/pages/game.tsx +++ b/src/pages/game.tsx @@ -1,24 +1,76 @@ import { LoadDeck } from "@/components/molecules/LoadDeck"; import { GameBoard } from "@/components/organisms/GameBoard"; -import { GRIDS } from "@/components/organisms/GameBoard/constants"; -import { GameCard, GameState } from "@/types/card"; -import { useState } from "react"; +import { + GRIDS, + GRIDS_PERSONAL_LENGTH, +} from "@/components/organisms/GameBoard/constants"; +import { GameCard, GameState, PlayersState } from "@/types/card"; +import { useRouter } from "next/router"; +import { useMemo, useState } from "react"; -const initCards: GameCard[][] = Array.from({ length: 36 }, () => []); +const initGameState: GameCard[][] = Array.from({ length: 36 }, () => []); export default function GamePage() { - const [gridItems, setGridItems] = useState(initCards); + const { query } = useRouter(); + const name = (query?.name as string | undefined) ?? "p1"; + const isP2 = name === "p2"; - if ( - gridItems[GRIDS.DECK].length === 0 && - gridItems[GRIDS.HAND].length === 0 && - gridItems[GRIDS.GRAVE].length === 0 - ) + const [gridItems, setGridItems] = useState(initGameState); + const [players, setPlayers] = useState({ + p1: initGameState, + p2: initGameState, + GLOBAL: initGameState, + }); + + function setPlayer(playerName: keyof typeof players) { + return (state: GameState) => { + const newState = [...state]; // make a copy of state + const GLOBAL = newState.splice(0, GRIDS.AURA_12 + 1); // GLOBAL takes game grid + const GLOBAL_EMPTY = Array.from({ length: 4 }, () => []); // empties player data + setPlayers((prev) => ({ + ...prev, + GLOBAL: [...GLOBAL, ...GLOBAL_EMPTY], + [playerName]: state, + })); + }; + } + + const state = useMemo( + () => [ + ...players.GLOBAL.slice(0, GRIDS.AURA_12), + ...players[name as keyof typeof players].slice( + GRIDS.AURA_12, + GRIDS.AURA_12 + 5, + ), + ], + [players, name], + ); + + if (needsDeck(players["p1"])) return (
- +

Load deck for player 1

+
); - return ; + if (needsDeck(players["p2"])) + return ( +
+

Load deck for player 2

+ +
+ ); + + console.log({ players }); + + return ; +} + +function needsDeck(state: GameState) { + return ( + state[GRIDS.DECK].length === 0 && + state[GRIDS.HAND].length === 0 && + state[GRIDS.GRAVE].length === 0 + ); } From 595c531fcbf50f868017c83f17fe3ba782318cc3 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 03:15:45 +0200 Subject: [PATCH 10/14] fix redirect --- src/pages/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c6bbad9..ee73882 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -4,7 +4,7 @@ import { useRouter } from "next/router"; export default function Home() { const router = useRouter(); useEffect(() => { - router.push("/game"); + router.push("/game?name=p1"); }, []); return null; } From 5883e5d6afcd8cb7daeee5e770249a04eb12bfa1 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 03:15:50 +0200 Subject: [PATCH 11/14] fixed auras --- src/components/organisms/GameBoard/Auras/index.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/organisms/GameBoard/Auras/index.tsx b/src/components/organisms/GameBoard/Auras/index.tsx index ffb5062..c8df08d 100644 --- a/src/components/organisms/GameBoard/Auras/index.tsx +++ b/src/components/organisms/GameBoard/Auras/index.tsx @@ -8,6 +8,7 @@ import { Modal } from "@/components/atoms/Modal"; import { FullCardAtlas } from "@/components/atoms/card-view/atlas"; import { CardImage as FullCard } from "@/components/atoms/card-view/card"; import { CARD_CDN, GRIDS } from "../constants"; +import { useRouter } from "next/router"; export const Auras = (props: GameStateActions) => { return ( @@ -27,14 +28,19 @@ export const Auras = (props: GameStateActions) => { }; const Aura = (props: { card: GameCard; gridIndex: number; index: number }) => { - const auraCard = props.card; + const { query } = useRouter(); + const name = query?.name ?? "p1"; + const isReversed = name === "p2"; + const auraCard = props.card; const auraIndex = props.gridIndex - GRIDS.AURA_1; // normalize to zero const topIndex = Math.floor(auraIndex / 4) + 1; // increments every 4 - const top = `${topIndex * 25}%`; // in percent + // const top = `${topIndex * 25}%`; // in percent const leftIndex = 1 + (auraIndex % 4); // every 4, resets - const left = `${leftIndex * 20}%`; // in percent + // const left = `${leftIndex * 20}%`; // in percent + const top = isReversed ? `${(4 - topIndex) * 25}%` : `${topIndex * 25}%`; // Reverse top + const left = isReversed ? `${(5 - leftIndex) * 20}%` : `${leftIndex * 20}%`; // Reverse left return ( Date: Thu, 12 Sep 2024 03:15:58 +0200 Subject: [PATCH 12/14] fix default --- src/components/organisms/GameBoard/index.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/GameBoard/index.tsx b/src/components/organisms/GameBoard/index.tsx index 40a448a..a60edc1 100644 --- a/src/components/organisms/GameBoard/index.tsx +++ b/src/components/organisms/GameBoard/index.tsx @@ -28,7 +28,8 @@ export const GameBoard = ({ gridItems, setGridItems }: GameStateActions) => { setGridItems, }); - const isReversed = query?.name === "p2"; + const name = query?.name ?? "p1"; + const isReversed = name === "p2"; return ( From 42abd98e102de0687f61fe6cc806d74b65ee535d Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 03:20:14 +0200 Subject: [PATCH 13/14] add notes --- daily.js | 3 ++- notes/2024-09-12.md | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/daily.js b/daily.js index 9d071e0..dae4608 100644 --- a/daily.js +++ b/daily.js @@ -39,7 +39,8 @@ const addEntry = (entryText, isTodo) => { }; // Main script -const command = process.argv[2]; +// const command = process.argv[2]; +const command = "add"; const entryText = process.argv.slice(3).join(" "); if (command === "add" || command === "todo") { diff --git a/notes/2024-09-12.md b/notes/2024-09-12.md index cbd9202..7c4ba74 100644 --- a/notes/2024-09-12.md +++ b/notes/2024-09-12.md @@ -7,3 +7,6 @@ #### 02:49 - okay i got it working but now i have to solve auras + +#### 03:18 +- i got it working. the tricky thing with auras was i had to adjust the top left values because they would always look the same no matter the order From 2f4f0ce41954cedbec0df40d0742c1e5ae5ff852 Mon Sep 17 00:00:00 2001 From: jollygrin Date: Thu, 12 Sep 2024 03:20:16 +0200 Subject: [PATCH 14/14] fix build --- src/pages/game.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/game.tsx b/src/pages/game.tsx index 81c7477..293f126 100644 --- a/src/pages/game.tsx +++ b/src/pages/game.tsx @@ -1,9 +1,6 @@ import { LoadDeck } from "@/components/molecules/LoadDeck"; import { GameBoard } from "@/components/organisms/GameBoard"; -import { - GRIDS, - GRIDS_PERSONAL_LENGTH, -} from "@/components/organisms/GameBoard/constants"; +import { GRIDS } from "@/components/organisms/GameBoard/constants"; import { GameCard, GameState, PlayersState } from "@/types/card"; import { useRouter } from "next/router"; import { useMemo, useState } from "react"; @@ -13,9 +10,8 @@ const initGameState: GameCard[][] = Array.from({ length: 36 }, () => []); export default function GamePage() { const { query } = useRouter(); const name = (query?.name as string | undefined) ?? "p1"; - const isP2 = name === "p2"; - const [gridItems, setGridItems] = useState(initGameState); + // const [gridItems, setGridItems] = useState(initGameState); const [players, setPlayers] = useState({ p1: initGameState, p2: initGameState, @@ -62,8 +58,6 @@ export default function GamePage() { ); - console.log({ players }); - return ; }