Skip to content

Commit

Permalink
Backport fixes to fundraiser thermometer (Bitcoin-ABC#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonbcox committed Jun 17, 2019
1 parent 96767f7 commit 77b27b6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions js/thermometer2.js
Expand Up @@ -16,21 +16,19 @@ function updateCard(data) {
$("#balance").html( balance.toFixed(2) + " BCH" );
$("#transactions").html( transactions );

var balance_percentage = ( balance / goal) * 100;
balance_percentage = ( balance / goal) * 100;
$("#goal-bar").css("width", balance_percentage + "%");
$(".goal-percentage").html(balance_percentage.toFixed() + "% of goal reached");
$(".goal-percentage").html(balance_percentage.toFixed(2) + "% of goal reached");
}

let goal = 800;
let balance = 0;
let transactions = 0;
let balance_percentage = 0;

let ABC_address = "bitcoincash:qp0kctzt552fhpypt7e6v5dtk3u4qjp3pst59ct28x";
let ABC_legacy = "19hYnDdS1hoMSxNbzLSWuso1jLSnntE3J7";

let BU_address = "bitcoincash:qpe28qt72runzsru4pp9cwmf7veppx9rpva4eqv9rf";
let BU_legacy = "1BT9uTHRJ1uxcoa9GEQctmagApwpAa1LXy";

let HD_address = "bitcoincash:qrr4f95f3n682ue6wxdn03ncptyjc53k7uyxwlt2tt";
let HD_legacy = "1KAxoTLSc8KYMucetJRBYWdK9n7yszMC3J";

Expand All @@ -43,7 +41,6 @@ let general_legacy = "12rVQxQ31ZtpRCRKM924W7fs35GBdQm65J";
let restCall = {
"addresses": [
ABC_address,
BU_address,
HD_address,
BC_address,
general_address
Expand Down Expand Up @@ -105,6 +102,9 @@ function onWatchedTx() {
if (amountGeneral !== 0) {
balance += amountGeneral/1e8;
transactions += 1;
balance_percentage = ( balance / goal) * 100;
$("#goal-bar").css("width", balance_percentage + "%");
$(".goal-percentage").html(balance_percentage.toFixed(2) + "% of goal reached");
$("#balance").html( balance.toFixed(2) + " BCH" );
$("#transactions").html( transactions );
$("#thank-you-card-general").fadeIn().html("<div class='inner-thank-you'><p>New Donation Received!</p><div>" + amountGeneral/1e8.toFixed(2) + " BCH was just donated from " + "<span>" + sendingAddr + "</span>" + " <br>Thank you!</div></div>").delay(5000).fadeOut();
Expand Down

0 comments on commit 77b27b6

Please sign in to comment.