switch from users counter to demands counter

This commit is contained in:
Frédéric Péters 2019-10-09 09:27:21 +02:00
parent 87b5041966
commit 30dec39932
1 changed files with 16 additions and 3 deletions

View File

@ -46,9 +46,22 @@ $(function() {
useGrouping : true,
separator : '',
prefix : '',
suffix : ' usagers'
suffix : ' demandes'
};
var count = new CountUp("counter", 1234, parseInt(total), 0, 4.5, options);
$chiffres_section.on('inview', function() { count.start(); });
function get_current_count() { // (saas only)
var base_number = 1000000;
var base_date = new Date("2019-08-30T00:00:00");
var diff = (Date.now() - base_date.getTime()) / 1000;
/* rate on base date: 1 request every 50 seconds */
return base_number + (diff / 50);
}
//var count = new CountUp("counter", 1234, parseInt(total), 0, 4.5, options);
var count = new CountUp("counter", 1, parseInt(get_current_count()), 0, 4.5, options);
$chiffres_section.on('inview', function() {
count.start();
});
setInterval(function() {
count.update(get_current_count());
}, 2000);
}
});