diff --git a/src/App.tsx b/src/App.tsx index 1ace027..f9c8c26 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,9 +9,17 @@ type Tier = { }; const TIERS: Tier[] = [ + { name: 'Start', unlockPrice: 0, buyPrice: 1 }, { name: 'Bronze', unlockPrice: 2, buyPrice: 3 }, { name: 'Silver', unlockPrice: 5, buyPrice: 7 }, { name: 'Gold', unlockPrice: 10, buyPrice: 15 }, + { name: 'Platinum', unlockPrice: 20, buyPrice: 30 }, + { name: 'Diamond', unlockPrice: 50, buyPrice: 75 }, + { name: 'Master', unlockPrice: 100, buyPrice: 150 }, + { name: 'Legend', unlockPrice: 200, buyPrice: 300 }, + { name: 'Ultimate', unlockPrice: 500, buyPrice: 750 }, + { name: 'Champion', unlockPrice: 1000, buyPrice: 1500 }, + { name: 'Supreme', unlockPrice: 2000, buyPrice: 3000 }, ]; function App() { @@ -19,8 +27,6 @@ function App() { const [money, setMoney] = useState(20); // User starts with $20 const [unlockedTiers, setUnlockedTiers] = useState([]); // Unlocked tier names // Remove selectedTier state - // const [selectedTier, setSelectedTier] = useState(null); // Currently selected tier - const [count, setCount] = useState(0) // --- Card State --- const [card, setCard] = useState<{ @@ -89,12 +95,22 @@ function App() { } }, [card]); + // --- Card Disappear After All Scratched --- + React.useEffect(() => { + if (!card) return; + const allScratched = card.fields.every(f => f.scratched); + if (allScratched) { + const timeout = setTimeout(() => setCard(null), 1500); + return () => clearTimeout(timeout); + } + }, [card]); + // --- UI --- return (

Scratch Card Game

Money: ${money}
-
+
{TIERS.map((tier) => { const unlocked = unlockedTiers.includes(tier.name); return (