AOS.init({
duration: 800,
easing: 'slide'
});
$(document).ready(function($) {
"use strict";
$(window).stellar({
responsive: false,
parallaxBackgrounds: true,
parallaxElements: true,
horizontalScrolling: false,
hideDistantElements: false,
scrollProperty: 'scroll'
});
// Scrollax
$.Scrollax();
// loader
var loader = function() {
setTimeout(function() {
if($('#ftco-loader').length > 0) {
$('#ftco-loader').removeClass('show');
}
}, 1);
};
loader();
var carousel = function() {
$('.home-slider').owlCarousel({
loop:true,
autoplay: true,
margin:0,
animateOut: 'fadeOut',
animateIn: 'fadeIn',
nav:false,
autoplayHoverPause: false,
items: 1,
dots: true,
navText : ["",""],
responsive:{
0:{
items: 1
},
600:{
items: 1
},
1000:{
items: 1,
}
}
});
$('.carousel-testimony').owlCarousel({
center: true,
autoplay: true,
loop: true,
items:1,
margin: 15,
stagePadding: 0,
nav: false,
navText: ['', ''],
responsive:{
0:{
items: 1
},
600:{
items: 1
},
1000:{
items: 1
}
}
});
$('.carousel-model').owlCarousel({
center: true,
autoplay: true,
loop: true,
items:1,
margin: 15,
stagePadding: 0,
nav: true,
dots: false,
navText: ['', ''],
responsive:{
0:{
items: 1
},
600:{
items: 1
},
1000:{
items: 1
}
}
});
};
carousel();
var fullHeight = function() {
$('.js-fullheight').css('height', $(window).height());
$(window).resize(function(){
$('.js-fullheight').css('height', $(window).height());
});
};
fullHeight();
var burgerMenu = function() {
$('.js-colorlib-nav-toggle').on('click', function(event) {
event.preventDefault();
var $this = $(this);
if( $('body').hasClass('menu-show') ) {
$('body').removeClass('menu-show');
$('#colorlib-main-nav > .js-colorlib-nav-toggle').removeClass('show');
} else {
$('body').addClass('menu-show');
setTimeout(function(){
$('#colorlib-main-nav > .js-colorlib-nav-toggle').addClass('show');
}, 900);
}
})
};
burgerMenu();
var counter = function() {
$('#section-counter').waypoint( function( direction ) {
if( direction === 'down' && !$(this.element).hasClass('ftco-animated') ) {
var comma_separator_number_step = $.animateNumber.numberStepFactories.separator(',')
$('.number').each(function(){
var $this = $(this),
num = $this.data('number');
console.log(num);
$this.animateNumber(
{
number: num,
numberStep: comma_separator_number_step
}, 7000
);
});
}
} , { offset: '95%' } );
}
counter();
var contentWayPoint = function() {
var i = 0;
$('.ftco-animate').waypoint( function( direction ) {
if( direction === 'down' && !$(this.element).hasClass('ftco-animated') ) {
i++;
$(this.element).addClass('item-animate');
setTimeout(function(){
$('body .ftco-animate.item-animate').each(function(k){
var el = $(this);
setTimeout( function () {
var effect = el.data('animate-effect');
if ( effect === 'fadeIn') {
el.addClass('fadeIn ftco-animated');
} else if ( effect === 'fadeInLeft') {
el.addClass('fadeInLeft ftco-animated');
} else if ( effect === 'fadeInRight') {
el.addClass('fadeInRight ftco-animated');
} else {
el.addClass('fadeInUp ftco-animated');
}
el.removeClass('item-animate');
}, k * 50, 'easeInOutExpo' );
});
}, 100);
}
} , { offset: '95%' } );
};
contentWayPoint();
// magnific popup
$('.image-popup').magnificPopup({
type: 'image',
closeOnContentClick: true,
closeBtnInside: false,
fixedContentPos: true,
mainClass: 'mfp-no-margins mfp-with-zoom', // class to remove default margin from left and right side
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
},
image: {
verticalFit: true
},
zoom: {
enabled: true,
duration: 300 // don't foget to change the duration also in CSS
}
});
$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
$('#appointment_date').datepicker({
'format': 'm/d/yyyy',
'autoclose': true
});
$('#appointment_time').timepicker();
});