summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-10-09 07:27:21 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-10-09 07:27:21 (GMT)
commit30dec399322e73080ea37a37ac58e84beefa9011 (patch)
tree4020c13045dc3aaedd07eec28bd2e95b51d854e0
parent87b5041966b7358f1c40be948cc3a28b223be664 (diff)
downloadpublik-website-30dec399322e73080ea37a37ac58e84beefa9011.zip
publik-website-30dec399322e73080ea37a37ac58e84beefa9011.tar.gz
publik-website-30dec399322e73080ea37a37ac58e84beefa9011.tar.bz2
switch from users counter to demands counter
-rw-r--r--static/js/combo.public.js19
1 files 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);
}
});