diff --git a/src/client/src/modules/draft/DeckBuilderView.tsx b/src/client/src/modules/draft/DeckBuilderView.tsx index 0335d89..b267046 100644 --- a/src/client/src/modules/draft/DeckBuilderView.tsx +++ b/src/client/src/modules/draft/DeckBuilderView.tsx @@ -147,6 +147,13 @@ export const DeckBuilderView: React.FC = ({ initialPool, a const [deck, setDeck] = useState([]); const [lands, setLands] = useState({ Plains: 0, Island: 0, Swamp: 0, Mountain: 0, Forest: 0 }); const [hoveredCard, setHoveredCard] = useState(null); + const [displayCard, setDisplayCard] = useState(null); + + React.useEffect(() => { + if (hoveredCard) { + setDisplayCard(hoveredCard); + } + }, [hoveredCard]); // --- Land Advice Logic --- const landSuggestion = useMemo(() => { @@ -381,29 +388,56 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
{/* Zoom Sidebar */} -
- {hoveredCard ? ( -
- {hoveredCard.name} -
-

{hoveredCard.name}

-

{hoveredCard.type_line}

- {hoveredCard.oracle_text && ( -
- {hoveredCard.oracle_text.split('\n').map((line: string, i: number) =>

{line}

)} +
+
+
+ {/* Front Face (Hovered Card) */} +
+ {(hoveredCard || displayCard) && ( +
+ {(hoveredCard +
+

{(hoveredCard || displayCard).name}

+

{(hoveredCard || displayCard).type_line}

+ {(hoveredCard || displayCard).oracle_text && ( +
+ {(hoveredCard || displayCard).oracle_text.split('\n').map((line: string, i: number) =>

{line}

)} +
+ )} +
)}
+ + {/* Back Face (Card Back) */} +
+ Card Back +
- ) : ( -
- Hover Card -
- )} +
{/* Content Area */} @@ -414,7 +448,7 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
Card Pool ({pool.length})
-
+
{renderLandStation()}
@@ -424,7 +458,7 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
Deck ({deck.length})
-
+
@@ -436,7 +470,7 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
Card Pool ({pool.length})
-
+
{renderLandStation()}
@@ -446,7 +480,7 @@ export const DeckBuilderView: React.FC = ({ initialPool, a
Deck ({deck.length})
-
+
diff --git a/src/server/index.ts b/src/server/index.ts index 1a3abf2..1d59cda 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -37,6 +37,7 @@ app.use(express.json({ limit: '50mb' })); // Increase limit for large card lists // Serve static images (Nested) app.use('/cards', express.static(path.join(__dirname, 'public/cards'))); +app.use('/images', express.static(path.join(__dirname, 'public/images'))); // API Routes app.get('/api/health', (_req: Request, res: Response) => { diff --git a/src/server/public/images/back.jpg b/src/server/public/images/back.jpg new file mode 100644 index 0000000..9ec4bf6 Binary files /dev/null and b/src/server/public/images/back.jpg differ diff --git a/src/vite.config.ts b/src/vite.config.ts index 39eb98c..e89806e 100644 --- a/src/vite.config.ts +++ b/src/vite.config.ts @@ -19,6 +19,7 @@ export default defineConfig({ proxy: { '/api': 'http://localhost:3000', // Proxy API requests to backend '/cards': 'http://localhost:3000', // Proxy cached card images + '/images': 'http://localhost:3000', // Proxy static images '/socket.io': { target: 'http://localhost:3000', ws: true