// ACTIVITY INDICATOR
var imageLightBoxItems = {
count: 0,
byIndex: {},
byHref: {},
};
var activityIndicatorOn = function () {
$('
').appendTo('body');
},
activityIndicatorOff = function () {
$('#imagelightbox-loading').remove();
},
// OVERLAY
overlayOn = function () {
$('').appendTo('body');
},
overlayOff = function () {
$('#imagelightbox-overlay').remove();
},
// CLOSE BUTTON
closeButtonOn = function (instance) {
$('').appendTo('body').on('click touchend', function () {
$(this).remove();
instance.quitImageLightbox();
return false;
});
},
closeButtonOff = function () {
$('#imagelightbox-close').remove();
},
// CAPTION
captionOn = function () {
var description = $('a[href="' + $('#imagelightbox').attr('src') + '"] img').attr('alt');
if (description != '' && description != undefined)
$('' + description + '
').appendTo('body');
},
captionOff = function () {
$('#imagelightbox-caption').remove();
},
// NAVIGATION
navigationOn = function (instance, selector) {
var images = $(selector);
if (images.length) {
var nav = $('');
for (var i = 0; i < images.length; i++)
nav.append('');
nav.appendTo('body');
nav.on('click touchend', function () {
return false;
});
var navItems = nav.find('button');
navItems.on('click touchend', function () {
var $this = $(this);
if (images.eq($this.index()).attr('href') != $('#imagelightbox').attr('src'))
instance.switchImageLightbox($this.index());
navItems.removeClass('active');
navItems.eq($this.index()).addClass('active');
return false;
}).on('touchend', function () {
return false;
});
}
},
navigationUpdate = function (selector) {
var items = $('#imagelightbox-nav button');
items.removeClass('active');
items.eq($(selector).filter('[href="' + $('#imagelightbox').attr('src') + '"]').index(selector)).addClass('active');
},
navigationOff = function () {
$('#imagelightbox-nav').remove();
},
// ARROWS
arrowsOn = function (instance, selector) {
var $arrows = $('');
$arrows.appendTo('body');
$arrows.on('click touchend', function (e) {
var $this = $(this);
var index = imageLightBoxItems.byHref[$('#imagelightbox').attr('src')];
e.preventDefault();
if (typeof index === 'undefined') {
return false;
}
if ($this.hasClass('imagelightbox-arrow-left')) {
index = index - 1;
if (typeof imageLightBoxItems.byIndex[index] === 'undefined') {
index = imageLightBoxItems.count - 1;
}
} else {
index = index + 1;
if (typeof imageLightBoxItems.byIndex[index] === 'undefined') {
index = 0;
}
}
instance.switchImageLightbox(index);
return false;
});
},
arrowsOff = function () {
$('.imagelightbox-arrow').remove();
};
var imageLighBoxSelector = 'a.fancybox',
imageLightboxInstance = $(imageLighBoxSelector).imageLightbox({
onStart: function () {
overlayOn();
closeButtonOn(imageLightboxInstance);
arrowsOn(imageLightboxInstance, imageLighBoxSelector);
},
onEnd: function () {
overlayOff();
captionOff();
closeButtonOff();
arrowsOff();
activityIndicatorOff();
},
onLoadStart: function () {
captionOff();
activityIndicatorOn();
},
onLoadEnd: function () {
captionOn();
activityIndicatorOff();
$('.imagelightbox-arrow').css('display', 'block');
}
});
$(imageLighBoxSelector).each(function (index) {
imageLightBoxItems.byHref[$(this).attr('href')] = index;
imageLightBoxItems.byIndex[index] = $(this).attr('href');
imageLightBoxItems.count += 1;
});
var startPage = $('.page-start');
$(document).ready(function () {
$('.tog-more').click(function(e){
e.preventDefault();
$(this).parent().find(".im-more").toggle();
if($(this).html() == 'więcej') {
$(this).html("mniej");
} else {
$(this).html("więcej");
}
});
$('.home-movie').addClass('is_active');
$('#contactFormSend').on('submit', function (evt) {
evt.preventDefault();
var k = ['name', 'question'],
good = true;
$(this).find('[name]').removeClass('error');
$(this).find('p.ajaxInfo').hide();
if (/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).find('[name="mail"]').val()) == false) {
$(this).find('[name="mail"]').addClass('error');
good = false;
}
if ($(this).find('[name="phone"]').val().replace(/[^\d]/, '').length < 9) {
$(this).find('[name="phone"]').addClass('error');
good = false;
}
for (var i = 0; i < k.length; i++) {
var obj = $(this).find('[name="' + k[i] + '"]');
if (obj.val().length <= 1) {
good = false;
obj.addClass('error');
}
}
if (good) {
$.post($(this).attr('action'), $(this).serialize(), (function (response) {
if (response.indexOf('false') === -1) {
$(this).find('input, textarea').val('');
$(this).find('p.ajaxInfo.ok').show();
} else {
$(this).find('p.ajaxInfo.error_send').show();
}
}).bind(this));
} else {
$(this).find('p.ajaxInfo.error').show();
}
});
$('#movieFormSend').on('submit', function (evt) {
evt.preventDefault();
var k = ['name', 'question', 'company'],
good = true;
$(this).find('[name]').removeClass('error');
$(this).find('p.ajaxInfo').hide();
if (/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).find('[name="mail"]').val()) == false) {
$(this).find('[name="mail"]').addClass('error');
good = false;
}
if ($(this).find('[name="phone"]').val().replace(/[^\d]/, '').length < 9) {
$(this).find('[name="phone"]').addClass('error');
good = false;
}
for (var i = 0; i < k.length; i++) {
var obj = $(this).find('[name="' + k[i] + '"]');
if (obj.val().length <= 1) {
good = false;
obj.addClass('error');
}
}
if (good) {
$.post($(this).attr('action'), $(this).serialize(), (function (response) {
if (response.indexOf('false') === -1) {
$(this).find('input, textarea').val('');
$(this).find('p.ajaxInfo.ok').show();
} else {
$(this).find('p.ajaxInfo.error_send').show();
}
}).bind(this));
} else {
$(this).find('p.ajaxInfo.error').show();
}
});
// Zabiegaj linkom #
$('a[href=#]').click(function (e) {
e.preventDefault();
});
});
$(window).load(function () {
var mainSlider = $('#main-slider');
function initializedSlider(e) {
$('.main-slider-content').addClass('active');
mainSlider.addClass('growIn animated go slowest');
$('#main-slider .slider-title').addClass('fadeInDown animated slowest delay-1000');
$('#main-slider .slider-text').addClass('fadeInLeft animated slowest delay-2000');
$('#main-slider .slider-second').addClass('fadeInRight animated slowest delay-3000');
$('#main-slider .slider-button').addClass('fadeInUp animated slowest delay-3500');
setTimeout(function () {
$('#main-slider .slider-title, #main-slider .slider-text, #main-slider .slider-second, #main-slider .slider-button').addClass('go');
$('#main-slider .owl-controls').show('slow');
setTimeout(function () {
mainSlider.trigger('play.owl.autoplay', [5000]);
}, 6100);
}, 1700);
}
if (mainSlider.length > 0) {
var items = mainSlider.find('.owl-item');
var loop = true;
/*if (items.length > 0) {
loop = true;
}*/
mainSlider.owlCarousel({
items: 1,
nav: false,
dots: true,
loop: loop,
autoplay: true,
autoplaySpeed: 5000,
lazyLoad: true,
animateOut: 'fadeOut',
touchDrag: false,
mouseDrag: false,
onInitialized: initializedSlider
});
mainSlider.trigger('stop.owl.autoplay');
mainSlider.on('changed.owl.carousel', function (event) {
$('#main-slider .slider-title, #main-slider .slider-text, #main-slider .slider-second, #main-slider .slider-button').removeClass('go');
setTimeout(function () {
$('#main-slider .slider-title, #main-slider .slider-text, #main-slider .slider-second, #main-slider .slider-button').addClass('go');
}, 100);
});
}
var referenceSlider = $('#reference-slider');
if (referenceSlider.length > 0) {
referenceSlider.owlCarousel({
items: 1,
nav: true,
dots: false,
autoplay: true,
autoplaySpeed: 3000,
navText: ["‹", "›"]
});
referenceSlider.trigger('stop.owl.autoplay');
}
var referenceSlider = $('#reference-slider-done-app');
if (referenceSlider.length > 0) {
referenceSlider.owlCarousel({
items: 1,
nav: true,
dots: false,
autoplay: true,
autoplaySpeed: 3000,
navText: ["‹", "›"]
});
referenceSlider.trigger('stop.owl.autoplay');
}
var referenceSlider2 = $('#reference-slider-2');
if (referenceSlider2.length > 0) {
referenceSlider2.owlCarousel({
items: 4,
nav: true,
dots: false,
autoplay: false,
autoplaySpeed: 3000,
navText: ["‹", "›"]
});
}
var partnersSlider = $('#partners');
if (partnersSlider.length > 0) {
partnersSlider.owlCarousel({
items: 6,
nav: true,
dots: false,
autoplay: true,
loop: true,
autoplayTimeout: 60,
navText: ["‹", "›"],
autoplaySpeed: 2000,
responsive: {
0: {
items: 1
},
390: {
items: 2
},
570: {
items: 3
},
1021: {
items: 5
},
1200: {
items: 6
}
}
});
partnersSlider.trigger('stop.owl.autoplay');
}
var certificateSlider = $('#certificate');
if (certificateSlider.length > 0) {
certificateSlider.owlCarousel({
items: 1,
nav: true,
dots: false,
autoplay: false,
loop: true,
autoplaySpeed: 3000,
navText: ["‹", "›"],
responsive: {
0: {
items: 1
},
570: {
items: 1,
autoWidth: false,
},
700: {
autoWidth: true,
}
}
});
certificateSlider.trigger('stop.owl.autoplay');
}
var changeLanguageBtn = $('.language .btn-bottom');
var languagesList = $('.languages');
changeLanguageBtn.on('click tap', function () {
$(this).parent().parent().toggleClass('active');
languagesList.slideToggle();
});
var referenceList = $('#reference-list-slider .slider-content');
if (referenceList.length > 0) {
var referenceListItem = $('.section-references .item');
var tileList = $('.reference-list');
var listContainer = $('#reference-list-slider');
referenceList.owlCarousel({
items: 1,
nav: true,
dots: false,
autoplay: false,
loop: false,
navText: ["poprzednia", "następna"],
autoplaySpeed: 3000
});
listContainer.hide();
referenceList.find('.owl-nav').prepend('powrót
');
referenceListItem.click(function () {
var _index = $(this).index();
referenceList.trigger('to.owl.carousel', [_index, 300, true]);
listContainer.show();
tileList.hide();
$('html,body').stop().animate({
scrollTop: ($('#reference-list-slider').offset().top - 81)
}, 600);
});
$('#reference-list-slider .return').click(function () {
listContainer.hide();
tileList.show();
});
$('#reference-list-slider .slider-content .owl-prev, #reference-list-slider .slider-content .owl-next').click(function () {
$('html,body').stop().animate({
scrollTop: ($('#reference-list-slider').offset().top - 81)
}, 600);
return false;
});
}
/* features */
if ($('.section-homeFeatures').length > 0) {
var featuresDelay = ['delay-250', 'delay-500', 'delay-750', 'delay-1000', 'delay-1250', 'delay-1500'];
var features = $('.section-features');
var featuresItems = $('.section-features .item');
var options = {
useEasing: false,
useGrouping: true,
separator: '',
decimal: ',',
prefix: '',
suffix: ''
};
var effectiveness = new CountUp("featuredEffectiveness", 0, 99.7, 2, 2.25, options);
var minutes = new CountUp("featuredMinutes", 0, 4, 0, 0.1, options);
var hours = new CountUp("featuredHours", 0, 24, 0, 1, options);
var days = new CountUp("featuredDays", 0, 7, 0, 1, options);
var hours2 = new CountUp("featuredHours2", 0, 7, 0, 1, options);
var years = new CountUp("featuredYears", 0, 2, 0, 1, options);
var featuresOffset = 'bottom-in-view';
var width = $(window).width();
if (width < 600) {
featuresOffset = '90%';
}
// Dodanie animacji tylko do strony głowej/ css do animacji custom.css
var pageStartFeaturesItems = $('.page-start .section-features .item');
pageStartFeaturesItems.addClass('fadeInUpPageStart animatedPageStart');
pageStartFeaturesItems.each(function (index) {
$(this).addClass(featuresDelay[index]);
});
//END Dodanie animacji
//console.log(featuresOffset);
featuresItems.addClass('fadeInUp animated');
featuresItems.each(function (index) {
$(this).addClass(featuresDelay[index]);
});
features.waypoint(function () {
featuresItems.addClass('go');
setTimeout(function () {
effectiveness.start();
}, 1100);
setTimeout(function () {
minutes.start();
hours.start();
days.start();
hours2.start();
years.start();
}, 2000);
}, {offset: featuresOffset}
);
}
if (startPage.length > 0) {
/* about */
var aboutDelay = ['delay-1750', 'delay-2000', 'delay-2250'];
var about = $('.section-about');
var aboutHeader = about.find('.section-header');
var aboutNote = about.find('.note');
var aboutPartnersH4 = about.find('.partners-text h4');
var aboutPartnersLi = about.find('.partners-text li');
var aboutPartnersDiv = about.find('.partners-text div');
aboutHeader.addClass('fadeInLeft animated fast');
aboutNote.addClass('fadeInRight animated fast delay-500');
aboutPartnersH4.addClass('fadeInUp animated fast delay-750');
aboutPartnersLi.addClass('slideInUp animated');
aboutPartnersDiv.addClass('fadeInUp animated fast delay-3500');
aboutPartnersLi.each(function (index) {
//console.log(aboutDelay[index]);
$(this).addClass(aboutDelay[index]);
});
about.waypoint(function () {
aboutHeader.addClass('go');
}, {offset: '60%'}
);
about.waypoint(function () {
aboutNote.addClass('go');
}, {offset: '50%'}
);
about.waypoint(function () {
aboutPartnersH4.addClass('go');
}, {offset: '45%'}
);
about.waypoint(function () {
aboutPartnersLi.addClass('go');
aboutPartnersDiv.addClass('go');
}, {offset: '30%'}
);
/* references */
var references = $('#reference-slider-content');
var referencesHeader = references.find('.section-header');
var referencesImg = references.find('.ref-img');
var referencesText = references.find('.ref-text');
referencesHeader.addClass('rotateInDownRight animated fast');
referencesImg.addClass('fadeInUp animated fast delay-500');
referencesText.addClass('fadeInUp animated fast delay-750');
references.waypoint(function () {
referencesHeader.addClass('go');
referencesImg.addClass('go');
referencesText.addClass('go');
setTimeout(function () {
referenceSlider.trigger('play.owl.autoplay', [3000]);
}, 3100);
}, {offset: '60%'}
);
/* reference 2 */
var baseDelay = 250;
var i = 0;
var references2 = $('#reference-slider-content-2');
var referencesHeader2 = references2.find('.section-header');
var partnersItem2 = references2.find('.inner');
referencesHeader2.addClass('rotateInDownRight animated fast');
partnersItem2.addClass('flipInY animated');
partnersItem2.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
references2.waypoint(function () {
referencesHeader2.addClass('go');
partnersItem2.addClass('go');
setTimeout(function () {
referenceSlider2.trigger('play.owl.autoplay', [3000]);
}, 3100);
}, {offset: '60%'}
);
/* clietns */
var clients = $('.section-clients');
var clientsHeader = clients.find('.section-header');
var clientsTe1 = clients.find('.te-1');
var clientsTe2 = clients.find('.te-2');
var clientsTe3 = clients.find('.te-3');
var clientsTe4 = clients.find('.te-4');
var clientsRight = clients.find('.cover-img');
clientsHeader.addClass('fadeInUp animated fast');
clientsTe1.addClass('fadeInUp animated fast delay-250');
clientsTe2.addClass('fadeInUp animated fast delay-750');
clientsTe3.addClass('fadeInUp animated fast delay-1500');
clientsTe4.addClass('fadeInUp animated fast delay-1500');
clientsRight.addClass('fadeInRight animated delay-2000');
clients.waypoint(function () {
clientsHeader.addClass('go');
}, {offset: '60%'}
);
clients.waypoint(function () {
clientsTe1.addClass('go');
clientsTe2.addClass('go');
clientsTe3.addClass('go');
clientsTe4.addClass('go');
clientsRight.addClass('go');
}, {offset: '45%'}
);
/* haluer */
var hauler = $('.section-hauler');
var haulersHeader = hauler.find('.section-header');
var haulerLeft = hauler.find('.cover-img');
var haulerH4 = hauler.find('.desc h4');
var haulerLi = hauler.find('.desc li');
var haulerDiv = hauler.find('.desc2');
haulersHeader.addClass('fadeInUp animated fast');
haulerLeft.addClass('fadeInLeft animated fast delay-2000');
haulerH4.addClass('fadeInUp animated fast delay-750');
haulerLi.addClass('slideInUp animated fast');
haulerDiv.addClass('fadeInUp animated fast delay-2000');
haulerLi.each(function (index) {
$(this).addClass(aboutDelay[index]);
});
hauler.waypoint(function () {
haulersHeader.addClass('go');
}, {offset: '60%'}
);
hauler.waypoint(function () {
haulerLeft.addClass('go');
haulerH4.addClass('go');
haulerLi.addClass('go');
haulerDiv.addClass('go');
}, {offset: '45%'}
);
/* career */
var career = $('.section-career');
var careerHeader = career.find('.section-header');
var careerLi = career.find('li');
careerHeader.addClass('fadeInDown animated fast');
careerLi.addClass('fadeInUp animated fast');
career.waypoint(function () {
careerHeader.addClass('go');
}, {offset: '60%'}
);
var base = 250;
var i = 1;
careerLi.each(function (idx) {
var item = career.find('li').eq(idx);
$(this).addClass('delay-' + base * i);
career.waypoint(function () {
item.addClass('go');
}, {offset: '50%'}
);
i++;
});
/* business */
var businessDelay = ['delay-500', 'delay-1000', 'delay-1500'];
var business = $('.section-business');
var businessHeader = business.find('.section-header');
var businessTe1 = business.find('.te1');
var businessTe2 = business.find('.te2');
var businessDesc2 = business.find('.desc2');
var businessLi = business.find('li');
businessHeader.addClass('fadeInLeft animated fast');
businessTe1.addClass('fadeInRight animated fast delay-250');
businessLi.addClass('growIn animated fast');
businessLi.each(function (index) {
$(this).addClass(businessDelay[index]);
});
businessTe2.addClass('fadeInRight animated fast delay-2000');
businessDesc2.addClass('fadeInUp animated fast delay-2000');
business.waypoint(function () {
businessHeader.addClass('go');
}, {offset: '60%'}
);
business.waypoint(function () {
businessTe1.addClass('go');
businessLi.addClass('go');
businessTe2.addClass('go');
businessDesc2.addClass('go');
}, {offset: '50%'}
);
/* certificate */
var baseDelay = 250;
var i = 0;
var certificate = $('.section-certificate');
var certificateHeaders = certificate.find('.section-header');
var certificateItem = certificate.find('.item');
certificateHeaders.addClass('fadeInUp animated');
certificateItem.addClass('flipInX animated fast');
certificateItem.each(function () {
$(this).addClass('delay-' + (base * i));
i++;
});
certificate.waypoint(function () {
certificateHeaders.addClass('go');
certificateItem.addClass('go');
setTimeout(function () {
certificateSlider.trigger('play.owl.autoplay', [3000]);
}, 3100);
}, {offset: '60%'}
);
/* news */
var news = $('.section-news');
var newsLeft = news.find('.news-column');
var newsRight = news.find('.blog-column');
newsLeft.addClass('flipInX animated slow');
newsRight.addClass('flipInX animated slow delay-750');
news.waypoint(function () {
newsLeft.addClass('go');
}, {offset: '45%'}
);
news.waypoint(function () {
newsRight.addClass('go');
}, {offset: '45%'}
);
/* maps */
var map = $('.section-map');
var mapContent = map.find('.map-content');
mapContent.addClass('growIn animated');
mapContent.waypoint(function () {
mapContent.addClass('go');
}, {offset: '60%'}
);
/* contact */
var contact = $('.section-contact');
var contactHeader = contact.find('.section-header');
var contactRight = contact.find('.form');
contactHeader.addClass('fadeInUp animated');
contactRight.addClass('fadeInRight animated delay-750');
contact.waypoint(function () {
contactHeader.addClass('go');
}, {offset: '60%'}
);
contact.waypoint(function () {
contactRight.addClass('go');
}, {offset: '45%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
}
var pageAbout = $('#page-about');
if (pageAbout.length > 0) {
var featuresItems = $('.section-features .item');
var options = {
useEasing: false,
useGrouping: true,
separator: '',
decimal: ',',
prefix: '',
suffix: ''
};
var aboutDelay = ['delay-1750', 'delay-2000', 'delay-2250'];
var about = $('.section-about');
var aboutHeader = about.find('.section-header');
var aboutNote = about.find('.note');
var aboutPartnersH4 = about.find('.partners-text h4');
var aboutPartnersLi = about.find('.partners-text li');
var aboutPartnersDiv = about.find('.partners-text div');
aboutHeader.addClass('fadeInLeft animated fast');
aboutNote.addClass('fadeInRight animated fast delay-500');
aboutPartnersH4.addClass('fadeInUp animated fast delay-750');
aboutPartnersLi.addClass('slideInUp animated');
aboutPartnersDiv.addClass('fadeInUp animated fast delay-3500');
aboutPartnersLi.each(function (index) {
//console.log(aboutDelay[index]);
$(this).addClass(aboutDelay[index]);
});
about.waypoint(function () {
aboutHeader.addClass('go');
}, {offset: '60%'}
);
about.waypoint(function () {
aboutNote.addClass('go');
}, {offset: '50%'}
);
about.waypoint(function () {
aboutPartnersH4.addClass('go');
}, {offset: '45%'}
);
about.waypoint(function () {
aboutPartnersLi.addClass('go');
aboutPartnersDiv.addClass('go');
}, {offset: '30%'}
);
/* attributes */
var attributes = $('.about-attributes');
var baseDelay = 250;
var i = 0;
var attributesItem = attributes.find('.row');
attributesItem.addClass('animated slow');
attributesItem.each(function () {
var _class = 'fadeInRight';
if (i % 2 === 1) {
_class = 'fadeInLeft';
}
$(this).addClass(_class + ' delay-' + (baseDelay * i * 2));
i++;
});
attributes.waypoint(function () {
attributesItem.addClass('go');
}, {offset: '60%'}
);
/* team */
var team = $('.about-team');
var teamHeader = team.find('header');
var teamLi = team.find('.content-1 li');
var teamContent2 = team.find('.content-2');
i = 1;
teamHeader.addClass('fadeInUp animated fast');
teamLi.addClass('slideInUp animated');
teamContent2.addClass('flipInX animated slow delay-2500');
teamLi.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
team.waypoint(function () {
teamHeader.addClass('go');
}, {offset: '60%'}
);
team.waypoint(function () {
teamLi.addClass('go');
}, {offset: '45%'}
);
team.waypoint(function () {
teamContent2.addClass('go');
}, {offset: '30%'}
);
/* success */
var success = $('.about-success');
var successHeader = success.find('header');
var successLi = success.find('.elements li');
i = 1;
successHeader.addClass('fadeInUp animated fast');
successLi.addClass('animated');
// successLi.each(function(){
// var _class = 'fadeInRight';
// if (i % 2 === 1) { _class = 'fadeInLeft'; }
// $(this).addClass(_class + ' delay-' + (baseDelay*i*2));
// i++;
// });
//
success.waypoint(function () {
successHeader.addClass('go');
}, {offset: '60%'}
);
success.waypoint(function () {
successLi.addClass('go');
}, {offset: '45%'}
);
/* numbers */
var numbersElement = $('.about-numbers .item');
var numbersAray = [];
numbersElement.each(function (index) {
var strong = $(this).find('strong');
var i = index + 1;
var name = 'number-' + i;
strong.attr('id', name);
var text = strong.html();
text = text.split(' ').join('').replace(/ /gi, '');
text = parseInt(text);
numbersAray.push(new CountUp(name, 0, text, 0, 2.5, options));
});
var numbersSection = $('.about-numbers');
var numbersSectionItem = numbersSection.find('.item');
i = 1;
numbersSectionItem.addClass('animated fadeInUp');
numbersSectionItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
numbersSection.waypoint(function () {
numbersSectionItem.addClass('go');
setTimeout(function () {
for (i = 0; i < numbersAray.length; i++) {
//console.log(i);
numbersAray[i].start();
}
}, 500);
}, {offset: '60%'}
);
/* about us details */
var moreDetails = $('.about-more-details');
var moreDetailsItem = moreDetails.find('.item');
i = 1;
moreDetailsItem.addClass('flipInX animated slow');
moreDetailsItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
moreDetails.waypoint(function () {
moreDetailsItem.addClass('go');
}, {offset: '60%'}
);
/* subpage contact */
var subpageContact = $('.about-form');
var subpageContactContainer = subpageContact.find('.container');
subpageContactContainer.addClass('fadeInUp animated slow');
subpageContact.waypoint(function () {
subpageContactContainer.addClass('go');
}, {offset: '60%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
}
var pageContact = $('#page-contact');
if (pageContact.length > 0) {
/* header */
var contact = $('#page-contact');
var contactHeader = contact.find('.section-header');
i = 1;
contactHeader.addClass('fadeInUp animated fast');
contact.waypoint(function () {
contactHeader.addClass('go');
}, {offset: '60%'}
);
/* header */
var contactColumns = $('.form-columns');
var contactLeft = contactColumns.find('.text');
var contactRight = contactColumns.find('.subpage-form');
i = 1;
contactLeft.addClass('fadeInLeft animated delay-500');
contactRight.addClass('fadeInRight animated delay-1000');
contact.waypoint(function () {
contactLeft.addClass('go');
contactRight.addClass('go');
}, {offset: '60%'}
);
/* contact list */
var contactList = $('.contact-list');
var contactItems = contactList.find('.col-xs-12');
i = 1;
baseDelay = 250;
contactItems.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
contactItems.addClass('fadeInUp animated');
contactList.waypoint(function () {
contactItems.addClass('go');
}, {offset: '60%'}
);
/* maps */
var map = $('.section-map');
var mapContent = map.find('.map-content');
mapContent.addClass('growIn animated');
mapContent.waypoint(function () {
mapContent.addClass('go');
}, {offset: '60%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
}
var pageBusiness = $('#page-business');
if (pageBusiness.length > 0) {
var aboutDelay = ['delay-750', 'delay-1000', 'delay-1500'];
var about = $('.section-business');
var aboutHeader = about.find('.section-header');
var aboutPartnersDesc1 = about.find('.desc-first');
var aboutPartnersDesc1H4 = aboutPartnersDesc1.find('h4');
var aboutPartnersDesc1Li = aboutPartnersDesc1.find('li');
var aboutPartnersDesc1More = aboutPartnersDesc1.find('.more-desc');
var aboutPartnersDesc2 = about.find('.desc-second');
var aboutPartnersDesc2H4 = aboutPartnersDesc2.find('h4');
var aboutPartnersDesc2Li = aboutPartnersDesc2.find('li');
var aboutPartnersDesch5 = aboutPartnersDesc2.find('h5');
aboutHeader.addClass('fadeInLeft animated fast');
aboutPartnersDesc1H4.addClass('fadeInUp animated fast');
aboutPartnersDesc1Li.addClass('slideInUp animated');
aboutPartnersDesc1More.addClass('fadeInUp animated fast delay-2000');
aboutPartnersDesc1Li.each(function (index) {
//console.log(aboutDelay[index]);
$(this).addClass(aboutDelay[index]);
});
about.waypoint(function () {
aboutHeader.addClass('go');
}, {offset: '60%'}
);
about.waypoint(function () {
aboutPartnersDesc1H4.addClass('go');
}, {offset: '55%'}
);
about.waypoint(function () {
aboutPartnersDesc1Li.addClass('go');
aboutPartnersDesc1More.addClass('go');
}, {offset: '30%'}
);
aboutHeader.addClass('fadeInLeft animated fast');
aboutPartnersDesc2H4.addClass('fadeInUp animated fast delay-750');
aboutPartnersDesc2Li.addClass('slideInUp animated');
aboutPartnersDesch5.addClass('fadeInUp animated fast delay-2500');
aboutPartnersDesc2Li.each(function (index) {
$(this).addClass(aboutDelay[index]);
});
about.waypoint(function () {
aboutPartnersDesc2H4.addClass('go');
}, {offset: '20%'}
);
about.waypoint(function () {
aboutPartnersDesc2Li.addClass('go');
aboutPartnersDesch5.addClass('go');
}, {offset: '10%'}
);
/* eco */
var eco = $('.business-eco');
var ecoLeft = eco.find('.left');
var ecoRight = eco.find('.right');
i = 1;
ecoLeft.addClass('fadeInLeft animated delay-3000');
ecoRight.addClass('fadeInRight animated delay-2000');
eco.waypoint(function () {
ecoLeft.addClass('go');
ecoRight.addClass('go');
}, {offset: '80%'}
);
/* education */
var education = $('.business-edu');
var educationLeft = education.find('.left');
var educationRight = education.find('.right');
i = 1;
educationLeft.addClass('fadeInLeft animated delay-1000');
educationRight.addClass('fadeInRight animated delay-2500');
education.waypoint(function () {
educationLeft.addClass('go');
educationRight.addClass('go');
}, {offset: '60%'}
);
/* pesrpective */
var perspective = $('.business-perspective');
var perspectiveLeft = perspective.find('.left');
var perspectiveRight = perspective.find('.right');
i = 1;
perspectiveLeft.addClass('fadeInLeft animated delay-2500');
perspectiveRight.addClass('fadeInRight animated delay-1000');
perspective.waypoint(function () {
perspectiveLeft.addClass('go');
perspectiveRight.addClass('go');
}, {offset: '60%'}
);
/* subpage contact */
var subpageContact = $('.about-form');
var subpageContactContainer = subpageContact.find('.container');
subpageContactContainer.addClass('fadeInUp animated slow');
subpageContact.waypoint(function () {
subpageContactContainer.addClass('go');
}, {offset: '60%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
}
var pageHauler = $('#page-hauler');
if (pageHauler.length > 0) {
/* */
i = 1;
baseDelay = 250;
var hauler1 = $('.hauler-packet1');
var hauler1Header = hauler1.find('.section-header');
var hauler1Divs = hauler1.find('.div1, .div2, .div3');
hauler1Header.addClass('fadeInUp animated delay-500');
hauler1Divs.addClass('animated');
hauler1Divs.each(function () {
if (i % 2 === 1) {
_class = 'fadeInLeft';
}
$(this).addClass(_class + ' delay-' + (500 + baseDelay * i * 2));
i++;
});
hauler1.waypoint(function () {
hauler1Header.addClass('go');
hauler1Divs.addClass('go');
}, {offset: '60%'}
);
/* */
var hauler2 = $('.hauler-packet2');
var hauler2Left = hauler2.find('.cover-img');
var hauler2Right = hauler2.find('.text-content');
hauler2Left.addClass('flipInX slow animated delay-1500');
hauler2Right.addClass('fadeInRight animated delay-500');
hauler2.waypoint(function () {
hauler2Left.addClass('go');
hauler2Right.addClass('go');
}, {offset: '60%'}
);
/* */
var hauler3 = $('.hauler-packet3');
var hauler3Right = hauler3.find('.cover-img');
var hauler3Left = hauler3.find('.text-content');
hauler3Left.addClass('fadeInLeft animated delay-500');
hauler3Right.addClass('flipInX slow animated delay-1500');
hauler3.waypoint(function () {
hauler3Left.addClass('go');
hauler3Right.addClass('go');
}, {offset: '60%'}
);
/* subpage contact */
var subpageContact = $('.about-form');
var subpageContactContainer = subpageContact.find('.container');
subpageContactContainer.addClass('fadeInUp animated slow');
subpageContact.waypoint(function () {
subpageContactContainer.addClass('go');
}, {offset: '60%'}
);
/* */
i = 1;
var haulerNotice = $('.hauler-notice');
var haulerNoticeHeader = haulerNotice.find('.section-header');
var haulerNoticeDesc = haulerNotice.find('.box-info');
var haulerNoticeImg = haulerNotice.find('.cover-img');
haulerNoticeImg.addClass('flipInX slow animated delay-1500');
haulerNoticeHeader.addClass('fadeInUp animated delay-500');
haulerNoticeDesc.addClass('fadeInUp animated delay-1000');
haulerNotice.waypoint(function () {
haulerNoticeImg.addClass('go');
haulerNoticeHeader.addClass('go');
haulerNoticeDesc.addClass('go');
}, {offset: '60%'}
);
}
var pageClients = $('#page-clients');
if (pageClients.length > 0) {
/* */
i = 1;
baseDelay = 250;
var clientsTop = $('.clients-header');
var clientsHeader = clientsTop.find('.section-header');
var clientsDivs = clientsTop.find('.desc, .desc2, .desc3');
clientsHeader.addClass('fadeInUp animated delay-500');
clientsDivs.addClass('animated');
clientsDivs.each(function () {
_class = 'fadeInRight';
if (i % 2 === 1) {
_class = 'fadeInLeft';
}
$(this).addClass(_class + ' delay-' + (500 + baseDelay * i * 2));
i++;
});
clientsTop.waypoint(function () {
clientsHeader.addClass('go');
clientsDivs.addClass('go');
}, {offset: '60%'}
);
/* */
i = 1;
var clientsExperienceLogistic = $('.clients-experience-logistic');
var clientsExperienceHeader = clientsExperienceLogistic.find('.title-header');
var experianceItems = clientsExperienceLogistic.find('.item');
clientsExperienceHeader.addClass('fadeInUp animated delay-500');
experianceItems.addClass('animated slow');
experianceItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
clientsExperienceLogistic.waypoint(function () {
clientsExperienceHeader.addClass('go');
experianceItems.addClass('go');
}, {offset: '60%'}
);
/**/
var clientsExperience = $('.clients-experience');
var experienceHeader2 = clientsExperience.find('.section-header');
var experienceDesc = clientsExperience.find('.desc-container');
experienceHeader2.addClass('fadeInUp animated delay-500');
experienceDesc.addClass('fadeInRight animated delay-1500');
clientsExperience.waypoint(function () {
experienceHeader2.addClass('go');
}, {offset: '40%'}
);
clientsExperience.waypoint(function () {
experienceDesc.addClass('go');
}, {offset: '30%'}
);
/* */
var offer1 = $('.offer-1');
var offer1Left = offer1.find('.cover-img');
var offer1Right = offer1.find('.text-content');
var offer1Header = $('.clients-offer .section-header');
offer1Right.addClass('fadeInLeft animated delay-500');
offer1Left.addClass('flipInY slow animated delay-1500');
offer1Header.addClass('fadeInUp animated delay-500');
offer1.waypoint(function () {
offer1Header.addClass('go');
}, {offset: '100%'}
);
offer1.waypoint(function () {
offer1Right.addClass('go');
offer1Left.addClass('go');
}, {offset: '60%'}
);
/* */
var offer2 = $('.offer-2');
var offer2Left = offer2.find('.cover-img');
var offer2Right = offer2.find('.text-content');
offer2Right.addClass('fadeInLeft animated delay-500');
offer2Left.addClass('flipInY slow animated delay-1500');
offer2.waypoint(function () {
offer2Right.addClass('go');
offer2Left.addClass('go');
}, {offset: '60%'}
);
/* */
var offer3 = $('.offer-3');
var offer3Left = offer3.find('.cover-img');
var offer3Right = offer3.find('.text-content');
offer3Right.addClass('fadeInLeft animated delay-500');
offer3Left.addClass('flipInY slow animated delay-1500');
offer3.waypoint(function () {
offer3Right.addClass('go');
offer3Left.addClass('go');
}, {offset: '60%'}
);
/* */
i = 1;
var fleet = $('.clients-fleet');
var fleetHeader = fleet.find('.section-header');
var fleetDesc = fleet.find('.text');
var fleetItems = fleet.find('.fleet-list .item');
fleetHeader.addClass('fadeInUp animated delay-500');
fleetDesc.addClass('fadeInUp animated delay-1000');
fleetItems.addClass('fadeInUp animated');
fleetItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
fleet.waypoint(function () {
fleetHeader.addClass('go');
fleetDesc.addClass('go');
}, {offset: '60%'}
);
fleet.waypoint(function () {
fleetItems.addClass('go');
}, {offset: '40%'}
);
/* subpage contact */
var subpageContact = $('.about-form');
var subpageContactContainer = subpageContact.find('.container');
subpageContactContainer.addClass('fadeInUp animated slow');
subpageContact.waypoint(function () {
subpageContactContainer.addClass('go');
}, {offset: '60%'}
);
}
var pageReferences = $('#page-references');
if (pageReferences.length > 0) {
/* */
i = 1;
var referenceMain = $('.section-references');
var referenceHeader = referenceMain.find('.section-header');
var referenceDesc = referenceMain.find('.description');
referenceHeader.addClass('fadeInUp animated delay-500');
referenceDesc.addClass('fadeInUp animated delay-1000');
referenceSlider.addClass('fadeInUp animated delay-1500');
referenceMain.waypoint(function () {
referenceHeader.addClass('go');
referenceDesc.addClass('go');
}, {offset: '60%'}
);
}
var pageCareer = $('#page-career');
if (pageCareer.length > 0) {
/* */
i = 1;
baseDelay = 250;
var careerAbout = $('.career-about');
var careerAboutHeader = careerAbout.find('.section-header');
var careerAboutMore = careerAbout.find('.more-header');
var careerLi = careerAbout.find('li');
var careerJoin = careerAbout.find('.join-us');
careerAboutHeader.addClass('fadeInUp animated delay-500');
careerAboutMore.addClass('fadeInUp animated delay-1000');
careerLi.addClass('fadeInUp animated fast');
careerJoin.addClass('fadeInRight animated delay-1000');
careerAbout.waypoint(function () {
careerAboutHeader.addClass('go');
}, {offset: '60%'}
);
careerAbout.waypoint(function () {
careerAboutMore.addClass('go');
}, {offset: '50%'}
);
careerLi.each(function (idx) {
var item = careerAbout.find('li').eq(idx);
$(this).addClass('delay-' + baseDelay * i);
careerAbout.waypoint(function () {
item.addClass('go');
}, {offset: '30%'}
);
i++;
});
careerAbout.waypoint(function () {
careerJoin.addClass('go');
}, {offset: '20%'}
);
/* */
i = 1;
var careerCv = $('.career-cv-offer');
var careerCvHeader = careerCv.find('.section-header');
var careerCvItems = careerCv.find('.item');
careerCvHeader.addClass('fadeInUp animated delay-500');
careerCvItems.addClass('fadeInUp animated fast');
careerCv.waypoint(function () {
careerCvHeader.addClass('go');
}, {offset: '60%'}
);
careerCvItems.each(function (idx) {
var item = careerCv.find('.item').eq(idx);
$(this).addClass('delay-' + baseDelay * i);
careerCv.waypoint(function () {
item.addClass('go');
}, {offset: '50%'}
);
i++;
});
/* */
i = 1;
var arguments = $('.career-arguments');
var argumentsHeader = arguments.find('.section-header');
var argumentsDesc = arguments.find('.text-content');
var argumentsItems = arguments.find('li');
var argumentsLast = arguments.find('.last-info');
argumentsHeader.addClass('fadeInUp animated delay-500');
argumentsDesc.addClass('fadeInUp animated delay-1000');
argumentsLast.addClass('fadeInUp animated delay-2000');
argumentsItems.addClass('animated');
argumentsItems.each(function () {
$(this).addClass('flipInX delay-' + (1000 + baseDelay * i * 2));
i++;
});
arguments.waypoint(function () {
argumentsHeader.addClass('go');
argumentsDesc.addClass('go');
}, {offset: '60%'}
);
arguments.waypoint(function () {
argumentsItems.addClass('go');
}, {offset: '30%'}
);
arguments.waypoint(function () {
argumentsLast.addClass('go');
}, {offset: '10%'}
);
/* */
i = 1;
var careerCv2 = $('.career-cv');
var careerCv2Header = careerCv2.find('.section-header');
var careerCv2Desc = careerCv2.find('.box-info');
careerCv2Header.addClass('fadeInUp animated delay-500');
careerCv2Desc.addClass('fadeInUp animated delay-1000');
careerCv2.waypoint(function () {
careerCv2Header.addClass('go');
careerCv2Desc.addClass('go');
}, {offset: '60%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
}
var pageRecmmendation = $('#page-references');
if (pageRecmmendation.length > 0) {
var baseContent = $('#referencje');
var _item = $('.reference-list .item');
var baseDelay = 250;
var baseTop = 40;
var i = 0;
_item.addClass('fadeInUp animated slow');
_item.each(function () {
$(this).addClass('delay-' + (250 + baseDelay * i));
i++;
});
pageRecmmendation.waypoint(function () {
_item.addClass('go');
}, {offset: '60%'}
);
}
});
var pageEastdeliveries = $('#page-eastdeliveries');
if (pageEastdeliveries.length > 0) {
var eastdeliveriesMain = $('.section-eastdeliveriesMain');
var eastdeliveriesMainHeader = eastdeliveriesMain.find('.section-header');
var eastdeliveriesMainLeft = eastdeliveriesMain.find('.desc-first');
var eastdeliveriesMainRight = eastdeliveriesMain.find('.desc-second');
eastdeliveriesMainHeader.addClass('fadeInUp animated delay-500');
eastdeliveriesMainLeft.addClass('fadeInLeft animated delay-1000');
eastdeliveriesMainRight.addClass('fadeInRight animated delay-1500');
eastdeliveriesMain.waypoint(function () {
eastdeliveriesMainHeader.addClass('go');
}, {offset: '80%'}
);
eastdeliveriesMain.waypoint(function () {
eastdeliveriesMainLeft.addClass('go');
eastdeliveriesMainRight.addClass('go');
}, {offset: '60%'}
);
var i = 0;
var baseDelay = 250;
var eastdeliveriesList = $('.section-eastdeliveriesList');
var eastdeliveriesListHeader = eastdeliveriesList.find('.title');
var eastdeliveriesListItems = eastdeliveriesList.find('.desc-list li');
var eastdeliveriesListText = eastdeliveriesList.find('.desc-text');
eastdeliveriesListHeader.addClass('fadeInUp animated delay-250');
eastdeliveriesListItems.each(function () {
$(this).addClass('animated flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
eastdeliveriesListText.addClass('flipInY animated delay-2250');
eastdeliveriesList.waypoint(function () {
eastdeliveriesListHeader.addClass('go');
}, {offset: '70%'}
);
eastdeliveriesList.waypoint(function () {
eastdeliveriesListItems.addClass('go');
eastdeliveriesListText.addClass('go');
}, {offset: '60%'}
);
var eastMapContent = $('.section-eastdeliveriesMap');
var eastMap = $('.eastMap');
eastMap.addClass('flipInY animated delay-2250');
eastMapContent.waypoint(function () {
eastMap.addClass('go');
}, {offset: '90%'}
);
var subpageContact = $('.about-form');
var subpageContactContainer = subpageContact.find('.container');
subpageContactContainer.addClass('fadeInUp animated slow delay-500');
subpageContact.waypoint(function () {
subpageContactContainer.addClass('go');
}, {offset: '60%'}
);
/* partners */
var baseDelay = 250;
var i = 0;
var partners = $('.section-partners');
var partnersHeader = partners.find('.container');
var partnersItem = partners.find('.item img');
partnersHeader.addClass('growIn animated');
partnersItem.addClass('fadeInUp animated fast');
partnersItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
partners.waypoint(function () {
partnersHeader.addClass('go');
partnersItem.addClass('go');
setTimeout(function () {
partnersSlider.trigger('play.owl.autoplay', [400]);
}, 3100);
}, {offset: '60%'}
);
var sectionHow = $('.section-how');
var sectionHowHeader = sectionHow.find('.section-header');
var sectionHowImg = sectionHow.find('img');
var sectionHelp = $('.section-help');
var sectionHelpHeader = sectionHelp.find('.section-header');
var sectionHelpImg = sectionHelp.find('img');
var sectionHelpText = sectionHelp.find('.txt');
var sectionKontakt = $('.section-sales-kontakt');
var sectionKontaktHeader = sectionKontakt.find('.section-header');
var sectionKontaktPerson = sectionKontakt.find('.person');
var sectionKontaktForm = sectionKontakt.find('form');
var i = 0;
var baseDelay = 250;
var i = 0;
sectionKontaktPerson.each(function () {
$(this).addClass('animated flipInX delay-' + (1000 + baseDelay * i * 2));
i++;
});
sectionHowHeader.addClass('fadeInUp animated delay-500');
sectionHowImg.addClass('flipInX animated delay-1500');
var sectionWork = $('.section-work');
var sectionWorkHeader = sectionWork.find('.section-header');
var sectionWorkImg = sectionWork.find('img');
sectionWorkHeader.addClass('fadeInUp animated delay-500');
sectionWorkImg.addClass('flipInX animated delay-1500');
sectionWork.waypoint(function () {
sectionWorkHeader.addClass('go');
sectionWorkImg.addClass('go');
}, {offset: '80%'}
);
var sectionMap = $('.section-maps');
var sectionMapHeader = sectionMap.find('.section-header');
var sectionMapImg = sectionMap.find('img');
sectionMapHeader.addClass('fadeInUp animated delay-500');
sectionMapImg.addClass('flipInX animated delay-1500');
sectionMap.waypoint(function () {
sectionMapHeader.addClass('go');
sectionMapImg.addClass('go');
}, {offset: '80%'}
);
var fleet = $('.clients-fleet');
var fleetHeader = fleet.find('.section-header');
var fleetDesc = fleet.find('.text');
var fleetItems = fleet.find('.fleet-list .item');
fleetHeader.addClass('fadeInUp animated delay-500');
fleetDesc.addClass('fadeInUp animated delay-1000');
fleetItems.addClass('fadeInUp animated');
var i = 0;
fleetItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
fleet.waypoint(function () {
fleetHeader.addClass('go');
fleetDesc.addClass('go');
}, {offset: '60%'}
);
fleet.waypoint(function () {
fleetItems.addClass('go');
}, {offset: '40%'}
);
var sectionPersons = $('.persons');
var sectionPersonsHeader = sectionPersons.find('.section-header');
var sectionPersonsLi = sectionPersons.find('.personsItem');
sectionPersonsHeader.addClass('fadeInUp animated delay-500');
sectionPersonsLi.addClass('delay-500 slow animated');
var base = 250;
var i = 1;
sectionPersonsLi.each(function (idx) {
var item = $(this).eq(idx);
if (i%2) {
$(this).addClass('flipInX');
} else {
$(this).addClass('flipInY');
}
i++;
});
sectionPersons.waypoint(function () {
sectionPersonsHeader.addClass('go');
}, {offset: '70%'});
sectionPersons.waypoint(function () {
sectionPersonsLi.addClass('go');
}, {offset: '30%'});
sectionHow.waypoint(function () {
sectionHowHeader.addClass('go');
sectionHowImg.addClass('go');
}, {offset: '80%'}
);
}
$(window).ready(function () {
var slideDown = $('#slide-down');
var doc = document.documentElement;
var top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
var sectionsPosition;
var goToTop = 0;
if (startPage.length > 0) {
$(window).scroll(function () {
if (typeof sectionsPosition !== 'undefined') {
top = (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);
if (top > sectionsPosition.features - 100) {
slideDown.addClass('fixed');
} else {
slideDown.removeClass('fixed');
}
//console.log(goToTop);
var nextElement = false;
for (var prop in sectionsPosition) {
var topProp = sectionsPosition[prop];
if (top > sectionsPosition.contact - 100) {
goToTop = sectionsPosition.footer;
break;
} else if (top > sectionsPosition.map - 100) {
goToTop = sectionsPosition.contact;
break;
} else if (top > sectionsPosition.news - 100) {
goToTop = sectionsPosition.map;
break;
} else if (top > sectionsPosition.certificate - 100) {
goToTop = sectionsPosition.news;
break;
} else if (top > sectionsPosition.business - 100) {
goToTop = sectionsPosition.certificate;
break;
} else if (top > sectionsPosition.career - 100) {
goToTop = sectionsPosition.business;
break;
} else if (top > sectionsPosition.hauler - 100) {
goToTop = sectionsPosition.career;
break;
} else if (top > sectionsPosition.clients - 100) {
goToTop = sectionsPosition.hauler;
break;
} else if (top > sectionsPosition.references - 100) {
goToTop = sectionsPosition.clients;
break;
} else if (top > sectionsPosition.features - 100) {
goToTop = sectionsPosition.references;
break;
} else {
goToTop = sectionsPosition.features;
break;
}
}
}
});
setTimeout(function () {
sectionsPosition = {
footer: $('.footer').offset().top,
contact: $('.section-contact').offset().top,
map: $('.section-map').offset().top,
//news: $('.section-news').offset().top, throws bug on console
certificate: $('.section-certificate').offset().top,
business: $('.section-business').offset().top,
career: $('.section-career').offset().top,
hauler: $('.section-hauler').offset().top,
clients: $('.section-clients').offset().top,
references: $('.section-references ').offset().top,
features: $('.section-features').offset().top
};
}, 1300);
}
$('#slide-down').click(function () {
var scrollY = $('.section-features').offset().top;
if (goToTop > 0) {
scrollY = goToTop;
}
$('html,body').stop().animate({
scrollTop: scrollY
}, 1000);
});
$('#slide-top, #mobileTop').click(function () {
$('html,body').stop().animate({
scrollTop: (0)
}, 1400);
});
if (startPage.length > 0) {
$('#tempMenu a, .footer nav a').click(function (e) {
var href = $(this).attr('href');
if (href.indexOf('#') > -1) {
e.preventDefault();
scrollTo(this.hash);
}
});
if (location.hash) {
setTimeout(function () {
scrollTo(location.hash)
}, 1600);
}
}
function scrollTo(hash) {
var target = $(hash);
if (target.length) {
$('html,body').stop().animate({
scrollTop: (target.offset().top)
}, 1500);
return false;
}
}
/* about */
$('.about-more-details .content').slideToggle(100);
$('.about-more-details .button').click(function () {
var parent = $(this).closest('.item').find('.content');
parent.slideToggle();
});
});
$('#newsletter').on('submit', function (e) {
var email = $(this).find('input').val();
if (email.length < 3) {
e.preventDefault();
$(this).find('input').addClass('error');
}
});
$('.cv-offer-list h4').click(function () {
var parent = $(this).closest('.item').find('.text');
parent.slideToggle(200, "swing", function () {
jQuery(window).trigger('resize').trigger('scroll');
});
});
if ($('.career-cv-offer').length > 0) {
if (window.location.hash) {
var _hash = window.location.hash.replace('#', '');
var activeItem = $('#offer-' + _hash);
if (activeItem.length) {
activeItem.find('.text').show();
$('html,body').stop().animate({
scrollTop: (activeItem.offset().top - 81)
}, 1500);
}
}
}
//$(function () {
// var $window = $(window); //Window object
//
// var scrollTime = 0.4; //Scroll time
// var scrollDistance = 140; //Distance. Use smaller value for shorter scroll and greater value for longer scroll
//
// $window.on("mousewheel DOMMouseScroll", function (event) {
//
// event.preventDefault();
//
// var delta = event.originalEvent.wheelDelta / 120 || -event.originalEvent.detail / 3;
// var scrollTop = $window.scrollTop();
// var finalScroll = scrollTop - parseInt(delta * scrollDistance);
//
// TweenMax.to($window, scrollTime, {
// scrollTo: {y: finalScroll, autoKill: true},
// ease: Power1.easeOut, //For more easing functions see http://api.greensock.com/js/com/greensock/easing/package-detail.html
// autoKill: true,
// overwrite: 5
// });
//
// });
//
//});
var body = $('body');
var header = $('#nav');
body.waypoint(function (d) {
header.toggleClass('header-hide', d === 'down');
},
{offset: -100});
body.waypoint(function (d) {
header.toggleClass('header-hide', d === 'up');
header.toggleClass('header-fixed', d === 'down');
},
{offset: -240});
/* kariera */
if ($('#page-career').length > 0) {
var linksCarrier = $('.career-cv-offer .cv-offerText a');
linksCarrier.each(function () {
var
href = $(this).attr('href')
buttonContent = $(this).closest('.item').find('.cv-offerButtonContent');
if (href.indexOf('.pdf') >= 0) {
$(this).addClass('button');
$(this).attr('target', '_blank');
buttonContent.prepend($(this));
}
});
}
$('#contactFormCareer').on('submit', function (evt) {
var formData = new FormData($(this)[0]);
evt.preventDefault();
var k = ['question', 'name'],
good = true;
var data = new FormData();
$(this).find('[name]').removeClass('error');
$(this).find('p.ajaxInfo').hide();
$.each($(this).find('input[type="file"]')[0].files, function (i, file) {
data.append('file-' + i, file);
});
if (/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).find('[name="mail"]').val()) == false) {
$(this).find('[name="mail"]').addClass('error');
good = false;
}
if(grecaptcha.getResponse().length !== 0){
good = true;
} else {
good = false;
}
if ($(this).find('[name="phone"]').val().replace(/[^\d]/, '').length < 9) {
$(this).find('[name="phone"]').addClass('error');
good = false;
}
for (var i = 0; i < k.length; i++) {
var obj = $(this).find('[name="' + k[i] + '"]');
if (obj.val().length <= 1) {
good = false;
obj.addClass('error');
}
}
if (good) {
$.ajax({
url: $(this).attr('action'),
type: 'POST',
xhr: function () { // Custom XMLHttpRequest
var myXhr = $.ajaxSettings.xhr();
return myXhr;
},
//Ajax events
success: (function (response) {
if (response.indexOf('false') === -1) {
$(this).find('input, textarea').val('');
$(this).find('p.ajaxInfo.ok').show();
} else {
$(this).find('p.ajaxInfo.error_send').show();
}
}).bind(this),
// Form data
data: formData,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
} else {
$(this).find('p.ajaxInfo.error').show();
}
});
$('#sendMailFriendRefer').on('submit', function (evt) {
var formData = new FormData($(this)[0]);
evt.preventDefault();
var k = ['senderName', 'senderSurname', 'candidateName', 'candidateSurname'],
good = true;
var data = new FormData();
$(this).find('[name]').removeClass('error');
$(this).find('p.ajaxInfo').hide();
$.each($(this).find('input[type="file"]')[0].files, function (i, file) {
data.append('file-' + i, file);
});
if (/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).find('[name="senderMail"]').val()) == false) {
$(this).find('[name="senderMail"]').addClass('error');
good = false;
}
if (/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test($(this).find('[name="candidateMail"]').val()) == false) {
$(this).find('[name="candidateMail"]').addClass('error');
good = false;
}
if(grecaptcha.getResponse().length !== 0){
good = true;
} else {
good = false;
}
if ($(this).find('[name="candidatePhone"]').val().replace(/[^\d]/, '').length < 9) {
$(this).find('[name="candidatePhone"]').addClass('error');
good = false;
}
for (var i = 0; i < k.length; i++) {
var obj = $(this).find('[name="' + k[i] + '"]');
if (obj.val().length <= 1) {
good = false;
obj.addClass('error');
}
}
if (good) {
$.ajax({
url: $(this).attr('action'),
type: 'POST',
xhr: function () { // Custom XMLHttpRequest
var myXhr = $.ajaxSettings.xhr();
return myXhr;
},
//Ajax events
success: (function (response) {
if (response.indexOf('false') === -1) {
$(this).find('input, textarea').val('');
$(this).find('p.ajaxInfo.ok').show();
} else {
$(this).find('p.ajaxInfo.error_send').show();
}
}).bind(this),
// Form data
data: formData,
//Options to tell jQuery not to process data or worry about content-type.
cache: false,
contentType: false,
processData: false
});
} else {
$(this).find('p.ajaxInfo.error').show();
}
});
// new career
var pageNewCareer = $('#new-page-career');
if (pageNewCareer.length > 0) {
var careerAbout = $('.career-about');
var circleCareer = careerAbout.find('.center-circle');
var careerAboutHeader = careerAbout.find('.section-header');
var i = 0;
var baseDelay = 250;
var careerAboutListItems = careerAbout.find('.list-circle');
var careerItemsSection = $('.career-arguments');
var careerItemsHeader = careerItemsSection.find('.section-header');
var careerItems = careerItemsSection.find('.offer-item');
var contactCareer = $('.career-cv');
var contactCareerHeader = contactCareer.find('.section-header');
var contactCareerText = contactCareer.find('.box-info');
var whySection = $('.why-section');
var whySectionHeader = whySection.find('.section-header');
var whySectionItems = whySection.find('.why-item');
var careerQuestions = $('.career-questions');
var careerQuestionsHeader = careerQuestions.find('.section-header');
var careerQuestionsItems = careerQuestions.find('.item');
var sectionAmbasador = $('.ambasador');
var sectionAmbasadorHeader = sectionAmbasador.find('.section-header');
var sectionAmbasadorText = sectionAmbasador.find('.in-6');
var sectionAmbasadorImage = sectionAmbasador.find('.ambasadorImg');
var sectionPractice = $('.practice');
var sectionPracticeHeader = sectionPractice.find('.section-header');
var sectionPracticeText = sectionPractice.find('.in-6');
var sectionPracticeImage = sectionPractice.find('.practiceImg');
circleCareer.addClass('fadeIn animated delay-1000');
careerAboutHeader.addClass('fadeInUp animated delay-500');
careerItemsHeader.addClass('fadeInUp animated delay-500');
contactCareerHeader.addClass('fadeInUp animated delay-500');
contactCareerText.addClass('fadeInUp animated delay-1000');
whySectionHeader.addClass('fadeInUp animated delay-200');
careerQuestionsHeader.addClass('fadeInUp animated delay-200');
sectionAmbasadorHeader.addClass('fadeInUp animated delay-500');
sectionPracticeHeader.addClass('fadeInUp animated delay-500');
sectionAmbasadorText.addClass('flipInX animated slow delay-1000');
sectionAmbasadorImage.addClass('flipInX animated slow delay-1500');
sectionPracticeText.addClass('flipInX animated slow delay-1000');
sectionPracticeImage.addClass('flipInX animated slow delay-1500');
careerQuestionsItems.addClass('flipInX animated fast');
careerAboutListItems.each(function () {
$(this).addClass('animated flipInX delay-' + (1500 + baseDelay * i * 2));
i++;
});
var i = 0;
careerItems.each(function () {
$(this).addClass('animated flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
var i = 0;
whySectionItems.each(function () {
$(this).addClass('animated flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
careerAbout.waypoint(function () {
careerAboutHeader.addClass('go');
}, {offset: '90%'}
);
careerAbout.waypoint(function () {
circleCareer.addClass('go');
careerAboutListItems.addClass('go');
}, {offset: '50%'}
);
careerItemsSection.waypoint(function () {
careerItemsHeader.addClass('go');
}, {offset: '90%'}
);
careerItemsSection.waypoint(function () {
careerItems.addClass('go');
}, {offset: '50%'}
);
contactCareer.waypoint(function () {
contactCareerHeader.addClass('go');
contactCareerText.addClass('go');
}, {offset: '80%'}
);
whySection.waypoint(function () {
whySectionHeader.addClass('go');
whySectionItems.addClass('go');
}, {offset: '80%'}
);
careerQuestions.waypoint(function () {
careerQuestionsHeader.addClass('go');
}, {offset: '80%'}
);
var i = 0;
careerQuestionsItems.each(function (idx) {
var item = careerQuestions.find('.item').eq(idx);
$(this).addClass('delay-' + baseDelay * i);
careerQuestions.waypoint(function () {
item.addClass('go');
}, {offset: '50%'}
);
i++;
});
sectionAmbasador.waypoint(function () {
sectionAmbasadorHeader.addClass('go');
sectionAmbasadorText.addClass('go');
sectionAmbasadorImage.addClass('go');
}, {offset: '80%'}
);
sectionPractice.waypoint(function () {
sectionPracticeHeader.addClass('go');
sectionPracticeText.addClass('go');
sectionPracticeImage.addClass('go');
}, {offset: '80%'}
);
}
var pageTrade = $('#page-trade');
if (pageTrade.length > 0) {
var sectionSupport = $('.trade-support--true');
var sectionSupportHeader = sectionSupport.find('.section-header');
var supportLeft = sectionSupport.find('.text-content');
var supportRight = sectionSupport.find('.cover-img');
sectionSupportHeader.addClass('fadeInUp animated delay-500');
supportLeft.addClass('fadeInLeft animated fast delay-1000');
supportRight.addClass('fadeInRight animated fast delay-2000');
sectionSupport.waypoint(function () {
sectionSupportHeader.addClass('go');
}, {offset: '80%'});
sectionSupport.waypoint(function () {
supportLeft.addClass('go');
supportRight.addClass('go');
}, {offset: '60%'});
/* trade-places */
var sectionPlaces = $('.trade-places');
var sectionPlacesHeader = sectionPlaces.find('.section-header');
var placesLeft = sectionPlaces.find('.cover-img');
var placesRight = sectionPlaces.find('.text-content');
sectionPlacesHeader.addClass('fadeInUp animated delay-500');
placesLeft.addClass('fadeInLeft animated fast delay-1000');
placesRight.addClass('fadeInRight animated fast delay-2000');
sectionPlaces.waypoint(function () {
sectionPlacesHeader.addClass('go');
}, {offset: '80%'});
sectionPlaces.waypoint(function () {
placesLeft.addClass('go');
placesRight.addClass('go');
}, {offset: '60%'});
/* trade-range */
var sectionTradeRange = $('.trade-range');
var sectionTradeRangeHeader = sectionTradeRange.find('.section-header');
var sectionTradeRangeText = sectionTradeRange.find('.text');
var sectionTradeRangeTitle = sectionTradeRange.find('.trade-vehicle h4');
var sectionTradeRangeLi = sectionTradeRange.find('.trade-vehicle .item');
sectionTradeRangeHeader.addClass('fadeInUp animated delay-500');
sectionTradeRangeText.addClass('flipInX animated delay-2000');
sectionTradeRangeTitle.addClass('fadeInDown animated delay-250');
sectionTradeRangeLi.addClass('fadeInUp fast animated');
var base = 500;
var i = 1;
sectionTradeRangeLi.each(function (idx) {
var item = $(this).eq(idx);
$(this).addClass('delay-' + base * i);
i++;
});
sectionTradeRange.waypoint(function () {
sectionTradeRangeHeader.addClass('go');
sectionTradeRangeText.addClass('go');
}, {offset: '70%'});
sectionTradeRange.waypoint(function () {
sectionTradeRangeTitle.addClass('go');
}, {offset: '50%'});
sectionTradeRange.waypoint(function () {
sectionTradeRangeLi.addClass('go');
}, {offset: '40%'});
/* dedicated */
var sectionDedicated = $('.trade-dedicated');
var sectionDedicatedHeader = sectionDedicated.find('.section-header');
var dedicatedLeft = sectionDedicated.find('.text-content');
var dedicatedRight = sectionDedicated.find('.cover-img');
sectionDedicatedHeader.addClass('fadeInUp animated delay-500');
dedicatedLeft.addClass('fadeInLeft animated fast delay-1000');
dedicatedRight.addClass('fadeInRight animated fast delay-2000');
sectionDedicated.waypoint(function () {
sectionDedicatedHeader.addClass('go');
}, {offset: '80%'});
sectionDedicated.waypoint(function () {
dedicatedLeft.addClass('go');
dedicatedRight.addClass('go');
}, {offset: '60%'});
/* trade-choose */
var sectionChoose = $('.trade-choose');
var sectionChooseHeader = sectionChoose.find('.section-header');
var sectionChooseLi = sectionChoose.find('.trade-chooseList .item');
sectionChooseHeader.addClass('fadeInUp animated delay-500');
sectionChooseLi.addClass('fadeInUp fast animated');
var base = 500;
var i = 1;
sectionChooseLi.each(function (idx) {
var item = $(this).eq(idx);
$(this).addClass('delay-' + base * i);
i++;
});
sectionChoose.waypoint(function () {
sectionChooseHeader.addClass('go');
}, {offset: '70%'});
sectionChoose.waypoint(function () {
sectionChooseLi.addClass('go');
}, {offset: '50%'});
/* persons */
var sectionPersons = $('.persons');
var sectionPersonsHeader = sectionPersons.find('.section-header');
var sectionPersonsLi = sectionPersons.find('.personsItem');
sectionPersonsHeader.addClass('fadeInUp animated delay-500');
sectionPersonsLi.addClass('delay-500 slow animated');
var base = 250;
var i = 1;
sectionPersonsLi.each(function (idx) {
var item = $(this).eq(idx);
if (i%2) {
$(this).addClass('flipInX');
} else {
$(this).addClass('flipInY');
}
i++;
});
sectionPersons.waypoint(function () {
sectionPersonsHeader.addClass('go');
}, {offset: '70%'});
sectionPersons.waypoint(function () {
sectionPersonsLi.addClass('go');
}, {offset: '30%'});
}
var pageSales = $('#page-sales');
if (pageSales.length > 0) {
/* numbers */
var numbersElement = $('.about-numbers .item');
var numbersAray = [];
numbersElement.each(function (index) {
var strong = $(this).find('strong');
var i = index + 1;
var name = 'number-' + i;
strong.attr('id', name);
var sep = '';
var suf = '';
var dec ="";
var dec_len = 0;
var text = strong.html();
text = text.split(' ').join('').replace(/ /gi, '');
text = parseInt(text);
if(i==3) {
text = text/100;
sep = '';
suf = '%';
dec = ",";
dec_len = 2;
}
if (i==4) {
sep = ' ';
}
var options = {
useEasing: false,
useGrouping: true,
separator: sep,
decimal: dec,
prefix: '',
suffix: suf
}
numbersAray.push(new CountUp(name, 0, text, dec_len, 2.5, options));
});
var numbersSection = $('.about-numbers');
var numbersSectionItem = numbersSection.find('.item');
i = 1;
numbersSectionItem.addClass('animated fadeInUp');
numbersSectionItem.each(function () {
$(this).addClass('delay-' + (baseDelay * i));
i++;
});
numbersSection.waypoint(function () {
numbersSectionItem.addClass('go');
setTimeout(function () {
for (i = 0; i < numbersAray.length; i++) {
//console.log(i);
numbersAray[i].start();
}
}, 500);
}, {offset: '60%'}
);
var sectionSale = $('.section-sale');
var sectionSaleHeader = sectionSale.find('.section-header');
var personItems = sectionSale.find('.person');
var sectionFeatures = $('.section-features-sales');
var sectionFeaturesHeader = sectionFeatures.find('.section-header');
var sectionFeaturesText = sectionFeatures.find('.txt');
var sectionFeaturesLi = sectionFeatures.find('li');
var sectionMap = $('.section-maps');
var sectionMapHeader = sectionMap.find('.section-header');
var sectionMapImg = sectionMap.find('img');
var sectionWork = $('.section-work');
var sectionWorkHeader = sectionWork.find('.section-header');
var sectionWorkImg = sectionWork.find('img');
var sectionHow = $('.section-how');
var sectionHowHeader = sectionHow.find('.section-header');
var sectionHowImg = sectionHow.find('img');
var sectionHelp = $('.section-help');
var sectionHelpHeader = sectionHelp.find('.section-header');
var sectionHelpImg = sectionHelp.find('img');
var sectionHelpText = sectionHelp.find('.txt');
var sectionKontakt = $('.section-sales-kontakt');
var sectionKontaktHeader = sectionKontakt.find('.section-header');
var sectionKontaktPerson = sectionKontakt.find('.person');
var sectionKontaktForm = sectionKontakt.find('form');
var sectionAboutNumbers = $('.about-numbers .numbers_source');
var i = 0;
var baseDelay = 250;
var i = 0;
personItems.each(function () {
$(this).addClass('animated flipInX delay-' + (1000 + baseDelay * i * 2));
i++;
});
var i = 0;
sectionKontaktPerson.each(function () {
$(this).addClass('animated flipInX delay-' + (1000 + baseDelay * i * 2));
i++;
});
var i = 0;
sectionFeaturesLi.each(function () {
$(this).addClass('fadeInUp animated delay-' + (1000 + baseDelay * i * 2));
i++;
});
sectionSaleHeader.addClass('fadeInUp animated delay-500');
sectionFeaturesHeader.addClass('fadeInUp animated delay-500');
sectionFeaturesText.addClass('fadeInUp animated delay-500');
sectionMapHeader.addClass('fadeInUp animated delay-500');
sectionMapImg.addClass('flipInX animated delay-1500');
sectionWorkHeader.addClass('fadeInUp animated delay-500');
sectionWorkImg.addClass('flipInX animated delay-1500');
sectionAboutNumbers.addClass('fadeInUp animated delay-500');
sectionHowHeader.addClass('fadeInUp animated delay-500');
sectionHowImg.addClass('flipInX animated delay-1500');
sectionHelpHeader.addClass('fadeInUp animated delay-500');
sectionHelpText.addClass('fadeInUp animated delay-1000');
sectionHelpImg.addClass('flipInX animated delay-1500');
sectionKontaktHeader.addClass('fadeInUp animated delay-500');
sectionKontaktForm.addClass('fadeInUp animated delay-2000');
sectionSale.waypoint(function () {
sectionSaleHeader.addClass('go');
personItems.addClass('go');
}, {offset: '80%'}
);
$('.about-numbers').waypoint(function () {
sectionAboutNumbers.addClass('go');
}, {offset: '80%'}
);
sectionFeatures.waypoint(function () {
sectionFeaturesHeader.addClass('go');
sectionFeaturesText.addClass('go');
sectionFeaturesLi.addClass('go');
}, {offset: '80%'}
);
sectionMap.waypoint(function () {
sectionMapHeader.addClass('go');
sectionMapImg.addClass('go');
}, {offset: '80%'}
);
sectionWork.waypoint(function () {
sectionWorkHeader.addClass('go');
sectionWorkImg.addClass('go');
}, {offset: '80%'}
);
sectionHow.waypoint(function () {
sectionHowHeader.addClass('go');
sectionHowImg.addClass('go');
}, {offset: '80%'}
);
sectionHelp.waypoint(function () {
sectionHelpHeader.addClass('go');
sectionHelpText.addClass('go');
sectionHelpImg.addClass('go');
}, {offset: '60%'}
);
sectionKontakt.waypoint(function () {
sectionKontaktHeader.addClass('go');
sectionKontaktPerson.addClass('go');
sectionKontaktForm.addClass('go');
}, {offset: '60%'}
);
var featuresDelay = ['delay-250', 'delay-500', 'delay-750', 'delay-1000', 'delay-1250', 'delay-1500'];
var features = $('.section-features');
var featuresItems = $('.section-features .item');
var options = {
useEasing: false,
useGrouping: true,
separator: '',
decimal: ',',
prefix: '',
suffix: ''
};
var effectiveness = new CountUp("featuredEffectiveness", 0, 99.7, 1, 2.5, options);
var minutes = new CountUp("featuredMinutes", 0, 4, 0, 0.1, options);
var hours = new CountUp("featuredHours", 0, 24, 0, 1, options);
var days = new CountUp("featuredDays", 0, 7, 0, 1, options);
var hours2 = new CountUp("featuredHours2", 0, 7, 0, 1, options);
var years = new CountUp("featuredYears", 0, 2, 0, 1, options);
var featuresOffset = 'bottom-in-view';
var width = $(window).width();
if (width < 600) {
featuresOffset = '90%';
}
//console.log(featuresOffset);
featuresItems.addClass('fadeInUp animated');
featuresItems.each(function (index) {
$(this).addClass(featuresDelay[index]);
});
features.waypoint(function () {
featuresItems.addClass('go');
setTimeout(function () {
effectiveness.start();
}, 1100);
setTimeout(function () {
minutes.start();
hours.start();
days.start();
hours2.start();
years.start();
}, 2000);
}, {offset: featuresOffset}
);
var fleet = $('.clients-fleet');
var fleetHeader = fleet.find('.section-header');
var fleetDesc = fleet.find('.text');
var fleetItems = fleet.find('.fleet-list .item');
fleetHeader.addClass('fadeInUp animated delay-500');
fleetDesc.addClass('fadeInUp animated delay-1000');
fleetItems.addClass('fadeInUp animated');
var i = 0;
fleetItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
fleet.waypoint(function () {
fleetHeader.addClass('go');
fleetDesc.addClass('go');
}, {offset: '60%'}
);
fleet.waypoint(function () {
fleetItems.addClass('go');
}, {offset: '40%'}
);
}
var pageFrigo = $('#page-frigo');
if (pageFrigo.length > 0) {
var sectionFeatures = $('.section-features-sales');
var sectionFeaturesHeader = sectionFeatures.find('.section-header');
var sectionFeaturesText = sectionFeatures.find('.txt');
var sectionFeaturesLi = sectionFeatures.find('li');
var sectionMap = $('.section-maps');
var sectionMapHeader = sectionMap.find('.section-header');
var sectionMapImg = sectionMap.find('img');
var sectionWork = $('.section-work');
var sectionWorkHeader = sectionWork.find('.section-header');
var sectionWorkImg = sectionWork.find('img');
var sectionHow = $('.section-how');
var sectionHowHeader = sectionHow.find('.section-header');
var sectionHowImg = sectionHow.find('img');
var sectionHelp = $('.section-help');
var sectionHelpHeader = sectionHelp.find('.section-header');
var sectionHelpImg = sectionHelp.find('img');
var sectionHelpText = sectionHelp.find('.txt');
var sectionKontakt = $('.section-sales-kontakt');
var sectionKontaktHeader = sectionKontakt.find('.section-header');
var sectionKontaktPerson = sectionKontakt.find('.person');
var sectionKontaktForm = sectionKontakt.find('form');
var i = 0;
var baseDelay = 250;
var i = 0;
sectionKontaktPerson.each(function () {
$(this).addClass('animated flipInX delay-' + (1000 + baseDelay * i * 2));
i++;
});
var i = 0;
sectionFeaturesLi.each(function () {
$(this).addClass('fadeInUp animated delay-' + (1000 + baseDelay * i * 2));
i++;
});
sectionFeaturesHeader.addClass('fadeInUp animated delay-500');
sectionFeaturesText.addClass('fadeInUp animated delay-500');
sectionMapHeader.addClass('fadeInUp animated delay-500');
sectionMapImg.addClass('flipInX animated delay-1500');
sectionWorkHeader.addClass('fadeInUp animated delay-500');
sectionWorkImg.addClass('flipInX animated delay-1500');
sectionHowHeader.addClass('fadeInUp animated delay-500');
sectionHowImg.addClass('flipInX animated delay-1500');
sectionHelpHeader.addClass('fadeInUp animated delay-500');
sectionHelpText.addClass('fadeInUp animated delay-1000');
sectionHelpImg.addClass('flipInX animated delay-1500');
sectionKontaktHeader.addClass('fadeInUp animated delay-500');
sectionKontaktForm.addClass('fadeInUp animated delay-2000');
sectionFeatures.waypoint(function () {
sectionFeaturesHeader.addClass('go');
sectionFeaturesText.addClass('go');
sectionFeaturesLi.addClass('go');
}, {offset: '80%'}
);
sectionMap.waypoint(function () {
sectionMapHeader.addClass('go');
sectionMapImg.addClass('go');
}, {offset: '80%'}
);
sectionWork.waypoint(function () {
sectionWorkHeader.addClass('go');
sectionWorkImg.addClass('go');
}, {offset: '80%'}
);
sectionHow.waypoint(function () {
sectionHowHeader.addClass('go');
sectionHowImg.addClass('go');
}, {offset: '80%'}
);
sectionHelp.waypoint(function () {
sectionHelpHeader.addClass('go');
sectionHelpText.addClass('go');
sectionHelpImg.addClass('go');
}, {offset: '60%'}
);
sectionKontakt.waypoint(function () {
sectionKontaktHeader.addClass('go');
sectionKontaktPerson.addClass('go');
sectionKontaktForm.addClass('go');
}, {offset: '60%'}
);
var featuresDelay = ['delay-250', 'delay-500', 'delay-750', 'delay-1000', 'delay-1250', 'delay-1500'];
var features = $('.section-features');
var featuresItems = $('.section-features .item');
var options = {
useEasing: false,
useGrouping: true,
separator: '',
decimal: ',',
prefix: '',
suffix: ''
};
var effectiveness = new CountUp("featuredEffectiveness", 0, 99.7, 1, 2.5, options);
var minutes = new CountUp("featuredMinutes", 0, 4, 0, 0.1, options);
var hours = new CountUp("featuredHours", 0, 24, 0, 1, options);
var days = new CountUp("featuredDays", 0, 7, 0, 1, options);
var hours2 = new CountUp("featuredHours2", 0, 7, 0, 1, options);
var years = new CountUp("featuredYears", 0, 2, 0, 1, options);
var featuresOffset = 'bottom-in-view';
var width = $(window).width();
if (width < 600) {
featuresOffset = '90%';
}
//console.log(featuresOffset);
featuresItems.addClass('fadeInUp animated');
featuresItems.each(function (index) {
$(this).addClass(featuresDelay[index]);
});
features.waypoint(function () {
featuresItems.addClass('go');
setTimeout(function () {
effectiveness.start();
}, 1100);
setTimeout(function () {
minutes.start();
hours.start();
days.start();
hours2.start();
years.start();
}, 2000);
}, {offset: featuresOffset}
);
var fleet = $('.clients-fleet:not(.type-fleet)');
var fleetNew = $('.type-fleet');
var fleetHeader = fleet.find('.section-header');
var fleetNewHeader = fleetNew.find('.section-header');
var fleetDesc = fleet.find('.text');
var fleetNewDesc = fleetNew.find('.text');
var fleetItems = fleet.find('.fleet-list .item');
var fleetNewItems = fleetNew.find('.fleet-list .item');
fleetHeader.addClass('fadeInUp animated delay-500');
fleetNewHeader.addClass('fadeInUp animated delay-500');
fleetDesc.addClass('fadeInUp animated delay-1000');
fleetNewDesc.addClass('fadeInUp animated delay-1000');
fleetItems.addClass('fadeInUp animated');
fleetNewItems.addClass('fadeInUp animated');
var i = 0;
fleetItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
fleet.waypoint(function () {
fleetHeader.addClass('go');
fleetDesc.addClass('go');
}, {offset: '60%'}
);
fleet.waypoint(function () {
fleetItems.addClass('go');
}, {offset: '40%'}
);
var i = 0;
fleetNewItems.each(function () {
$(this).addClass('flipInX delay-' + (500 + baseDelay * i * 2));
i++;
});
fleetNew.waypoint(function () {
fleetNewHeader.addClass('go');
fleetNewDesc.addClass('go');
}, {offset: '60%'}
);
fleetNew.waypoint(function () {
fleetNewItems.addClass('go');
}, {offset: '40%'}
);
var sectionChoose = $('.trade-choose');
var sectionChooseHeader = sectionChoose.find('.section-header');
var sectionChooseLi = sectionChoose.find('.trade-chooseList .item');
sectionChooseHeader.addClass('fadeInUp animated delay-500');
sectionChooseLi.addClass('fadeInUp fast animated');
var base = 500;
var i = 1;
sectionChooseLi.each(function (idx) {
var item = $(this).eq(idx);
$(this).addClass('delay-' + base * i);
i++;
});
sectionChoose.waypoint(function () {
sectionChooseHeader.addClass('go');
}, {offset: '70%'});
sectionChoose.waypoint(function () {
sectionChooseLi.addClass('go');
}, {offset: '50%'});
var sectionFrigo = $('.transport-frigo');
var sectionFrigoHeader = sectionFrigo.find('.section-header');
var sectionFrigoText = sectionFrigo.find('.frigo-text');
var sectionFrigoImg = sectionFrigo.find('.frigo-img');
var sectionFrigoInfo = sectionFrigo.find('.frigo-info');
sectionFrigoHeader.addClass('fadeInUp animated delay-500');
sectionFrigoText.addClass('fadeInUp animated delay-1000');
sectionFrigoImg.addClass('fadeInUp animated delay-1500');
sectionFrigoInfo.addClass('fadeInUp animated delay-2000');
sectionFrigo.waypoint(function () {
sectionFrigoHeader.addClass('go');
sectionFrigoText.addClass('go');
sectionFrigoImg.addClass('go');
sectionFrigoInfo.addClass('go');
}, {offset: '80%'}
);
}
$(function() {
var langContact = {
eng: 'contact',
fr: 'contact-fr',
de: 'kontakt-de',
it: 'contatto'
}
/*
$('.section-slider a.more').click(function(e) {
if ( $(window).width() > 767 ) {
e.preventDefault();
var path = window.location.pathname;
path = path.replace('/','');
window.location.href = __URL__ + ( path !== '' ? langContact[path] : 'kontakt' );
}
});
*/
});
var originData = {
Country: '',
CountryCode: '',
City: '',
PostalCode: '',
Countries: [],
Cities: [],
};
var destinationData = {
Country: '',
CountryCode: '',
City: '',
PostalCode: '',
Countries: [],
Cities: [],
};
var RoutePolylines = "";
function loadCountries(phrase, condition) {
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: "https://localhost:44380/api/v1/country/" + phrase +
"?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-",
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined) {
if (condition == 1) {
originData.Countries = [];
originData.Countries = res;
} else if (condition == 2) {
destinationData.Countries = [];
destinationData.Countries = res;
}
resolve(res);
} else {
reject('empty!');
}
}
});
});
return promise;
}
function loadCountriesWithCity(phrase, condition) {
if (phrase.includes(",")) {
var splitedArr = phrase.split(",");
if (condition == 1) {
splitedArr[0] = splitedArr[0].charAt(0).toUpperCase() + splitedArr[0].slice(1);
originData.Country = splitedArr[0];
} else {
splitedArr[0] = splitedArr[0].charAt(0).toUpperCase() + splitedArr[0].slice(1);
destinationData.Country = splitedArr[0];
}
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: "https://localhost:44380/api/v1/cityps/" + (splitedArr[1] == '' ? 'a' : splitedArr[1]) +
"/" + (condition == 1 ? originData.Code : destinationData.Code)
+ "?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-",
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined) {
if (condition == 1) {
originData.Cities = [];
originData.Cities = res;
renderCitiesOutput(condition);
resolve(originData.Countries);
} else if (condition == 2) {
destinationData.Cities = [];
destinationData.Cities = res;
renderCitiesOutput(condition);
resolve(destinationData.Countries);
}
} else {
reject('empty!');
}
}
});
});
return promise;
} else {
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: "https://localhost:44380/api/v1/country/city/" + phrase +
"?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-",
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined || res != []) {
if (condition == 1) {
originData.Country = phrase;
originData.Code = res[0].Code;
originData.Countries = [];
originData.Countries = preSetCountries(res);
} else if (condition == 2) {
destinationData.Country = phrase;
destinationData.Code = res[0].Code;
destinationData.Countries = [];
destinationData.Countries = preSetCountries(res);
}
resolve(res);
} else {
reject('empty!');
}
}
});
});
return promise;
}
}
function preSetCountries(countries) {
countries.forEach((country) => {
country.Name = country.Name + "," + country.City;
});
return countries;
}
function renderCitiesOutput(condition) {
if (condition == 1) {
for (let i = 0; i < originData.Cities.length; i++) {
originData.Countries[i].Name = '';
originData.Countries[i].Name = originData.Country + "," + originData.Cities[i].Name;
console.log(originData.Countries[i].Name)
console.log(originData.Cities[i].Name)
}
} else {
for (let i = 0; i < destinationData.Cities.length; i++) {
destinationData.Countries[i].Name = '';
destinationData.Countries[i].Name = destinationData.Country + "," + destinationData.Cities[i].Name;
}
}
}
function loadCties(phrase, condition) {
if (phrase.includes(",")) {
var splitedArr = phrase.split(",");
var url = (splitedArr[1].length == 0 ? "https://localhost:44380/api/v1/city/" + splitedArr[0] +
"/" + (condition == 1 ? originData.CountryCode : destinationData.CountryCode) + "?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-" :
"https://localhost:44380/api/v1/postalcode/" + splitedArr[1] +
"/" + (condition == 1 ? originData.CountryCode : destinationData.CountryCode) + "/" +
splitedArr[0] + "?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-");
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: url,
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined) {
resolve(res);
} else {
reject('empty!');
}
}
});
});
return promise;
} else {
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: "https://localhost:44380/api/v1/city/" + phrase +
"/" + (condition == 1 ? originData.CountryCode : destinationData.CountryCode) + "?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-",
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined) {
resolve(res);
} else {
reject('empty!');
}
}
});
});
return promise;
}
}
function getCoutryCode(phrase, array) {
var countrycode = '';
array.forEach(country => {
if (country.Name == phrase) {
countrycode = country.Code;
}
});
return countrycode;
}
function preLoadCountries(array) {
var countries = [];
array.forEach(element => {
countries.push(element.Name);
});
return countries;
}
function preLoadCountriesWithCities(array) {
var countries = [];
console.log(array)
array.forEach(element => {
let coutrycity = element.Name;
countries.push(coutrycity);
});
return countries;
}
function preLoadCities(array) {
var cities = [];
array.forEach(element => {
let citypostalcode = element.Name + "," + element.PostalCode;
cities.push(citypostalcode);
});
return cities;
}
function loadRoute() {
var promise = new Promise(function (resolve, reject) {
$.ajax({
url: "http://10.100.0.5/fastapi/api/v1/pricer/0/" + originData.Country +
"/" + originData.PostalCode +
"/" + originData.City +
"/" + destinationData.Country +
"/" + destinationData.PostalCode +
"/" + destinationData.City +
"/0/0/0/0/0/1500?apikey=kfvlOcydKcwJCZRmfR^9SUaxczZ3KKUeVDQKUbS-",
type: 'GET',
dataType: 'json',
success: function (res) {
if (res != null || res != undefined) {
RoutePolylines = res.polylines;
let price = res.distance * res.customer_median;
let percent = 20 * price / 100;
let totalPrice = price + percent;
$("#price").text(Math.ceil(totalPrice) + "€");
resolve('success!');
} else {
reject('empty!');
}
}
});
});
return promise;
}
function autocompleteForCountry(inp, condition) {
var currentFocus;
inp.addEventListener("input", function (e) {
var a, b, i, arr, val = this.value;
if (val == '') {
closeAllLists();
} else {
loadCountries(val, condition)
.then((result) => {
arr = preLoadCountries(result);
closeAllLists();
if (!val) {
return false;
}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "" + arr[i].substr(0, val.length) + "";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "";
b.addEventListener("click", function (e) {
inp.value = this.getElementsByTagName("input")[0].value;
if (condition == 1) {
originData.Country = inp.value;
originData.CountryCode = getCoutryCode(originData.Country, originData.Countries);
} else {
destinationData.Country = inp.value;
destinationData.CountryCode = getCoutryCode(destinationData.Country, destinationData.Countries);
}
closeAllLists();
});
a.appendChild(b);
}
}
})
.catch((err) => console.log(err));
}
});
inp.addEventListener("keydown", function (e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) {
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}
function autocompleteFoCoruntryWithCity(inp, condition) {
var currentFocus;
inp.addEventListener("input", function (e) {
var a, b, i, arr, val = this.value;
if (val == '') {
closeAllLists();
} else {
loadCountriesWithCity(val, condition)
.then((result) => {
arr = preLoadCountriesWithCities(result);
closeAllLists();
if (!val) {
return false;
}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
console.log(arr)
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "" + arr[i].substr(0, val.length) + "";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "";
b.addEventListener("click", function (e) {
inp.value = this.getElementsByTagName("input")[0].value;
if (inp.value.includes(",")) {
var splitedArr = inp.value.split(",");
if (condition == 1) originData.City = splitedArr[1];
else if (condition == 2) destinationData.City = splitedArr[1];
}
if (condition == 1) {
originData.Country = inp.value;
originData.CountryCode = getCoutryCode(originData.Country, originData.Countries);
} else {
destinationData.Country = inp.value;
destinationData.CountryCode = getCoutryCode(destinationData.Country, destinationData.Countries);
}
closeAllLists();
});
a.appendChild(b);
}
}
})
.catch((err) => console.log(err));
}
});
inp.addEventListener("keydown", function (e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) {
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}
function autocompleteForCity(inp, condition) {
var currentFocus;
inp.addEventListener("input", function (e) {
var a, b, i, arr, val = this.value;
if (val == '') {
closeAllLists();
} else {
loadCties(val, condition)
.then((result) => {
arr = preLoadCities(result);
closeAllLists();
if (!val) {
return false;
}
currentFocus = -1;
a = document.createElement("DIV");
a.setAttribute("id", this.id + "autocomplete-list");
a.setAttribute("class", "autocomplete-items");
this.parentNode.appendChild(a);
for (i = 0; i < arr.length; i++) {
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
b = document.createElement("DIV");
b.innerHTML = "" + arr[i].substr(0, val.length) + "";
b.innerHTML += arr[i].substr(val.length);
b.innerHTML += "";
b.addEventListener("click", function (e) {
inp.value = this.getElementsByTagName("input")[0].value;
if (inp.value.includes(",")) {
var splitedArr = inp.value.split(",");
if (condition == 1) originData.PostalCode = splitedArr[1];
else if (condition == 2) destinationData.PostalCode = splitedArr[1];
}
if (condition == 1) {
originData.City = inp.value;
if ((originData.Country != '' && destinationData.Country != '') &&
(originData.PostalCode != '' && destinationData.PostalCode != '') &&
(originData.City != '' && destinationData.City != '')) {
loadRoute()
.then(() => initMap())
.catch((err) => console.log(err));
}
} else {
destinationData.City = inp.value;
if ((originData.Country != '' && destinationData.Country != '') &&
(originData.PostalCode != '' && destinationData.PostalCode != '') &&
(originData.City != '' && destinationData.City != '')) {
loadRoute()
.then(() => initMap())
.catch((err) => console.log(err));
}
}
closeAllLists();
});
a.appendChild(b);
}
}
})
.catch((err) => console.log(err));
}
});
inp.addEventListener("keydown", function (e) {
var x = document.getElementById(this.id + "autocomplete-list");
if (x) x = x.getElementsByTagName("div");
if (e.keyCode == 40) {
currentFocus++;
addActive(x);
} else if (e.keyCode == 38) {
currentFocus--;
addActive(x);
} else if (e.keyCode == 13) {
e.preventDefault();
if (currentFocus > -1) {
if (x) x[currentFocus].click();
}
}
});
function addActive(x) {
if (!x) return false;
removeActive(x);
if (currentFocus >= x.length) currentFocus = 0;
if (currentFocus < 0) currentFocus = (x.length - 1);
x[currentFocus].classList.add("autocomplete-active");
}
function removeActive(x) {
for (var i = 0; i < x.length; i++) {
x[i].classList.remove("autocomplete-active");
}
}
function closeAllLists(elmnt) {
var x = document.getElementsByClassName("autocomplete-items");
for (var i = 0; i < x.length; i++) {
if (elmnt != x[i] && elmnt != inp) {
x[i].parentNode.removeChild(x[i]);
}
}
}
document.addEventListener("click", function (e) {
closeAllLists(e.target);
});
}