Skip to content

Commit 1d7f509

Browse files
Add files via upload
1 parent dbf4ed7 commit 1d7f509

File tree

11 files changed

+512
-0
lines changed

11 files changed

+512
-0
lines changed

WuWa Pull Calculator/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# WuWa Pull Calculator
2+
3+
Simple calculator for Wuthering Waves pulls.
4+
5+
Site can be found [here](https://definetlynotai.github.io/Code_DUMP/WuWa%20Pull%20Calculator)
6+
7+
## Inputs
8+
- Astrites
9+
- Afterglow Coral (optional disable)
10+
- Radiant or Forging Tides
11+
12+
## Features
13+
- LocalStorage save/load
14+
- Coral toggle
15+
- UI styled close to [WuWaTracker](https://wuwatracker.com)
16+
- Info button linking to coral statistics source
17+
- Tooltip showing formula
18+
19+
## Formula
20+
pulls = floor(astrites / 160) + tides
21+
coral += coral + (pulls × multiplier)
22+
pulls += coral / 8 (if coral enabled)
23+
24+
Multiplier:
25+
- Radiant Tides: 1.2
26+
- Forging Tides: 0.75
27+
- Statistic Estimation from this [reddit post](https://www.reddit.com/r/WutheringWaves/comments/1j6a5i6/number_of_corals_per_pull_on_each_banner/)
28+
74.9 KB
Loading
63.3 KB
Loading
125 KB
Loading
83.5 KB
Loading

WuWa Pull Calculator/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html lang="en"><meta charset="UTF-8"><title>WuWa Pull Calculator</title><link rel="icon" href="icons/astrite.png"><link rel="stylesheet" href="style.css"><div class="container"><img class="hero-icon" src="icons/radiant.png"><h1>Pull Calculator</h1><div class="section"><div class="row"><img src="icons/astrite.png"> <input type="number" id="astrite" placeholder="Astrites"></div></div><div class="section"><div class="row"><img src="icons/coral.png"> <input type="number" id="coral" placeholder="Afterglow Coral"> <label class="checkbox"><input type="checkbox" id="disableCoral"> <span></span></label><div class="inline-label"><a href="https://www.reddit.com/r/WutheringWaves/comments/1j6a5i6/number_of_corals_per_pull_on_each_banner/" target="_blank"></a></div></div></div><div class="section"><div class="row"><img id="tideIcon" src="icons/radiant.png"> <select id="tideType"><option value="radiant">Radiant<option value="forging">Forging</select> <input type="number" id="tides" placeholder="Count"></div></div><button id="calc">Calculate</button><div class="result-box" id="resultSection" style="display:none;"><div class="info-line"><span>Result</span> <span class="info-btn" id="formulaBtn"></span></div><div class="result-row" id="pullResult"></div><div class="result-row" id="coralResult"></div></div><div id="formulaPopup" class="popup"><div class="popup-header"><span>Formula Used</span> <span id="closePopup" class="popup-close"></span></div><div class="popup-body" style="text-align: center;">(tides + astrites/160) +<br>(corals + 1.2(tides + astrites/160))/8</div></div></div><script src="script.js"></script>

WuWa Pull Calculator/script.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

WuWa Pull Calculator/style.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>WuWa Pull Calculator</title>
6+
<!-- favicon -->
7+
<link rel="icon" href="icons/astrite.png">
8+
<link rel="stylesheet" href="style.css">
9+
</head>
10+
<body>
11+
<div class="container">
12+
<!-- large header icon -->
13+
<img class="hero-icon" src="icons/radiant.png">
14+
<h1>Pull Calculator</h1>
15+
<!-- Astrites -->
16+
<div class="section">
17+
<div class="row">
18+
<img src="icons/astrite.png">
19+
<input type="number" id="astrite" placeholder="Astrites">
20+
</div>
21+
</div>
22+
<!-- Coral -->
23+
<div class="section">
24+
<div class="row">
25+
<img src="icons/coral.png">
26+
<input type="number" id="coral" placeholder="Afterglow Coral">
27+
<label class="checkbox">
28+
<input type="checkbox" id="disableCoral">
29+
<span></span>
30+
</label>
31+
<div class="inline-label">
32+
<a href="https://www.reddit.com/r/WutheringWaves/comments/1j6a5i6/number_of_corals_per_pull_on_each_banner/" target="_blank"></a>
33+
</div>
34+
</div>
35+
</div>
36+
<!-- Tides -->
37+
<div class="section">
38+
<div class="row">
39+
<img id="tideIcon" src="icons/radiant.png">
40+
<select id="tideType">
41+
<option value="radiant">Radiant</option>
42+
<option value="forging">Forging</option>
43+
</select>
44+
<input type="number" id="tides" placeholder="Count">
45+
</div>
46+
</div>
47+
<button id="calc">Calculate</button>
48+
<!-- Result box -->
49+
<div class="result-box" id="resultSection" style="display:none;">
50+
<div class="info-line">
51+
<span>Result</span>
52+
<span class="info-btn" id="formulaBtn"></span>
53+
</div>
54+
<div class="result-row" id="pullResult"></div>
55+
<div class="result-row" id="coralResult"></div>
56+
</div>
57+
<!-- popup -->
58+
<div id="formulaPopup" class="popup">
59+
<div class="popup-header">
60+
<span>Formula Used</span>
61+
<span id="closePopup" class="popup-close"></span>
62+
</div>
63+
<div class="popup-body" style="text-align: center;">
64+
(tides + astrites/160) +<br>
65+
(corals + 1.2(tides + astrites/160))/8
66+
</div>
67+
</div>
68+
</div>
69+
<script src="script.js"></script>
70+
</body>
71+
</html>
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
const astriteEl = document.getElementById("astrite");
2+
const coralEl = document.getElementById("coral");
3+
const tidesEl = document.getElementById("tides");
4+
const tideTypeEl = document.getElementById("tideType");
5+
const disableCoralEl = document.getElementById("disableCoral");
6+
7+
const tideIcon = document.getElementById("tideIcon");
8+
9+
const resultSection = document.getElementById("resultSection");
10+
const pullResult = document.getElementById("pullResult");
11+
const coralResult = document.getElementById("coralResult");
12+
13+
const formulaBtn = document.getElementById("formulaBtn");
14+
const formulaPopup = document.getElementById("formulaPopup");
15+
const closePopup = document.getElementById("closePopup");
16+
17+
let stored = {
18+
astrite: "",
19+
coral: "",
20+
radiant: "",
21+
forging: "",
22+
type: "radiant",
23+
disable: false
24+
};
25+
26+
function updateIcon() {
27+
tideIcon.src = tideTypeEl.value === "radiant" ?
28+
"icons/radiant.png" :
29+
"icons/forging.png";
30+
}
31+
32+
/* switch tides input depending on selected type */
33+
function syncTideInput() {
34+
const type = tideTypeEl.value;
35+
tidesEl.value = stored[type] || "";
36+
}
37+
38+
/* save current state */
39+
function save() {
40+
const type = tideTypeEl.value;
41+
42+
stored.astrite = astriteEl.value;
43+
stored.coral = coralEl.value;
44+
stored[type] = tidesEl.value; // store separately
45+
stored.type = type;
46+
stored.disable = disableCoralEl.checked;
47+
48+
localStorage.setItem("pullCalc", JSON.stringify(stored));
49+
}
50+
51+
/* load state */
52+
function load() {
53+
const data = JSON.parse(localStorage.getItem("pullCalc"));
54+
if (!data) return;
55+
56+
stored = data;
57+
58+
astriteEl.value = stored.astrite || "";
59+
coralEl.value = stored.coral || "";
60+
tideTypeEl.value = stored.type || "radiant";
61+
disableCoralEl.checked = stored.disable || false;
62+
63+
syncTideInput();
64+
updateIcon();
65+
}
66+
67+
/* handle switching tide types */
68+
tideTypeEl.addEventListener("change", () => {
69+
// save current input before switching
70+
stored[tideTypeEl.value === "radiant" ? "forging" :
71+
"radiant"] = tidesEl.value;
72+
73+
syncTideInput();
74+
updateIcon();
75+
save();
76+
});
77+
78+
document.getElementById("calc").onclick = () => {
79+
const astrite = Number(astriteEl.value);
80+
const coral = Number(coralEl.value);
81+
const tides = Number(tidesEl.value);
82+
const type = tideTypeEl.value;
83+
const disabled = disableCoralEl.checked;
84+
85+
if (!astrite && astrite !== 0) return;
86+
if (!tides && tides !== 0) return;
87+
if (!disabled && (!coral && coral !== 0)) return;
88+
89+
let base = (tides + (astrite / 160));
90+
let value = Math.floor(base);
91+
let rate = coral + (base * (type === "radiant" ? 1.2 : 0.75));
92+
93+
if (!disabled) value += rate / 8;
94+
95+
const finalPulls = Math.floor(value);
96+
97+
save();
98+
resultSection.style.display = "block";
99+
100+
pullResult.innerHTML = `
101+
<img src="icons/${type}.png">
102+
${disabled ? finalPulls : `~${finalPulls}`} pulls
103+
`;
104+
105+
if (disabled) {
106+
coralResult.innerHTML = `
107+
<img src="icons/coral.png">
108+
~${rate.toFixed(1)} coral
109+
`;
110+
} else {
111+
coralResult.innerHTML = "";
112+
}
113+
};
114+
115+
formulaBtn.addEventListener("click", () => {
116+
formulaPopup.style.display = "flex";
117+
});
118+
119+
closePopup.addEventListener("click", () => {
120+
formulaPopup.style.display = "none";
121+
});
122+
123+
// optional: click outside to close
124+
window.addEventListener("click", (e) => {
125+
if (e.target === formulaPopup) {
126+
formulaPopup.style.display = "none";
127+
}
128+
});
129+
130+
load();

0 commit comments

Comments
 (0)