Changeset - 76f5e1b7ea98
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 6 years ago 2015-03-12 01:38:38
bkuhn@ebb.org
Increase donation count by 1% each time.

Increasing by one makes it last too long. Doing 1% will make it go just
as fast as the fundraiser.
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/supporter-page.js
Show inline comments
...
 
@@ -14,7 +14,8 @@ $(document).ready(function() {
 
    var percentage = (parseFloat(noCommaSoFar) / parseFloat(noCommaGoal)) * 100;
 
    var curValue = 0.00;
 
    var incrementSoFar = 0.00;
 
    var incrementDonationCount = 0;
 
    var curDonationCount = 0;
 
    var incrementDonationCount = Math.round( 0.01 * donationCount );
 

	
 
    $('span#fundraiser-percentage').css({ 'color'        : 'green',
 
                                          'font-weight'  : 'bold',
...
 
@@ -36,11 +37,11 @@ $(document).ready(function() {
 
        }
 
    }
 
    function riseDonationCount() {
 
        if (incrementDonationCount >= noCommaDonationCount) {
 
        if (curDonationCount >= noCommaDonationCount) {
 
            $('span#fundraiser-donation-count').text(donationCount);
 
        } else {
 
            $('span#fundraiser-donation-count').text(incrementDonationCount.toLocaleString());
 
            incrementDonationCount++;
 
            $('span#fundraiser-donation-count').text(curDonationCount.toLocaleString());
 
            incrementDonationCount += incrementDonationCount;
 
            setTimeout(riseDonationCount, 50);
 
        }
 
    }
0 comments (0 inline, 0 general)