diff --git a/src/App.tsx b/src/App.tsx index c26af16..419e4a0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,7 +15,7 @@ export type Tier = { }; const TIERS: Tier[] = [ - { name: 'Start', unlockPrice: 0, buyPrice: 1, gubblePointChance: 0.0 }, + { name: 'Start', unlockPrice: 0, buyPrice: 1, gubblePointChance: 0.9 }, { name: 'Bronze', unlockPrice: 3, buyPrice: 2, gubblePointChance: 0.0 }, { name: 'Silver', unlockPrice: 7, buyPrice: 5, gubblePointChance: 0.0 }, { name: 'Gold', unlockPrice: 15, buyPrice: 10, gubblePointChance: 0.1 }, @@ -58,6 +58,8 @@ function App() { const [isStoreOpen, setIsStoreOpen] = useState(false); const [upgrades, setUpgrades] = useState({ evenDouble: false, oddDouble: false, allTripple: false, gubbleDouble: false, addFourthNumber: false, autoscratcher: false, swipeScratcher: false}); const [upgradeBought, setUpgradeBought] = useState(false); + // Add a new state for the popup + const [showDonation, setShowDonation] = useState(false); // Ref for scroll container const tierRowRef = useRef(null); @@ -80,6 +82,19 @@ function App() { } }, [highestUnlockedIndex]); + // Effect to show popup when money drops to zero + useEffect(() => { + if (money === 0) { + setShowDonation(true); + } + }, [money]); + + // Handler to accept the donation + const handleAcceptDonation = () => { + setMoney((m) => m + 30); + setShowDonation(false); + }; + // --- Tier Unlock Logic --- const handleUnlockTier = useCallback((tier: Tier) => { setMoney(m => { @@ -155,6 +170,25 @@ function App() { return (
+ {showDonation && ( +
+
+

💸 The Universe Has Chosen You!

+

+ We can see it in your aura: a legendary streak is just around the corner!
+ The cosmic Gubble spirits have whispered to us that your luck is about to turn.
+ As a sign of our faith in your unstoppable fortune, we are DONATING you $30!
+ Go forth, future jackpot winner, and let the reels of destiny spin in your favor! +

+ +
+
+ )} = ({ isOpen, onClose, gubblePoints if (!isOpen) return null; return (
-
+

Gubble Point Store

Gubble Points: {gubblePoints}