1
0
forked from mico/idle_moloch

QoL updates

This commit is contained in:
mic0 2024-10-31 22:40:18 +01:00
parent e46d6991a4
commit d9e8c2f8fd
Signed by: mico
GPG Key ID: A3F8023524CF1C8D
8 changed files with 35 additions and 9 deletions

View File

@ -81,7 +81,7 @@ const BossInfo = () => {
return () => clearInterval(tickInterval) return () => clearInterval(tickInterval)
}, [balance, army?.profit_per_second, player?.last_raided_at, boss?.level]) }, [balance, army?.profit_per_second, player?.last_raided_at, boss?.level])
return <div className={styles.bossInfo}> return <div className={styles.bossInfo}>
<p><strong className={bossLevelToClass[boss?.level || 0]}>{bossToName[variant]}</strong> Moloch <small>(lvl {boss ? boss.level + 1 : 0})</small></p> <p><strong className={bossLevelToClass[variant]}>{bossToName[variant]}</strong> Moloch <small>(lvl {boss ? boss.level + 1 : 0})</small></p>
<p><strong className={styles.reward}>{parseFloat(parseFloat(formatUnits(bossToReward[boss?.level || 0], 18).toString()).toFixed(4))} RGCVII</strong> <small>reward</small></p> <p><strong className={styles.reward}>{parseFloat(parseFloat(formatUnits(bossToReward[boss?.level || 0], 18).toString()).toFixed(4))} RGCVII</strong> <small>reward</small></p>
<p> <p>
<strong>{parseFloat((chanceToDefeat.current * 100).toFixed(2))} % to slay</strong>{" "} <strong>{parseFloat((chanceToDefeat.current * 100).toFixed(2))} % to slay</strong>{" "}

View File

@ -43,8 +43,8 @@ export const toReadable = (rawValue: bigint) => {
} else { } else {
const divided = value / suffixes[i - 1].value; const divided = value / suffixes[i - 1].value;
const numStr = (value % suffixes[i - 1].value).toString().slice(0, 3); const numStr = (value % suffixes[i - 1].value).toString().slice(0, 3);
const remainder = parseInt(numStr.replace(/0+$/, ''), 10); const remainder = numStr == "0" ? "" : "." + parseInt(numStr.replace(/0+$/, ''), 10);
return `${divided.toString()}.${remainder.toString()} ${suffixes[i - 1].suffix}`; return `${divided.toString()}${remainder.toString()} ${suffixes[i - 1].suffix}`;
} }
} }
} }

View File

@ -198,8 +198,8 @@ function PixelatedQuote() {
setTimeout(() => { setTimeout(() => {
setIsShown(false); setIsShown(false);
}, 4000); }, 8000);
}, 6000); }, 10000);
return () => { return () => {
if (intervalIdRef.current !== null) { if (intervalIdRef.current !== null) {

View File

@ -16,7 +16,8 @@ const RegistrationModal = ({ isOpen, setIsOpen }: RegistrationModalProps) => {
}, [register, setIsOpen]) }, [register, setIsOpen])
if (!isOpen) return null; if (!isOpen) return null;
return <div className={bgStyles.leaderboardOverlay}><div className={styles.modal}> return <div className={bgStyles.leaderboardOverlay}><div className={styles.modal}>
<h2 style={{ textAlign: "center" }}>Insert coins to continue</h2> <span className={styles.closeBtn} onClick={() => setIsOpen(false)}>x</span>
<h2 className={styles.textCenter}>Insert coins to continue</h2>
<div> <div>
<button onClick={() => onRegister("RGCVII")}>500 RGCVII</button> <button onClick={() => onRegister("RGCVII")}>500 RGCVII</button>
<button onClick={() => onRegister("ETH")}>0.0005 ETH</button> <button onClick={() => onRegister("ETH")}>0.0005 ETH</button>

View File

@ -48,7 +48,7 @@ const Scene = () => {
className={styles.leaderboardButton} className={styles.leaderboardButton}
title="Leaderboard" title="Leaderboard"
> >
📜 Top players 📜
</button> </button>
{isLeaderboardOpen && ( {isLeaderboardOpen && (
<div className={styles.leaderboardOverlay}> <div className={styles.leaderboardOverlay}>

View File

@ -36,6 +36,7 @@ function MyApp({ Component, pageProps }: AppProps) {
h4, h4,
h5, h5,
h6, h6,
button,
.title { .title {
font-family: ${font.style.fontFamily}; font-family: ${font.style.fontFamily};
} }

View File

@ -373,8 +373,8 @@
.leaderboardButton { .leaderboardButton {
position: absolute; position: absolute;
top: 80px; top: 30px;
right: 30px; left: 80px;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
border: none; border: none;
border-radius: 5px; border-radius: 5px;

View File

@ -82,6 +82,30 @@
font-size: 2rem; font-size: 2rem;
} }
} }
.textCenter {
text-align: center;
}
.closeBtn {
display: inline-block;
width: 32px;
height: 32px;
text-align: center;
line-height: 26px;
border-radius: 4px;
position: absolute;
right: 32px;
top: 32px;
background: black;
cursor: pointer;
transition: all 0.2s ease;
}
.closeBtn:hover {
color: var(--hover-color);
transform: scale(1.1);
}
.closeBtn::active {
transform: scale(1.2);
}
@keyframes spin { @keyframes spin {
0% { 0% {