@devrongx/games 0.4.47 → 0.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,9 +5,9 @@ import { ILeaderboardEntry } from "./config";
|
|
|
5
5
|
import { OUTFIT, PointsIcon } from "./constants";
|
|
6
6
|
|
|
7
7
|
const RANK_COLORS = [
|
|
8
|
-
{ bg: "
|
|
9
|
-
{ bg: "
|
|
10
|
-
{ bg: "
|
|
8
|
+
{ bg: "#FFD700", text: "#000" },
|
|
9
|
+
{ bg: "#C0C0C0", text: "#000" },
|
|
10
|
+
{ bg: "#CD7F32", text: "#000" },
|
|
11
11
|
];
|
|
12
12
|
|
|
13
13
|
interface LeaderboardRowProps {
|
|
@@ -25,8 +25,8 @@ export const LeaderboardRow = ({ entry, rank, isLast }: LeaderboardRowProps) =>
|
|
|
25
25
|
<div
|
|
26
26
|
className="relative flex items-center gap-2 px-3 py-[6px] transition-all duration-300"
|
|
27
27
|
style={{
|
|
28
|
-
borderBottom: isLast ? "none" : "1px solid rgba(255,255,255,0.
|
|
29
|
-
background: entry.isYou ? "rgba(34,227,232,0.
|
|
28
|
+
borderBottom: isLast ? "none" : "1px solid rgba(255,255,255,0.08)",
|
|
29
|
+
background: entry.isYou ? "rgba(34,227,232,0.08)" : "#000",
|
|
30
30
|
}}
|
|
31
31
|
>
|
|
32
32
|
{entry.isYou && (
|
|
@@ -36,17 +36,17 @@ export const LeaderboardRow = ({ entry, rank, isLast }: LeaderboardRowProps) =>
|
|
|
36
36
|
<div className="w-[32px] flex-shrink-0 flex items-center justify-center">
|
|
37
37
|
{isTop3 && rankStyle ? (
|
|
38
38
|
<span
|
|
39
|
-
className="inline-flex items-center justify-center w-[
|
|
40
|
-
style={{ background: rankStyle.bg,
|
|
39
|
+
className="inline-flex items-center justify-center w-[22px] h-[22px] rounded-full text-[10px] font-extrabold"
|
|
40
|
+
style={{ background: rankStyle.bg, color: rankStyle.text, ...OUTFIT }}>
|
|
41
41
|
{rank}
|
|
42
42
|
</span>
|
|
43
43
|
) : (
|
|
44
|
-
<span className="text-[10px] text-white/
|
|
44
|
+
<span className="text-[10px] text-white/50 font-semibold" style={OUTFIT}>{rank.toLocaleString()}</span>
|
|
45
45
|
)}
|
|
46
46
|
</div>
|
|
47
47
|
<div className="flex items-center gap-1.5 flex-1 min-w-0">
|
|
48
48
|
<span
|
|
49
|
-
className={`text-[11px] truncate font-semibold ${entry.isYou ? "text-[#22E3E8]" :
|
|
49
|
+
className={`text-[11px] truncate font-semibold ${entry.isYou ? "text-[#22E3E8]" : "text-white"}`}
|
|
50
50
|
style={OUTFIT}>
|
|
51
51
|
{entry.wallet}
|
|
52
52
|
</span>
|
|
@@ -60,8 +60,8 @@ export const LeaderboardRow = ({ entry, rank, isLast }: LeaderboardRowProps) =>
|
|
|
60
60
|
<div className="w-[66px] flex-shrink-0 flex items-center justify-end gap-[3px]">
|
|
61
61
|
<PointsIcon size={9} />
|
|
62
62
|
<span
|
|
63
|
-
className=
|
|
64
|
-
style={{ ...OUTFIT, ...(entry.isYou ? { textShadow: "0 0 6px rgba(34,227,232,0.3)" } : {}) }}>
|
|
63
|
+
className="text-[11px] font-bold"
|
|
64
|
+
style={{ ...OUTFIT, color: "#22E3E8", ...(entry.isYou ? { textShadow: "0 0 6px rgba(34,227,232,0.3)" } : {}) }}>
|
|
65
65
|
{entry.pts.toLocaleString()}
|
|
66
66
|
</span>
|
|
67
67
|
</div>
|
|
@@ -842,11 +842,11 @@ export const PreMatchGame = ({
|
|
|
842
842
|
<div className="pt-1">
|
|
843
843
|
<p className="text-[10px] text-white uppercase tracking-wide mb-2 font-semibold" style={OUTFIT}>Leaderboard</p>
|
|
844
844
|
<div className="flex items-center gap-2 px-3 mb-1">
|
|
845
|
-
<span className="w-[32px] flex-shrink-0 text-center text-[8px] text-white/
|
|
846
|
-
<span className="flex-1 text-[8px] text-white/
|
|
847
|
-
<span className="w-[66px] flex-shrink-0 text-right text-[8px] text-white/
|
|
845
|
+
<span className="w-[32px] flex-shrink-0 text-center text-[8px] text-white/50 uppercase tracking-widest font-bold" style={OUTFIT}>#</span>
|
|
846
|
+
<span className="flex-1 text-[8px] text-white/50 uppercase tracking-widest font-bold pl-2" style={OUTFIT}>Player</span>
|
|
847
|
+
<span className="w-[66px] flex-shrink-0 text-right text-[8px] text-white/50 uppercase tracking-widest font-bold" style={OUTFIT}>Score</span>
|
|
848
848
|
</div>
|
|
849
|
-
<div className="h-px bg-white/
|
|
849
|
+
<div className="h-px bg-white/10 mb-1" />
|
|
850
850
|
<div className="flex flex-col">
|
|
851
851
|
{leaderboardRows.map((entry, i, arr) => (
|
|
852
852
|
<div key={entry.wallet + (entry.rank ?? i)}>
|
|
@@ -423,7 +423,8 @@ export function calcBetSummary(
|
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
let totalEntry = 0;
|
|
426
|
-
let
|
|
426
|
+
let individualReward = 0;
|
|
427
|
+
let parlayReward = 0;
|
|
427
428
|
let weightedRiskSum = 0;
|
|
428
429
|
|
|
429
430
|
for (const [mIdxStr, { optionIdx, amount, parlaySlot }] of Object.entries(bets)) {
|
|
@@ -434,7 +435,7 @@ export function calcBetSummary(
|
|
|
434
435
|
|
|
435
436
|
const isInActiveParlay = parlaySlot !== null && activeSlots.has(parlaySlot);
|
|
436
437
|
if (!isInActiveParlay) {
|
|
437
|
-
|
|
438
|
+
individualReward += Math.round(amount * opt.odds);
|
|
438
439
|
}
|
|
439
440
|
}
|
|
440
441
|
|
|
@@ -448,10 +449,11 @@ export function calcBetSummary(
|
|
|
448
449
|
combinedOdds *= opt.odds;
|
|
449
450
|
parlayStake += bet.amount;
|
|
450
451
|
}
|
|
451
|
-
|
|
452
|
+
parlayReward += Math.round(parlayStake * combinedOdds * (config.compoundMultipliers[legs.length] ?? 1));
|
|
452
453
|
}
|
|
453
454
|
|
|
454
|
-
const
|
|
455
|
+
const baseReward = individualReward + parlayReward;
|
|
456
|
+
const compoundedReward = baseReward;
|
|
455
457
|
const remainingBalance = startingBalance - totalEntry;
|
|
456
458
|
const potentialBalance = remainingBalance + compoundedReward;
|
|
457
459
|
const riskPercent = totalEntry > 0
|
|
@@ -599,8 +601,5 @@ export function calcDisplayReward(
|
|
|
599
601
|
betAmount?: number,
|
|
600
602
|
): number {
|
|
601
603
|
const base = betAmount != null ? Math.round(betAmount * opt.odds) : optionReward(opt);
|
|
602
|
-
if (isSelected && selectedCount >= 2) {
|
|
603
|
-
return Math.round(base * compoundMultiplier);
|
|
604
|
-
}
|
|
605
604
|
return base;
|
|
606
605
|
}
|