diff --git a/next.config.mjs b/next.config.mjs index 4678774e..26d9b6ad 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,8 @@ /** @type {import('next').NextConfig} */ -const nextConfig = {}; +const nextConfig = { + images: { + domains: ['karabast-assets.s3.amazonaws.com'], + }, +}; export default nextConfig; diff --git a/src/app/GameBoard/page.tsx b/src/app/GameBoard/page.tsx index 287dc61b..a666c3c5 100644 --- a/src/app/GameBoard/page.tsx +++ b/src/app/GameBoard/page.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ "use client"; import React, { useState, useRef, useEffect, useContext } from "react"; -import { Box, Grid2 as Grid } from "@mui/material"; +import { Box, Grid2 as Grid, Typography } from "@mui/material"; import { s3ImageURL } from "../_utils/s3Utils"; import ChatDrawer from "../_components/Gameboard/_subcomponents/Overlays/ChatDrawer/ChatDrawer"; import OpponentCardTray from "../_components/Gameboard/OpponentCardTray/OpponentCardTray"; @@ -11,6 +11,8 @@ import ResourcesOverlay from "../_components/Gameboard/_subcomponents/Overlays/R import BasicPrompt from "../_components/Gameboard/_subcomponents/Overlays/Prompts/BasicPrompt"; import { useGame } from "../_contexts/Game.context"; import { useSidebar } from "../_contexts/Sidebar.context"; +import { transform } from "next/dist/build/swc"; +import { text } from "stream/consumers"; const GameBoard = () => { const { getOpponent, connectedPlayer, gameState } = useGame(); @@ -49,15 +51,32 @@ const GameBoard = () => { // ----------------------Styles-----------------------------// - const mainBoxStyle = { - flexGrow: 1, - transition: "margin-right 0.3s ease", - mr: sidebarOpen ? `${drawerWidth}px` : "0", - height: "100vh", - position: "relative", - backgroundImage: `url(${s3ImageURL("game/board-background-1.png")})`, - backgroundSize: "cover", - backgroundPosition: "center", + const styles = { + mainBoxStyle: { + flexGrow: 1, + transition: "margin-right 0.3s ease", + mr: sidebarOpen ? `${drawerWidth}px` : "0", + height: "100vh", + position: "relative", + backgroundImage: `url(${s3ImageURL("game/board-background-1.png")})`, + backgroundSize: "cover", + backgroundPosition: "center", + }, + centralPromptContainer: { + position: "absolute", + top: "50%", + left: "50%", + transform: "translate(-50%, -50%)", + display: "flex", + justifyContent: "center", + alignItems: "center", + width: "50vw", + }, + promptStyle: { + textAlign: "center", + fontSize: "1.3em", + background: "radial-gradient(ellipse, rgba(0,0,0, 0.9), rgba(0,0,0,0.7), rgba(0,0,0,0.0))", + }, }; if (!gameState || !connectedPlayer) { @@ -66,7 +85,7 @@ const GameBoard = () => { return ( - + { currentRound={round} /> )} + + {gameState.players[connectedPlayer]?.promptState.menuTitle} + = ({ //----------------Styles----------------// - const leftColumnStyle = { - justifyContent: "flex-end", - alignItems: "center", - }; - - const rightColumnStyle = { - justifyContent: "flex-start", - alignItems: "center", - }; - const containerStyle = { - height: "100%", - width: "100%", - justifyContent: "center", - alignItems: "center" - }; - const lobbyLeaderBaseContainer = { - display: "flex", - flexDirection: "column", - alignItems: "center", - width: "100%", + const styles = { + leftColumnStyle: { + justifyContent: "flex-end", + alignItems: "center", + }, + rightColumnStyle: { + justifyContent: "flex-start", + alignItems: "center", + }, + middleColumnStyle: { + justifyContent: "center", + alignItems: "center", + }, + middleColumnContent: { + display: "flex", + justifyContent: "space-between", + alignItems: "center", + height: "100%", + flexDirection: "column", + padding: "1em", + }, + containerStyle: { + height: "100%", + width: "100%", + justifyContent: "center", + alignItems: "center" + }, + leaderBaseContainer: { + display: "flex", + flexDirection: "column", + alignItems: "center", + width: "100%", + }, + rowStyle: { + flexGrow: 1, + width: "100%" + }, } - const rowStyle = { - flexGrow: 1, - width: "100%" - }; - //the title of the deck i believe - const redBoxStyle = { - position: "absolute", - bottom: "10px", - left: "50%", - transform: "translateX(-50%)", - backgroundColor: "red", - borderRadius: "4px", - p: "4px 8px", - }; - - const redBoxTypographyStyle = { - color: "white", - fontFamily: "var(--font-barlow), sans-serif", - fontWeight: "600", - fontSize: "1em", - }; return ( - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + diff --git a/src/app/_components/Gameboard/OpponentCardTray/OpponentCardTray.tsx b/src/app/_components/Gameboard/OpponentCardTray/OpponentCardTray.tsx index 4bfb26ab..c8e3a5d7 100644 --- a/src/app/_components/Gameboard/OpponentCardTray/OpponentCardTray.tsx +++ b/src/app/_components/Gameboard/OpponentCardTray/OpponentCardTray.tsx @@ -1,5 +1,6 @@ import React from "react"; -import Grid from "@mui/material/Grid2"; +import { CloseOutlined, SettingsOutlined } from "@mui/icons-material"; +import { Typography, Box, Grid2 as Grid } from "@mui/material"; import Resources from "../_subcomponents/PlayerTray/Resources"; import PlayerHand from "../_subcomponents/PlayerTray/PlayerHand"; import DeckDiscard from "../_subcomponents/PlayerTray/DeckDiscard"; @@ -8,44 +9,65 @@ import { useGame } from "@/app/_contexts/Game.context"; const OpponentCardTray: React.FC = ({ trayPlayer }) => { //---------------Styles------------------- // - const leftColumn = { - display: "flex", - alignItems: "flex-start", - justifyContent: "flex-start", - pl: "2em", - pt: "2em", - }; - - const centerColumn = { - height: "100%", - display: "flex", - flexDirection: "column", - alignItems: "center", - justifyContent: "center", - }; + const styles = { + leftColumn: { + display: "flex", + alignItems: "flex-start", + justifyContent: "flex-start", + pl: "2em", + pt: "2em", + }, + centerColumn: { + height: "100%", + display: "flex", + flexDirection: "column", + alignItems: "center", + justifyContent: "center", + }, + rightColumn: { + display: "flex", + alignItems: "center", + justifyContent: "flex-end", + pr: "2em", + pt: "2em", + }, + lastPlayed: { + border: "2px solid #FFFFFF55" - const rightColumn = { - display: "flex", - alignItems: "flex-start", - justifyContent: "flex-end", - pr: "2em", - pt: "2em", + }, + menuStyles: { + display: "flex", + flexDirection: "column", + } }; const { gameState, connectedPlayer, getOpponent } = useGame(); return ( - - + + + + + - + - - + + + Initiative + + + Last Played: + + + + + + ); diff --git a/src/app/_components/Gameboard/PlayerCardTray/PlayerCardTray.tsx b/src/app/_components/Gameboard/PlayerCardTray/PlayerCardTray.tsx index 4efcba53..edb7aeda 100644 --- a/src/app/_components/Gameboard/PlayerCardTray/PlayerCardTray.tsx +++ b/src/app/_components/Gameboard/PlayerCardTray/PlayerCardTray.tsx @@ -1,5 +1,7 @@ import React from "react"; +import Box from "@mui/material/Box"; import Grid from "@mui/material/Grid2"; +import { ChatBubbleOutline } from "@mui/icons-material"; import Resources from "../_subcomponents/PlayerTray/Resources"; import DeckDiscard from "../_subcomponents/PlayerTray/DeckDiscard"; import CardActionTray from "../_subcomponents/PlayerTray/CardActionTray"; @@ -19,8 +21,7 @@ const PlayerCardTray: React.FC = ({ display: "flex", alignItems: "center", justifyContent: "flex-start", - pl: "2em", - pt: "2em", + padding: "1em", }; const centerColumnStyle = { @@ -35,24 +36,28 @@ const PlayerCardTray: React.FC = ({ display: "flex", alignItems: "center", justifyContent: "flex-end", - pr: "2em", - pt: "2em", + padding: "1em", }; return ( - + + + + - {/* */} - + + + + ); diff --git a/src/app/_components/Gameboard/_subcomponents/PlayerTray/CardActionTray.tsx b/src/app/_components/Gameboard/_subcomponents/PlayerTray/CardActionTray.tsx index 1a4e5f39..44afa5d1 100644 --- a/src/app/_components/Gameboard/_subcomponents/PlayerTray/CardActionTray.tsx +++ b/src/app/_components/Gameboard/_subcomponents/PlayerTray/CardActionTray.tsx @@ -21,9 +21,6 @@ const CardActionTray: React.FC = () => { spacing={2} sx={actionContainerStyle} > - - {playerState.promptState.menuTitle} - {playerState.promptState.buttons.map((button: IButtonsProps) => ( = ( const discardCardStyle = { backgroundColor: "#282828E6", - width: "9vh", - height: "9vh", + width: "7vh", + height: "9.5vh", }; const cardContentStyle = { diff --git a/src/app/_components/Gameboard/_subcomponents/PlayerTray/Resources.tsx b/src/app/_components/Gameboard/_subcomponents/PlayerTray/Resources.tsx index 67cc2396..9a55930b 100644 --- a/src/app/_components/Gameboard/_subcomponents/PlayerTray/Resources.tsx +++ b/src/app/_components/Gameboard/_subcomponents/PlayerTray/Resources.tsx @@ -1,6 +1,7 @@ import React from "react"; import { Card, CardContent, Box, Typography } from "@mui/material"; import Image from "next/image"; +import { s3TokenImageURL } from "@/app/_utils/s3Utils"; import { IResourcesProps } from "@/app/_components/Gameboard/GameboardTypes"; import { useGame } from "@/app/_contexts/Game.context"; @@ -11,14 +12,16 @@ const Resources: React.FC = ({ //------------------------STYLES------------------------// const cardStyle = { - backgroundColor: "#282828E6", - width: "9.52vw", - height: "9vh", + width: "auto", + background: "transparent", display: "flex", borderRadius: "5px", justifyContent: "center", alignItems: "center", transition: "background-color 0.3s ease", + border: "1px solid #FFFFFF55", + padding: "1em", + overflow: "visible", "&:hover": { background: trayPlayer === "player" @@ -27,24 +30,21 @@ const Resources: React.FC = ({ }, }; + const imageStyle = { + width: "1.6em", + marginRight: "10px", + } + const boxStyle = { display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "row", - gap: "1vw", - height: "4.47vh", - }; - - const imageStyle = { - width: "2.50vw", - height: `calc(2.50vw * 1.357)`, // this was the image ratio in the figma images }; const availableAndTotalResourcesTextStyle = { - fontFamily: "var(--font-barlow), sans-serif", fontWeight: "800", - fontSize: "3.2em", + fontSize: "2.2em", color: "white", }; @@ -65,11 +65,12 @@ const Resources: React.FC = ({ Resource Icon {availableResources}/{totalResources} diff --git a/src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx b/src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx index 37a657b0..c3cba5b4 100644 --- a/src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx +++ b/src/app/_components/Gameboard/_subcomponents/UnitsBoard.tsx @@ -4,44 +4,13 @@ import GameCard from "../../_sharedcomponents/Cards/GameCard/GameCard"; import { ICardData } from "../../_sharedcomponents/Cards/CardTypes"; import { IUnitsBoardProps } from "@/app/_components/Gameboard/GameboardTypes"; import { useGame } from "@/app/_contexts/Game.context"; +import { headers } from "next/headers"; +import { Height, Padding } from "@mui/icons-material"; const UnitsBoard: React.FC = ({ sidebarOpen, arena }) => { - //------------------------STYLES------------------------// - const mainBoxStyle = { - borderRadius: "20px", - height: "60vh", - width: sidebarOpen ? "32vw" : "36vw", - ml: ".3vw", - p: "1vh", - }; - - const containerStyle = { - height: "100%", - }; - - const opponentGridStyle = { - flexGrow: 1, - display: "flex", - justifyContent: arena == "groundArena" ? "flex-start": "flex-end", - alignItems: "flex-start", - gap: "0.5vw", - flexWrap: "nowrap", - overflowX: "auto", - }; - - const playerGridStyle = { - flexGrow: 1, - display: "flex", - justifyContent: arena == "groundArena" ? "flex-start": "flex-end", - alignItems: "flex-end", - gap: "0.5vw", - flexWrap: "nowrap", - overflowX: "auto", - }; - //------------------------CONTEXT------------------------// /** * Takes an array of cards which can be main units or upgrades, @@ -86,11 +55,44 @@ const UnitsBoard: React.FC = ({ const playerUnits = attachUpgrades(rawPlayerUnits, upgradeMapping); const opponentUnits = attachUpgrades(rawOpponentUnits, upgradeMapping); + const styles = { + mainBoxStyle: { + borderRadius: "20px", + border: "2px solid #FFFFFF55", + height: "100%", + width: "100%", + padding: "1em", + margin: "1em", + }, + containerStyle: { + height: "100%", + }, + opponentGridStyle: { + flexGrow: 1, + display: "flex", + justifyContent: arena == "groundArena" ? "flex-start": "flex-end", + alignItems: "flex-start", + gap: "0.5vw", + flexWrap: "nowrap", + overflowX: "auto", + }, + playerGridStyle: { + flexGrow: 1, + display: "flex", + justifyContent: arena == "groundArena" ? "flex-start": "flex-end", + alignItems: "flex-end", + gap: "0.5vw", + flexWrap: "nowrap", + overflowX: "auto", + }, + }; + + return ( - - + + {/* Opponent's Ground Units */} - + {opponentUnits.map((card: ICardData) => ( @@ -99,7 +101,7 @@ const UnitsBoard: React.FC = ({ {/* Player's Ground Units */} - + {playerUnits.map((card: ICardData) => ( diff --git a/src/app/_components/HomePage/HomePagePlayMode.tsx b/src/app/_components/HomePage/HomePagePlayMode.tsx index 9197446d..8d191868 100644 --- a/src/app/_components/HomePage/HomePagePlayMode.tsx +++ b/src/app/_components/HomePage/HomePagePlayMode.tsx @@ -98,9 +98,11 @@ const HomePagePlayMode: React.FC = () => { Test Game Setups {testGameList.map((filename, index) => { return ( - + + + ); })} diff --git a/src/app/_components/_sharedcomponents/Cards/GameCard/GameCard.tsx b/src/app/_components/_sharedcomponents/Cards/GameCard/GameCard.tsx index 4abfe084..d15d0cef 100644 --- a/src/app/_components/_sharedcomponents/Cards/GameCard/GameCard.tsx +++ b/src/app/_components/_sharedcomponents/Cards/GameCard/GameCard.tsx @@ -101,7 +101,7 @@ const GameCard: React.FC = ({ } : { // For "standard" or other sizes: - height: size === "standard" ? "10rem" : "8rem", + height: size === "standard" ? "10rem" : "7.7rem", width: size === "standard" ? "7.18rem" : "8rem", border: `2px solid ${cardBorderColor(cardData)}`, /*...(cardData.exhausted &&{ @@ -110,6 +110,9 @@ const GameCard: React.FC = ({ })*/ } ), + "&:hover": { + cursor: "pointer", + }, }, cardContentStyle: {