(function($){
"use strict";
/*
-----------------------------------------------------
Header Sticky
-----------------------------------------------------
*/
$(window).on('scroll',function() {
if ($(this).scrollTop() > 120){
$('.navbar-area').addClass("sticky");
}
else{
$('.navbar-area').removeClass("sticky");
}
});
/*
-----------------------------------------------------
Hover Button Effect
-----------------------------------------------------
*/
let toolTip = document.getElementById('tooltip');
if (toolTip) {
window.addEventListener('mousemove', toolTipXY);
}
function toolTipXY(e) {
let x = e.clientX,
y = e.clientY;
if (toolTip) {
toolTip.style.top = (y + 0) + 'px';
toolTip.style.left = (x + 0) + 'px';
}
}
/*
-----------------------------------------------------
Team Slides
-----------------------------------------------------
*/
$('.team-card').owlCarousel({
nav: true,
loop: true,
dots: false,
margin: 10,
autoplay: true,
autoplayHoverPause: true,
navText: [
"",
""
],
responsive: {
0: {
items: 1
},
576: {
items: 2
},
768: {
items: 1
},
992: {
items: 3
},
1200: {
items: 2
}
}
});
/*
-----------------------------------------------------
developes Slides
-----------------------------------------------------
*/
$('.developes-card').owlCarousel({
nav: false,
loop: true,
dots: false,
margin: 10,
autoplay: true,
autoplayHoverPause: true,
navText: [
"",
""
],
responsive: {
0: {
items: 1
},
576: {
items: 2
},
768: {
items: 2
},
992: {
items: 3
},
1200: {
items: 3
}
}
});
/*
-----------------------------------------------------
Testimonial Slides
-----------------------------------------------------
*/
$('.testimonial-content').owlCarousel({
nav: true,
loop: true,
dots: false,
margin: 20,
autoplay: true,
autoplayHoverPause: true,
smartSpeed:1000,
navText: [
"",
""
],
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 3
}
}
});
/*
-----------------------------------------------------
Workflow Slides
-----------------------------------------------------
*/
$('.workflow-wrapper').owlCarousel({
nav: false,
loop: true,
dots: false,
margin: 20,
autoplay: true,
autoplayHoverPause: true,
smartSpeed:1000,
responsive: {
0: {
items: 1
},
576: {
items: 1
},
768: {
items: 2
},
992: {
items: 2
},
1200: {
items: 2
}
}
});
/*
-----------------------------------------------------
Testimonial Slides 2
-----------------------------------------------------
*/
$('.testimonial-content-2').owlCarousel({
nav: false,
loop: true,
dots: true,
margin: 20,
autoplay: true,
autoplayHoverPause: true,
smartSpeed:1000,
responsive: {
0: {
items: 1
},
576: {
items: 2
},
768: {
items: 1
},
992: {
items: 1
},
1200: {
items: 2
}
}
});
/*
-----------------------------------------------------
Popup Image
-----------------------------------------------------
*/
$('.popup-btn').magnificPopup({
type: 'image',
gallery:{
enabled:true
}
});
/*
-----------------------------------------------------
Counter Js
-----------------------------------------------------
*/
if ("IntersectionObserver" in window) {
let counterObserver = new IntersectionObserver(function (entries, observer) {
entries.forEach(function (entry) {
if (entry.isIntersecting) {
let counter = entry.target;
let target = parseInt(counter.innerText);
let step = target / 200;
let current = 0;
let timer = setInterval(function () {
current += step;
counter.innerText = Math.floor(current);
if (parseInt(counter.innerText) >= target) {
clearInterval(timer);
}
}, 10);
counterObserver.unobserve(counter);
}
});
});
let counters = document.querySelectorAll(".counter-num");
counters.forEach(function (counter) {
counterObserver.observe(counter);
});
}
/*
-----------------------------------------------------
Gallery MixItUp
-----------------------------------------------------
*/
$(function () {
var filterList = {
init: function () {
$('.item-grid').mixItUp({
selectors: {
target: '.item',
filter: '.filter'
},
load: {
filter: 'all'
}
});
}
};
filterList.init();
});
/*
-----------------------------------------------------
Popup Video
-----------------------------------------------------
*/
$('.popup-youtube').magnificPopup({
disableOn: 320,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
/*
-----------------------------------------------------
Input Plus & Minus Number JS
-----------------------------------------------------
*/
$('.input-counter').each(function() {
var spinner = jQuery(this),
input = spinner.find('input[type="text"]'),
btnUp = spinner.find('.plus-btn'),
btnDown = spinner.find('.minus-btn'),
min = input.attr('min'),
max = input.attr('max');
btnUp.on('click', function() {
var oldValue = parseFloat(input.val());
if (oldValue >= max) {
var newVal = oldValue;
} else {
var newVal = oldValue + 1;
}
spinner.find("input").val(newVal);
spinner.find("input").trigger("change");
});
btnDown.on('click', function() {
var oldValue = parseFloat(input.val());
if (oldValue <= min) {
var newVal = oldValue;
} else {
var newVal = oldValue - 1;
}
spinner.find("input").val(newVal);
spinner.find("input").trigger("change");
});
});
/*
-----------------------------------------------------
Meetai Testimonial
-----------------------------------------------------
*/
$('.aithm-testimonial-navigator').owlCarousel({
loop: true,
nav: true,
dots: false,
autoplayHoverPause: true,
autoplay: true,
items: 1,
navText: [
"",
""
]
});
/*
-----------------------------------------------------
Faq Section
-----------------------------------------------------
*/
const faqItems = document.querySelectorAll('.faq-item');
faqItems.forEach(item => {
const question = item.querySelector('.faq-question');
const answer = item.nextElementSibling;
const icon = item.querySelector('i');
item.addEventListener('click', () => {
faqItems.forEach(otherItem => {
if (otherItem !== item) {
const otherAnswer = otherItem.nextElementSibling;
const otherIcon = otherItem.querySelector('i');
otherAnswer.classList.remove('active');
otherIcon.classList.remove('active');
otherAnswer.style.maxHeight = "0";
}
});
answer.classList.toggle('active');
icon.classList.toggle('active');
if (answer.classList.contains('active')) {
answer.style.maxHeight = answer.scrollHeight + "px";
} else {
answer.style.maxHeight = "0";
}
});
});
/*
-----------------------------------------------------
Aos Animation
-----------------------------------------------------
*/
AOS.init({
once: true,
offset: 200,
duration: 2000,
});
/*
-----------------------------------------------------
Go to Top
-----------------------------------------------------
*/
$(function(){
// Scroll Event
$(window).on('scroll', function(){
var scrolled = $(window).scrollTop();
if (scrolled > 600) $('.go-top').addClass('active');
if (scrolled < 600) $('.go-top').removeClass('active');
});
// Click Event
$('.go-top').on('click', function() {
$("html, body").animate({ scrollTop: "0" }, 500);
});
});
/*
-----------------------------------------------------
Nice Select
-----------------------------------------------------
*/
$('select').niceSelect();
}(jQuery));