"use strict"; ScrollReveal({ distance: '100px', duration: 1000, delay: 200 }); // List Services ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(1)', { delay: 200, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(2)', { delay: 300, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(3)', { delay: 400, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(4)', { delay: 500, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(5)', { delay: 600, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(6)', { delay: 700, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(7)', { delay: 500, origin: 'bottom' }); ScrollReveal().reveal('.service-block .list-service .col-12:nth-child(8)', { delay: 900, origin: 'bottom' }); // List Blog ScrollReveal().reveal('.blog-list.style-one .row >div:nth-child(1)', { delay: 200, origin: 'bottom' }); ScrollReveal().reveal('.blog-list.style-one .row >div:nth-child(2)', { delay: 300, origin: 'bottom' }); ScrollReveal().reveal('.blog-list.style-one .row >div:nth-child(3)', { delay: 400, origin: 'bottom' }); ScrollReveal().reveal('.blog-list.style-one .row >div:nth-child(4)', { delay: 500, origin: 'bottom' }); // Home1 - List benefit section Case Studies ScrollReveal().reveal('.benefit-block .list-benefit .row >div:first-child', { delay: 200, origin: 'bottom' }); ScrollReveal().reveal('.benefit-block .list-benefit .row >div:nth-child(2)', { delay: 300, origin: 'bottom' }); ScrollReveal().reveal('.benefit-block .list-benefit .row >div:nth-child(3)', { delay: 400, origin: 'bottom' }); ScrollReveal().reveal('.benefit-block .list-benefit .row >div:last-child', { delay: 500, origin: 'bottom' }); // Home4 - List Pricing ScrollReveal().reveal('.pricing-main .list-pricing .row .col-12:nth-child(1)', { delay: 200, origin: 'bottom' }); ScrollReveal().reveal('.pricing-main .list-pricing .row .col-12:nth-child(2)', { delay: 400, origin: 'bottom' }); ScrollReveal().reveal('.pricing-main .list-pricing .row .col-12:nth-child(3)', { delay: 600, origin: 'bottom' }); // Home5 - Section Project ScrollReveal().reveal('.project-five .project-above .row .col-12:nth-child(1)', { delay: 200, origin: 'left' }); ScrollReveal().reveal('.project-five .project-below .row .col-12:nth-child(2)', { delay: 200, origin: 'right' }); // slider $(".slider-block .slider-main").slick({ dots: true, arrows: true, prevArrow: '.prev-arrow', nextArrow: '.next-arrow', slidesToShow: 1, slidesToScroll: 1, touchThreshold: 100, infinite: false, swipe: true, swipeToSlide: true, autoplay: false, autoplaySpeed: 3000, speed: 800, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, responsive: [{ breakpoint: 576, settings: { arrows: false } }] }); var bars = document.querySelectorAll('.slider-block .slider-main .slick-dots li'); if (bars) { bars.forEach(function (bar) { bar.onclick = function (event) { var images = document.querySelectorAll('.slider-item .bg-img img'); var heading = document.querySelectorAll('.text-content .heading2'); var subHeading = document.querySelectorAll('.text-content .body2'); var button = document.querySelectorAll('.text-content .button-block'); var attributes = event.target.querySelector('button').getAttribute("aria-controls"); images.forEach(function (img) { img.classList.remove("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); }); heading.forEach(function (p) { p.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); }); subHeading.forEach(function (a) { a.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); }); button.forEach(function (h3) { h3.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }); var img = document.querySelector('#' + attributes + ' .bg-img img'); var p = document.querySelector('#' + attributes + ' .text-content .heading2'); var a = document.querySelector('#' + attributes + ' .text-content .body2'); var h3 = document.querySelector('#' + attributes + ' .text-content .button-block'); img.classList.add("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); p.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); a.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); h3.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }; }); } var prevArrow = document.querySelector('.slider-block .prev-arrow'); var nextArrow = document.querySelector('.slider-block .next-arrow'); if (prevArrow) { prevArrow.addEventListener('click', function () { var sliderActive = document.querySelector('.slider-block .slider-main .slick-list .slick-active'); var img = sliderActive.querySelector('.bg-img img'); var heading = sliderActive.querySelector('.text-content .heading2'); var subHeading = sliderActive.querySelector('.text-content .body2'); var button = sliderActive.querySelector('.text-content .button-block'); var images = document.querySelectorAll('.slider-item .bg-img img'); var headings = document.querySelectorAll('.text-content .heading2'); var subHeadings = document.querySelectorAll('.text-content .body2'); var buttons = document.querySelectorAll('.text-content .button-block'); images.forEach(function (img) { img.classList.remove("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); }); headings.forEach(function (p) { p.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); }); subHeadings.forEach(function (a) { a.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); }); buttons.forEach(function (btn) { btn.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }); img.classList.add("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); heading.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); subHeading.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); button.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }); } if (nextArrow) { nextArrow.addEventListener('click', function () { var sliderActive = document.querySelector('.slider-block .slider-main .slick-list .slick-active'); var img = sliderActive.querySelector('.bg-img img'); var heading = sliderActive.querySelector('.text-content .heading2'); var subHeading = sliderActive.querySelector('.text-content .body2'); var button = sliderActive.querySelector('.text-content .button-block'); var images = document.querySelectorAll('.slider-item .bg-img img'); var headings = document.querySelectorAll('.text-content .heading2'); var subHeadings = document.querySelectorAll('.text-content .body2'); var buttons = document.querySelectorAll('.text-content .button-block'); images.forEach(function (img) { img.classList.remove("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); }); headings.forEach(function (p) { p.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); }); subHeadings.forEach(function (a) { a.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); }); buttons.forEach(function (btn) { btn.classList.remove("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }); img.classList.add("animate__animated", "animate__fadeIn", "animate__delay-0-2s"); heading.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-2s"); subHeading.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-5s"); button.classList.add("animate__animated", "animate__fadeInUp", "animate__delay-0-8s"); }); } // remove active homepage 1 function removeActiveHome() { document.querySelector('.header-menu .sub-nav .active').classList.remove('active'); document.querySelector('.header-menu .sub-nav-mobile .active').classList.remove('active'); } // get subpage, remove active in homepage 1 if (document.querySelector('.style-subpage')) { removeActiveHome(); } // our project home2 $(".our-project-block .list-project .row").slick({ dots: true, arrows: false, slidesToShow: 4, slidesToScroll: 1, touchThreshold: 100, swipe: true, swipeToSlide: true, autoplay: true, autoplaySpeed: 3000, speed: 500, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 3, slidesToScroll: 1 } }, { breakpoint: 992, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 576, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); // testimonials home2 $(".testimonials-block .container .list-comment").slick({ dots: true, arrows: false, slidesToShow: 1, slidesToScroll: 1, touchThreshold: 100, swipe: true, swipeToSlide: true, autoplay: false, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false }); // case studies home3 $(".case-studies-block.style-two.style-three .container .row").slick({ dots: false, arrows: false, slidesToShow: 3, slidesToScroll: 1, touchThreshold: 100, swipe: true, swipeToSlide: true, autoplay: false, infinite: false, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 2.5, slidesToScroll: 1 } }, { breakpoint: 992, settings: { slidesToShow: 2.5, slidesToScroll: 1 } }, { breakpoint: 576, settings: { slidesToShow: 1.5, slidesToScroll: 1 } }] }); // testimonials home3 $(".testimonials-three .container .list-comment").slick({ dots: true, arrows: false, slidesToShow: 1, slidesToScroll: 1, touchThreshold: 100, mobileFirst: true, swipe: true, swipeToSlide: true, autoplay: false, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, infinite: true, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 3, slidesToScroll: 1 } }, { breakpoint: 992, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 768, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 576, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 0, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); // testimonials home4 $(".testimonials-four .container .row").slick({ dots: true, arrows: false, slidesToShow: 2, slidesToScroll: 2, touchThreshold: 100, swipe: true, swipeToSlide: true, autoplay: false, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, infinite: true, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 992, settings: { slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 576, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); // our team home4 $(".our-team-block .list-member").slick({ dots: false, arrows: false, slidesToShow: 4, slidesToScroll: 3, touchThreshold: 100, swipe: true, swipeToSlide: true, autoplay: false, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, infinite: true, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 3, slidesToScroll: 1 } }, { breakpoint: 768, settings: { slidesToShow: 2, slidesToScroll: 1 } }, { breakpoint: 576, settings: { slidesToShow: 1, slidesToScroll: 1 } }] }); // testimonials home6 $(".testimonials-six .container>.row").slick({ dots: true, arrows: false, slidesToShow: 1, slidesToScroll: 1, touchThreshold: 100, infinite: true, centerMode: true, autoplay: true, autoplaySpeed: 3000, speed: 1000, pauseOnFocus: false, pauseOnHover: false, pauseOnDotsHover: false, responsive: [{ breakpoint: 1170, settings: { slidesToShow: 1, slidesToScroll: 1 } }, { breakpoint: 1024, settings: { slidesToShow: 1, slidesToScroll: 1, centerMode: false } }, { breakpoint: 768, settings: { slidesToShow: 2, slidesToScroll: 1, centerMode: false } }, { breakpoint: 576, settings: { slidesToShow: 1, slidesToScroll: 1, centerMode: false } }] }); // change active nav var listNav = document.querySelectorAll('.list-nav'); var filterItem = document.querySelectorAll('.item-filter'); if (listNav) { listNav.forEach(function (listNavItem) { listNavItem.onclick = function (selectedItem) { if (selectedItem.target.classList.contains("nav-item")) { // add active class listNavItem.querySelector('.active').classList.remove('active'); selectedItem.target.classList.add('active'); //get data-name value var filterName = selectedItem.target.getAttribute('data-name'); filterItem.forEach(function (item) { if (filterName === item.getAttribute('data-name')) { item.classList.add('show'); item.classList.remove('hide'); } else { item.classList.remove('show'); item.classList.add('hide'); } }); } }; }); } // scroll to top var scrollTopBtn = document.querySelector('.scroll-to-top-btn'); window.addEventListener('scroll', function () { if (window.pageYOffset > 200) { scrollTopBtn.classList.add('active'); } else { scrollTopBtn.classList.remove('active'); } }); // count number if (document.querySelector('.count-block .counter')) { $('.count-block .counter').counterUp({ delay: 6, time: 500 }); } // change active features home3 var listNavItems = document.querySelector('.list-nav-item'); var navItemFeature = document.querySelectorAll('.content-filter'); if (listNavItems) { listNavItems.onclick = function (selectedItem) { if (selectedItem.target.classList.contains("nav-item")) { // add active class listNavItems.querySelector('.active').classList.remove('active'); selectedItem.target.classList.add('active'); //get data-name value var filterName = selectedItem.target.getAttribute('data-name'); navItemFeature.forEach(function (item) { if (filterName === item.getAttribute('data-name')) { item.classList.add('show'); item.classList.remove('hide'); } else { item.classList.remove('show'); item.classList.add('hide'); } }); } }; } // open answer faqs var questionItem = document.querySelectorAll('.question-item'); if (questionItem) { questionItem.forEach(function (item, index) { var titleItem = item.querySelector('.question-item-main'); var icon = item.querySelector('i'); titleItem.addEventListener('click', function () { item.classList.toggle('open'); if (item.classList.contains('open')) { setTimeout(function () { icon.classList.replace('ph-plus', 'ph-minus'); }, 200); } else { setTimeout(function () { icon.classList.replace('ph-minus', 'ph-plus'); }, 200); } removeOpen(index); }); if (item.classList.contains('open')) { icon.classList.replace('ph-plus', 'ph-minus'); } else { icon.classList.replace('ph-minus', 'ph-plus'); } }); } function removeOpen(index1) { questionItem.forEach(function (item2, index2) { if (index1 != index2) { item2.classList.remove('open'); item2.querySelector('i').classList.replace('ph-minus', 'ph-plus'); } }); } // change switch btn pricing var switchBtn = document.querySelector('.switch'); var listPricingMonth = document.querySelector('.list-pricing'); var listPricingYear = document.querySelector('.list-pricing-year'); if (switchBtn) { switchBtn.addEventListener('click', function () { switchBtn.classList.toggle('enable'); var text = switchBtn.parentElement.querySelectorAll('.body3'); text.forEach(function (item) { if (item.classList.contains('text-placehover')) { item.classList.remove('text-placehover'); } else { item.classList.add('text-placehover'); } }); if (switchBtn.classList.contains('enable')) { console.log(switchBtn); listPricingMonth.classList.remove('show'); listPricingMonth.classList.add('hide'); listPricingYear.classList.remove('hide'); listPricingYear.classList.add('show'); } else { if (listPricingYear.classList.contains('show')) { listPricingYear.classList.remove('show'); } listPricingYear.classList.add('hide'); if (listPricingMonth.classList.contains('hide')) { listPricingMonth.classList.remove('hide'); } listPricingMonth.classList.add('show'); } }); } // mobile menu var mobileMenuBtn = document.querySelector('.menu-humburger'); var menuMobile = document.querySelector('#menu-mobile-block'); var menuMobileMain = document.querySelector('#menu-mobile-block .menu-mobile-main'); var closeMobileBtn = document.querySelector('#menu-mobile-block .close-block'); if (mobileMenuBtn) { mobileMenuBtn.addEventListener('click', function () { menuMobile.classList.toggle('open'); }); } var itemLinks = document.querySelectorAll('#menu-mobile-block .nav-item-mobile'); itemLinks.forEach(function (item) { item.addEventListener('click', function () { item.querySelector('.sub-nav-mobile').classList.toggle('open'); }); }); if (closeMobileBtn) { closeMobileBtn.addEventListener('click', function () { menuMobile.classList.remove('open'); }); } if (menuMobile) { menuMobile.addEventListener('click', function () { menuMobile.classList.remove('open'); }); } if (menuMobileMain) { menuMobileMain.addEventListener('click', function (event) { event.stopPropagation(); }); } // Video modal var playBtn = document.querySelector('.ph-play'); var videoModal = document.querySelector('.js-video-modal'); var videoModalContainer = document.querySelector('.js-video-modal-container'); var closeVideo = document.querySelector('.js-modal-close'); var playBtnHome4 = document.querySelector('.video-block .container .video i'); //Show modal video function showVideo() { if (videoModal) { videoModal.classList.add('open'); } } //Close modal video function removeVideoModal() { if (videoModal) { videoModal.classList.remove('open'); } } //Listen click if (playBtn) { playBtn.addEventListener('click', showVideo); } if (playBtnHome4) { playBtnHome4.addEventListener('click', function () { videoModal.classList.add('open'); }); } //Listen click and close modal video if (closeVideo) { closeVideo.addEventListener('click', removeVideoModal); } //Listen click outside modal-container and close modal video if (videoModal) { videoModal.addEventListener('click', removeVideoModal); } if (videoModalContainer) { videoModalContainer.addEventListener('click', function (event) { event.stopPropagation(); }); }