'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
if ('touchAction' in document.body.style) {
document.body.style.touchAction = 'manipulation';
}
var $ = jQuery;
$(function () {
// notification
if ($('.js-notification').length) {
(function () {
var $el = $('.js-notification'),
$el_close = $('.js-notification--close', $el);
$el_close.on('click', function () {
$el.hide();
});
})();
};
// languages
if ($('.select_language').length) {
(function () {
var $el = $('.select_language'),
$el_opener = $('.select_language--opener', $el),
$el_list = $('.select_language--list', $el),
isOpened = false;
$el_opener.on('click', function () {
if (isOpened) {
close();
} else {
open();
}
});
$(window).on('click', function (e) {
if (!$el.is(e.target) && $el.has(e.target).length === 0) {
close();
}
});
var close = function close() {
$el.removeClass('-opened');
isOpened = false;
};
var open = function open() {
$el.addClass('-opened');
isOpened = true;
};
})();
};
// small slider
if ($('.js-small-slider').length) {
(function() {
$('.js-small-slider').slick({
dots: false,
infinite: true,
speed: 300,
slidesToShow: 2,
// speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 500,
// autoplay: $carousel.attr('data-autoplay') ? $carousel.attr('data-autoplay') : true,
// autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 6000,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
responsive: [{
breakpoint: 1200,
settings: {
slidesToShow: 1,
}
}]
});
})();
}
// promo_slider
if ($('.js-promo_slider').length) {
(function () {
var $carousel = $('.js-promo_slider'),
$nav = $('.js-promo_slider_nav');
$carousel.slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: true,
speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 500,
asNavFor: $nav.length ? '.js-promo_slider_nav' : false,
autoplay: $carousel.attr('data-autoplay') ? $carousel.attr('data-autoplay') : true,
autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 6000,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
responsive: [{
breakpoint: 1260,
settings: {
arrows: false
}
}]
});
if ($nav.length) {
$nav.slick({
slidesToShow: 4,
asNavFor: '.js-promo_slider',
infinite: false,
draggable: false,
focusOnSelect: true,
waitForAnimate: false,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
responsive: [{
breakpoint: 1260,
settings: {
slidesToShow: 4,
arrows: false
}
}, {
breakpoint: 1200,
settings: {
slidesToShow: 3,
arrows: true
}
}, {
breakpoint: 992,
settings: {
slidesToShow: 2
}
}, {
breakpoint: 600,
settings: {
slidesToShow: 1
}
}]
});
$carousel.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
if (nextSlide === 0 || nextSlide === slick.slideCount - 1) {
$nav.slick('slickGoTo', nextSlide, false);
}
});
}
})();
}
if ($('.promo_detailed--cta').length) {
(function () {
var promo_detailed = function promo_detailed() {
if ($(window).width() > 992) {
$('.promo_detailed--cta').height($('.abImage').outerHeight());
} else {
$('.promo_detailed--cta').css({
height: 'auto'
});
}
};
promo_detailed();
$(window).resize(function () {
promo_detailed();
});
})();
}
// partners
if ($('.js-partners').length) {
var $carousel = $('.js-partners');
$('.js-partners').slick({
slidesToShow: 6,
slidesToScroll: 6,
arrows: false,
dots: false,
speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 1500,
autoplay: $carousel.attr('data-autoplay') && $carousel.attr('data-autoplay') == 'true' ? true : false,
autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 3000,
// swipeToSlide: true,
responsive: [{
breakpoint: 1200,
settings: {
slidesToShow: 5
}
}, {
breakpoint: 1000,
settings: {
slidesToShow: 4
}
}, {
breakpoint: 700,
settings: {
slidesToShow: 3
}
}, {
breakpoint: 560,
settings: {
slidesToShow: 2
}
}, {
breakpoint: 460,
settings: {
slidesToShow: 1
}
}]
});
}
// tips
if ($('.js-tip').length) {
$('.js-tip').each(function (i, el) {
var $el = $(el);
new Tip($el);
});
};
// sticky header
if ($('.header_sticky').length && $(window).width() > 1000) {
(function () {
var headerSticky = function headerSticky() {
var showAt = void 0;
var $el = $('.header_sticky');
if ($('.promo_slider').length) {
showAt = $('.promo_slider').outerHeight(true) + $('.promo_slider').offset().top;
} else {
showAt = 600;
}
if ($(window).scrollTop() > showAt) {
$el.addClass('-stick');
} else {
$el.removeClass('-stick');
}
};
headerSticky();
$(window).on('scroll', function (e) {
headerSticky();
});
})();
}
// progressbar
if ($('.progressbar').length) {
$('.progressbar').each(function (index, el) {
var $el = $(el),
options = $el.data('options'),
value = $el.data('value'),
inViewport = false,
defaultOptions = {
strokeWidth: 4,
trailWidth: 4,
"text": {
"value": '0',
"className": "progressbar--label"
},
step: function step(state, bar) {
bar.setText((bar.value() * 100).toFixed(0));
}
};
options = $.extend(defaultOptions, options);
if (value.indexOf('%') !== -1) {
value = value.replace('%', '');
}
var progressbar = new ProgressBar.Circle(el, options);
var startAnimation = function startAnimation() {
inViewport = true;
progressbar.animate(value / 100);
};
// if ($('.js-progressbars').is(':in-viewport(-120)') && !inViewport) {
// startAnimation();
// console.log('NON SCROLL');
// }
if ($('.js-progressbars').is(':in-viewport') && !inViewport) {
startAnimation();
}
$(window).on('scroll', function () {
if ($('.js-progressbars').is(':in-viewport') && !inViewport) {
startAnimation();
}
});
});
};
// map
function initMap( $map ) {
var $container = $map,
container = $container[0],
mapOptions = {
center: { lat: parseFloat($map.attr('data-lat')), lng: parseFloat($map.attr('data-lng')) },
zoom: parseInt($map.attr('data-zoom')),
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false,
icon: $map.attr('data-marker')
},
map = null,
marker = null;
if ( map == null ) {
map = new google.maps.Map(container, mapOptions);
}
if ( marker == null ) {
marker = new google.maps.Marker({
position: mapOptions.center,
map: map,
icon: mapOptions.icon
});
}
}
// toogle google map
$('.js-map--opener').on('click', function () {
$(this).toggleClass('open');
$('.toggle-class').slideToggle('map-active');
});
// custom select
$('.select, .field').on('click', '.select2-selection', function(){
$(this).addClass('selected');
});
if ($('.js-select').length && $.fn.select2) {
$('.js-select').each(function (i, el) {
$(el).select2();
});
}
// reviews_carousel
if ($('.js-clients_reviews').length) {
var $carousel = $('.js-clients_reviews');
$('.js-clients_reviews').slick({
slidesToShow: 3,
// arrows: false,
arrows: true,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 1500,
autoplay: $carousel.attr('data-autoplay') && $carousel.attr('data-autoplay') == 'true' ? true : false,
autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 8000,
dots: true,
swipeToSlide: true,
responsive: [{
breakpoint: 1750,
settings: {
arrows: false
}
},{
breakpoint: 992,
settings: {
slidesToShow: 2,
arrows: false
}
}, {
breakpoint: 768,
settings: {
slidesToShow: 1,
arrows: false
}
}]
});
}
if ($('.js-clients_reviews_single').length) {
// added slider to single tweets (page2)
var $carousel = $('.js-clients_reviews_single');
$('.js-clients_reviews_single').slick({
slidesToShow: 1,
arrows: true,
dots: true,
swipeToSlide: true,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 1500,
autoplay: $carousel.attr('data-autoplay') && $carousel.attr('data-autoplay') == 'true' ? true : false,
autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 8000,
responsive: [{
breakpoint: 992,
settings: {
arrows: false
}
}]
});
}
if ($('.js-clients_reviews_small').length) {
var $carousel = $('.js-clients_reviews_small');
// added slider to single tweets (page2)
$('.js-clients_reviews_small').slick({
slidesToShow: 1,
arrows: false,
dots: true,
speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 1500,
autoplay: $carousel.attr('data-autoplay') && $carousel.attr('data-autoplay') == 'true' ? true : false,
autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 8000,
swipeToSlide: true
});
}
// clients carousel
// if ($('.js-clients').length) {
// var $carousel = $('.js-clients');
// $('.js-clients').slick({
// slidesToShow: 4,
// slidesToScroll: 4,
// dots: true,
// arrows: true,
// centerMode: false,
// speed: $carousel.attr('data-speed') ? $carousel.attr('data-speed') : 1500,
// autoplay: $carousel.attr('data-autoplay') && $carousel.attr('data-autoplay') == 'true' ? true : false,
// autoplaySpeed: $carousel.attr('data-autoplayspeed') ? $carousel.attr('data-autoplayspeed') : 8000,
// responsive: [{
// breakpoint: 992,
// settings: {
// slidesToShow: 2,
// slidesToScroll: 2
// }
// }, {
// breakpoint: 768,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1
// }
// }]
// });
// }
if ($('.js-clients').length) {
var $carousel = $('.js-clients');
$('.js-clients')
.on('init', function(){
$('.slick-center').addClass('centerSl');
$('.slick-center').prev().addClass('centerSl');
});
$('.js-clients').slick({
// slidesToShow: 4,
slidesToShow: 2,
slidesToScroll: 2,
dots: true,
// arrows: false,
arrows: true,
prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
nextArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
// prevArrow: '\n\t\t\t\t\t\n\t\t\t\t\t',
// nextArrow: '\n\t\t\t\t\t