feat: Implement game restart, battlefield styling with art crops and tapped stacks, and initial draw fixes.
Some checks failed
Build and Deploy / build (push) Failing after 1m10s

This commit is contained in:
2025-12-18 20:26:42 +01:00
parent ca7b5bf7fa
commit bc5eda5e2a
35 changed files with 1337 additions and 634 deletions

View File

@@ -0,0 +1,20 @@
# Implement dnd-kit for Game View
**Status:** Planned
**Date:** 2025-12-18
**Description:**
Replace the standard HTML5 Drag and Drop API in `GameView.tsx` with `@dnd-kit/core` to ensure a consistent, high-performance, and touch-friendly user experience similar to the Deck Builder.
**Technical Reference:**
- **DeckBuilderView.tsx:** Uses `DndContext`, `useDraggable`, and `useDroppable` for managing card movements.
- **GameView.tsx:** Currently uses `onDragStart`, `onDrop`, etc.
**Plan:**
1. **Install/Verify Dependencies:** `@dnd-kit/core` and `@dnd-kit/utilities` are already installed.
2. **Create Draggable Wrapper:** Create a `DraggableCard` component that uses `useDraggable` to wrap `CardComponent`.
3. **Create Droppable Zones:** Define `DroppableZone` components for Battlefield, Hand, Graveyard, Exile, etc.
4. **Implement Context:** Wrap the main game area in `DndContext`.
5. **Handle Drag Events:** Implement `onDragEnd` in `GameView` to handle logic previously in `handleZoneDrop` and `handleCardDrop`.
- Battlefield Drop -> `PLAY_LAND` / `CAST_SPELL` (positionless).
- Card on Card Drop -> `DECLARE_BLOCKERS` / `CAST_SPELL` (Targeting).
6. **Refactor Rendering:** Update the rendering of cards in `GameView` to use the new `DraggableCard` wrapper.