From 30dec399322e73080ea37a37ac58e84beefa9011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 9 Oct 2019 09:27:21 +0200 Subject: [PATCH] switch from users counter to demands counter --- static/js/combo.public.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/static/js/combo.public.js b/static/js/combo.public.js index 564e735..1b2f59f 100644 --- a/static/js/combo.public.js +++ b/static/js/combo.public.js @@ -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); } });