Skip to content

Instantly share code, notes, and snippets.

@BoogieWithACookie1722
Created November 20, 2025 06:12
Show Gist options
  • Select an option

  • Save BoogieWithACookie1722/0c046c62251c8e2cce3cb127189bdddc to your computer and use it in GitHub Desktop.

Select an option

Save BoogieWithACookie1722/0c046c62251c8e2cce3cb127189bdddc to your computer and use it in GitHub Desktop.
Mastery Calc
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Power Gain Time Calculator</title>
<style>
body {
font-family: Segoe UI, sans-serif;
background: #0e0e0e;
color: #f5f5f5;
text-align: center;
margin-top: 60px;
}
input {
padding: 8px;
border-radius: 8px;
border: none;
width: 160px;
text-align: center;
margin: 6px;
background: #1e1e1e;
color: white;
}
input:focus {
outline: 2px solid #4b7bec;
}
.result {
color: #4b7bec;
margin-top: 25px;
font-size: 20px;
font-weight: bold;
}
.container {
background: #161616;
display: inline-block;
padding: 25px 45px;
border-radius: 20px;
box-shadow: 0 0 15px rgba(75, 123, 236, 0.25);
}
h2 {
color: #4b7bec;
margin-bottom: 20px;
}
label {
color: #ddd;
}
footer {
margin-top: 40px;
font-size: 14px;
color: #4b7bec;
opacity: 0.8;
text-shadow: 0 0 8px #4b7bec;
transition: all 0.3s ease-in-out;
}
footer a {
color: #4b7bec;
text-decoration: none;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
footer a:hover {
text-shadow: 0 0 20px #4b7bec, 0 0 40px #4b7bec, 0 0 60px #4b7bec;
color: #00f0ff;
}
</style>
</head>
<body>
<div class="container">
<h2>⚡ Power Gain Time Calculator ⚡</h2>
<div>
<label>Current Power:</label><br>
<input id="current" value="37No"><br>
<label>Target Power:</label><br>
<input id="target" value="160No"><br>
<label>Power Per Click:</label><br>
<input id="power" value="590Sp"><br>
<label>Clicks Per Second:</label><br>
<input id="cps" value="5.6"><br>
<div class="result" id="result">⏱️ Time Needed: —</div>
</div>
</div>
<footer>Created by <a href="https://discord.com/users/713542970158350458" target="_blank">ReVex</a> 💠</footer>
<script>
function convertToNumber(val) {
val = val.trim();
const suffixes = {
"K":3, "M":6, "B":9, "T":12, "Qa":15, "Qi":18, "Sx":21, "Sp":24,
"Oc":27, "No":30, "De":33, "Ud":36, "Dd":39, "Td":42
};
for (const s in suffixes) {
if (val.includes(s)) {
const num = parseFloat(val.replace(s, ""));
return num * Math.pow(10, suffixes[s]);
}
}
return parseFloat(val);
}
function updateCalc() {
const current = convertToNumber(document.getElementById("current").value);
const target = convertToNumber(document.getElementById("target").value);
const power = convertToNumber(document.getElementById("power").value);
const cps = parseFloat(document.getElementById("cps").value);
const needed = target - current;
const gainPerSec = power * cps;
const result = document.getElementById("result");
if (!isFinite(needed) || !isFinite(gainPerSec) || gainPerSec <= 0 || needed <= 0) {
result.innerText = "⚠️ Invalid or incomplete input!";
return;
}
let seconds = needed / gainPerSec;
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
const s = Math.floor(seconds % 60);
const hoursOnly = (seconds / 3600).toFixed(2);
result.innerText = `⏱️ Time Needed: ${h}h ${m}m ${s}s (≈ ${hoursOnly} hours)`;
}
// Auto update while typing
["current","target","power","cps"].forEach(id => {
document.getElementById(id).addEventListener("input", updateCalc);
});
updateCalc();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment