Spaces:
Sleeping
Sleeping
Update templates/home.html
Browse files- templates/home.html +6 -7
templates/home.html
CHANGED
|
@@ -622,7 +622,7 @@
|
|
| 622 |
<input type="number" id="claim-astras" class="form-input" min="1" max="10000" placeholder="Enter number of astras" required oninput="validateClaimAstrasAmount(this)">
|
| 623 |
<div style="font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); margin-top: 0.5rem;">
|
| 624 |
You'll send: <span id="claim-send-amount">-</span> Astras (<span id="claim-fee-percent">1</span>%)<br>
|
| 625 |
-
Claimable: <span id="claim-claim-amount">-</span> Astras
|
| 626 |
Fee: <span id="claim-fee-amount">-</span> Astras
|
| 627 |
</div>
|
| 628 |
</div>
|
|
@@ -953,15 +953,14 @@
|
|
| 953 |
function validateClaimAstrasAmount(input) {
|
| 954 |
const value = parseInt(input.value);
|
| 955 |
if (!isNaN(value) && value > 0) {
|
| 956 |
-
const
|
| 957 |
-
const sendAmount =
|
| 958 |
-
const claimAmount =
|
| 959 |
-
const fee = Math.floor(value * feePercent);
|
| 960 |
|
| 961 |
document.getElementById('claim-send-amount').textContent = sendAmount;
|
| 962 |
document.getElementById('claim-claim-amount').textContent = claimAmount;
|
| 963 |
-
document.getElementById('claim-fee-percent').textContent =
|
| 964 |
-
document.getElementById('claim-fee-percent-negative').textContent = '-' +
|
| 965 |
document.getElementById('claim-fee-amount').textContent = fee;
|
| 966 |
} else {
|
| 967 |
document.getElementById('claim-send-amount').textContent = '-';
|
|
|
|
| 622 |
<input type="number" id="claim-astras" class="form-input" min="1" max="10000" placeholder="Enter number of astras" required oninput="validateClaimAstrasAmount(this)">
|
| 623 |
<div style="font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); margin-top: 0.5rem;">
|
| 624 |
You'll send: <span id="claim-send-amount">-</span> Astras (<span id="claim-fee-percent">1</span>%)<br>
|
| 625 |
+
Claimable: <span id="claim-claim-amount">-</span> Astras<br>
|
| 626 |
Fee: <span id="claim-fee-amount">-</span> Astras
|
| 627 |
</div>
|
| 628 |
</div>
|
|
|
|
| 953 |
function validateClaimAstrasAmount(input) {
|
| 954 |
const value = parseInt(input.value);
|
| 955 |
if (!isNaN(value) && value > 0) {
|
| 956 |
+
const fee = value > 100 ? 2 : 1;
|
| 957 |
+
const sendAmount = value + fee;
|
| 958 |
+
const claimAmount = value;
|
|
|
|
| 959 |
|
| 960 |
document.getElementById('claim-send-amount').textContent = sendAmount;
|
| 961 |
document.getElementById('claim-claim-amount').textContent = claimAmount;
|
| 962 |
+
document.getElementById('claim-fee-percent').textContent = fee;
|
| 963 |
+
document.getElementById('claim-fee-percent-negative').textContent = '-' + fee;
|
| 964 |
document.getElementById('claim-fee-amount').textContent = fee;
|
| 965 |
} else {
|
| 966 |
document.getElementById('claim-send-amount').textContent = '-';
|