2015-03-18 14:53:46 +01:00
|
|
|
|
$(function() {
|
|
|
|
|
$('.bistro').parallax("0%", 0.2);
|
|
|
|
|
$('.bistro > div').parallax("2%", 1.2);
|
|
|
|
|
$('a[href^="#"]').on('click',
|
|
|
|
|
function() { $.scrollTo($(this).attr('href'), 1000); }
|
|
|
|
|
);
|
2019-01-19 15:33:12 +01:00
|
|
|
|
|
2019-01-19 15:34:53 +01:00
|
|
|
|
if ($('.textcell.tablette').length) {
|
2019-01-19 15:33:12 +01:00
|
|
|
|
setInterval(function() {
|
|
|
|
|
var $clock = $('.mobile-case .clock');
|
|
|
|
|
var date = new Date();
|
|
|
|
|
$clock.text(('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2));
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$('.textcell.tablette img').each(function(idx, elem) {
|
|
|
|
|
var $cell = $(elem).parents('div.textcell');
|
|
|
|
|
var $mobile_case = $('<div class="mobile-case">' +
|
|
|
|
|
'<div class="screen">' +
|
|
|
|
|
'<div class="mobile-top-bar"><span class="clock">--:--</span></div>' +
|
|
|
|
|
'<div class="mobile-app-content">' +
|
|
|
|
|
'</div>' +
|
|
|
|
|
'</div>' +
|
|
|
|
|
'</div>');
|
|
|
|
|
$mobile_case.find('.mobile-app-content').append($(elem).detach());
|
|
|
|
|
$cell.append($mobile_case);
|
|
|
|
|
});
|
|
|
|
|
|
2015-03-18 14:53:46 +01:00
|
|
|
|
if ($('.ecrans').length > 0) {
|
|
|
|
|
var $window = $(window);
|
|
|
|
|
var offset = parseInt(Math.random()*2000);
|
|
|
|
|
var $ecrans = $('.ecrans');
|
|
|
|
|
$window.bind('scroll', function() {
|
2018-01-09 12:00:58 +01:00
|
|
|
|
var pos = Math.pow($window.scrollTop(), 1.1);
|
|
|
|
|
$ecrans.css('background-position', (offset + pos) + 'px 0px');
|
2015-03-18 14:53:46 +01:00
|
|
|
|
});
|
2018-01-09 11:58:11 +01:00
|
|
|
|
$window.trigger('scroll');
|
2015-03-18 14:53:46 +01:00
|
|
|
|
}
|
2015-10-28 10:04:49 +01:00
|
|
|
|
if ($('div[id|=chiffres]').length) {
|
|
|
|
|
var $chiffres_section = $('div[id|=chiffres]');
|
|
|
|
|
$chiffres_section.css('position', 'relative');
|
|
|
|
|
var total = $chiffres_section.attr('id').split('-')[1];
|
2016-11-21 15:44:52 +01:00
|
|
|
|
var $counter = $('<span id="counter"></span>').appendTo($chiffres_section.find('> div'));
|
2015-10-28 10:04:49 +01:00
|
|
|
|
var options = {
|
|
|
|
|
useEasing : true,
|
|
|
|
|
useGrouping : true,
|
|
|
|
|
separator : ' ',
|
|
|
|
|
prefix : '',
|
2019-10-09 09:27:21 +02:00
|
|
|
|
suffix : ' demandes'
|
2015-10-28 10:04:49 +01:00
|
|
|
|
};
|
2019-10-09 09:27:21 +02:00
|
|
|
|
function get_current_count() { // (saas only)
|
2020-12-31 14:22:16 +01:00
|
|
|
|
var base_number = 2370000;
|
|
|
|
|
var base_date = new Date("2020-12-31T00:00:00");
|
2019-10-09 09:27:21 +02:00
|
|
|
|
var diff = (Date.now() - base_date.getTime()) / 1000;
|
2020-12-31 14:22:16 +01:00
|
|
|
|
/* approx rate on base date: 1 request every 26 seconds
|
|
|
|
|
* December 1st: 2250000, December 31st: 2380000
|
|
|
|
|
* 1 / ((2380000 - 2250000) / (86400seconds * 31days)) -> 20
|
|
|
|
|
*/
|
|
|
|
|
return base_number + (diff / 20);
|
2019-10-09 09:27:21 +02:00
|
|
|
|
}
|
|
|
|
|
//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);
|
2015-10-28 10:04:49 +01:00
|
|
|
|
}
|
2015-03-18 14:53:46 +01:00
|
|
|
|
});
|