-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Implement real player functionality for the Crash game. - Store and display the amount gambled and time spent on site. - Add an upgrade feature for increasing earnings per second on the homepage. - Include a leaderboard showcasing top player balances. - Add footer with creator credit: "made by @darksplice - Enjoy FreakyGambling." - Integrate with GitHub Pages for deployment. [skip gpt_engineer]
- Loading branch information
1 parent
7f67cfb
commit afe4242
Showing
6 changed files
with
125 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
const Footer = () => { | ||
return ( | ||
<footer className="bg-[#252640] text-white p-4 text-center"> | ||
<p>Made by @darksplice - Enjoy FreakyGambling</p> | ||
</footer> | ||
); | ||
}; | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
const Leaderboard = () => { | ||
const [leaderboard, setLeaderboard] = useState([]); | ||
|
||
useEffect(() => { | ||
const users = JSON.parse(localStorage.getItem('users')) || []; | ||
const sortedUsers = users.sort((a, b) => b.balance - a.balance).slice(0, 10); | ||
setLeaderboard(sortedUsers); | ||
}, []); | ||
|
||
return ( | ||
<div className="bg-[#252640] rounded-lg shadow-md p-6 mt-8"> | ||
<h2 className="text-2xl font-semibold mb-4">Leaderboard</h2> | ||
<div className="overflow-y-auto max-h-60"> | ||
{leaderboard.map((user, index) => ( | ||
<div key={index} className="flex justify-between items-center py-2 border-b border-gray-700"> | ||
<span>{index + 1}. {user.username}</span> | ||
<span>${user.balance.toFixed(2)}</span> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Leaderboard; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { Button } from "@/components/ui/button"; | ||
|
||
const UpgradeSystem = ({ user, setUser }) => { | ||
const upgradeCost = (user.moneyPerSecond || 1/3) * 100; | ||
|
||
const handleUpgrade = () => { | ||
if (user.balance >= upgradeCost) { | ||
const updatedUser = { | ||
...user, | ||
balance: user.balance - upgradeCost, | ||
moneyPerSecond: (user.moneyPerSecond || 1/3) + 1/3 | ||
}; | ||
localStorage.setItem('user', JSON.stringify(updatedUser)); | ||
setUser(updatedUser); | ||
} else { | ||
alert("Insufficient balance for upgrade!"); | ||
} | ||
}; | ||
|
||
return ( | ||
<div className="bg-[#252640] rounded-lg shadow-md p-6 mt-8"> | ||
<h2 className="text-2xl font-semibold mb-4">Upgrade Money Generation</h2> | ||
<p>Current rate: ${(user.moneyPerSecond || 1/3).toFixed(2)} per second</p> | ||
<p>Upgrade cost: ${upgradeCost.toFixed(2)}</p> | ||
<Button onClick={handleUpgrade} className="mt-4">Upgrade</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default UpgradeSystem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters