(function ($) { "use strict"; /*-------------------------------------------------------------- RegisterPlugin, ScrollTrigger, SplitText --------------------------------------------------------------*/ gsap.registerPlugin(ScrollTrigger, SplitText); gsap.config({ nullTargetWarn: false, trialWarn: false }); /*-------------------------------------------------------------- FullHeight --------------------------------------------------------------*/ function fullHeight() { $('.full-height').css("height", $(window).height()); } // Price Filter function priceFilter() { if ($(".price-ranger").length) { $(".price-ranger #slider-range").slider({ range: true, min: 50, max: 500, values: [11, 300], slide: function (event, ui) { $(".price-ranger .ranger-min-max-block .min").val( "$" + ui.values[0] ); $(".price-ranger .ranger-min-max-block .max").val( "$" + ui.values[1] ); }, }); $(".price-ranger .ranger-min-max-block .min").val( "$" + $(".price-ranger #slider-range").slider("values", 0) ); $(".price-ranger .ranger-min-max-block .max").val( "$" + $(".price-ranger #slider-range").slider("values", 1) ); } } $(".add").on("click", function () { if ($(this).prev().val() < 999) { $(this) .prev() .val(+$(this).prev().val() + 1); } }); $(".sub").on("click", function () { if ($(this).next().val() > 1) { if ($(this).next().val() > 1) $(this) .next() .val(+$(this).next().val() - 1); } }); // ===Checkout Payment=== if ($(".checkout__payment__title").length) { $(".checkout__payment__item").find('.checkout__payment__content').hide(); $(".checkout__payment__item--active").find('.checkout__payment__content').show(); $(".checkout__payment__title").on("click", function (e) { e.preventDefault(); $(this).parents('.checkout__payment').find('.checkout__payment__item').removeClass("checkout__payment__item--active"); $(this).parents(".checkout__payment").find(".checkout__payment__content").slideUp(); $(this).parent().addClass("checkout__payment__item--active"); $(this).parent().find(".checkout__payment__content").slideDown(); }) } //Main Slider if ($(".main-slider__carousel").length) { $(".main-slider__carousel").owlCarousel({ loop: true, animateOut: "fadeOut", animateIn: "fadeIn", margin: 0, nav: true, dots: false, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 600: { items: 1, }, 800: { items: 1, }, 992: { items: 1, }, }, }); } //Main Slider Two if ($(".main-slider-two__carousel").length) { $(".main-slider-two__carousel").owlCarousel({ loop: true, animateOut: "fadeOut", animateIn: "fadeIn", margin: 0, nav: true, dots: false, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 600: { items: 1, }, 800: { items: 1, }, 992: { items: 1, }, }, }); } //Main Slider Three if ($(".main-slider-three__carousel").length) { $(".main-slider-three__carousel").owlCarousel({ loop: true, animateOut: "fadeOut", animateIn: "fadeIn", margin: 0, nav: true, dots: false, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 600: { items: 1, }, 800: { items: 1, }, 992: { items: 1, }, }, }); } //Testimonial One Carousel if ($(".testimonial-one__carousel").length) { $(".testimonial-one__carousel").owlCarousel({ loop: true, margin: 30, nav: false, dots: false, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 768: { items: 1, }, 992: { items: 1, }, 1200: { items: 1, }, 1320: { items: 1, }, }, }); } //Blog Page Carousel if ($(".blog-carousel-style").length) { $(".blog-carousel-style").owlCarousel({ loop: true, margin: 30, nav: false, dots: true, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, 1200: { items: 3, }, 1320: { items: 3, }, }, }); } //Donation Page Carousel if ($(".donation-carousel-style").length) { $(".donation-carousel-style").owlCarousel({ loop: true, margin: 30, nav: false, dots: true, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, 1200: { items: 3, }, 1320: { items: 3, }, }, }); } //Donation Page Carousel if ($(".events-carousel-style").length) { $(".events-carousel-style").owlCarousel({ loop: true, margin: 30, nav: false, dots: true, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, 1200: { items: 3, }, 1320: { items: 3, }, }, }); } //Volunteer Page Carousel if ($(".volunteer-carousel-style").length) { $(".volunteer-carousel-style").owlCarousel({ loop: true, margin: 30, nav: false, dots: true, smartSpeed: 500, autoplay: true, autoplayTimeout: 7000, navText: [ '', '', ], responsive: { 0: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, 1200: { items: 3, }, 1320: { items: 3, }, }, }); } // Banner Slider //Home One if ($(".banner-slider").length > 0) { var bannerSlider = new Swiper('.banner-slider', { spaceBetween: 0, slidesPerView: 1, mousewheel: false, height: 500, grabCursor: true, loop: true, speed: 1400, autoplay: { delay: 10000, }, pagination: { el: '.swiper-pagination', type: 'progressbar', }, navigation: { prevEl: '.banner-slider-button-prev', nextEl: '.banner-slider-button-next', }, }); bannerSlider.on('slideChange', function () { var csli = bannerSlider.realIndex + 1, curnum = $('#current'); TweenMax.to(curnum, 0.2, { force3D: true, y: -10, opacity: 0, ease: Power2.easeOut, onComplete: function () { TweenMax.to(curnum, 0.1, { force3D: true, y: 10 }); curnum.html('0' + csli); } }); TweenMax.to(curnum, 0.2, { force3D: true, y: 0, delay: 0.3, opacity: 1, ease: Power2.easeOut }); }); var totalSlides = bannerSlider.slides.length - 2; $('#total').html('0' + totalSlides); } // custom coursor if ($(".custom-cursor").length) { var cursor = document.querySelector('.custom-cursor__cursor'); var cursorinner = document.querySelector('.custom-cursor__cursor-two'); var a = document.querySelectorAll('a'); document.addEventListener('mousemove', function (e) { var x = e.clientX; var y = e.clientY; cursor.style.transform = `translate3d(calc(${e.clientX}px - 50%), calc(${e.clientY}px - 50%), 0)` }); document.addEventListener('mousemove', function (e) { var x = e.clientX; var y = e.clientY; cursorinner.style.left = x + 'px'; cursorinner.style.top = y + 'px'; }); document.addEventListener('mousedown', function () { cursor.classList.add('click'); cursorinner.classList.add('custom-cursor__innerhover') }); document.addEventListener('mouseup', function () { cursor.classList.remove('click') cursorinner.classList.remove('custom-cursor__innerhover') }); a.forEach(item => { item.addEventListener('mouseover', () => { cursor.classList.add('custom-cursor__hover'); }); item.addEventListener('mouseleave', () => { cursor.classList.remove('custom-cursor__hover'); }); }) } // Add payment amount area start here *** $(document).on("click", ".amount-btn", function () { $(".amount-btn").removeClass("active"); $(this).addClass("active"); let buttonValue = $(this).text(); $(".addAmount-value").val(buttonValue); }); //Progress Count Bar if ($(".count-bar").length) { $(".count-bar").appear( function () { var el = $(this); var percent = el.data("percent"); $(el).css("width", percent).addClass("counted"); }, { accY: -50 } ); } //Fact Counter + Text Count if ($(".count-box").length) { $(".count-box").appear( function () { var $t = $(this), n = $t.find(".count-text").attr("data-stop"), r = parseInt($t.find(".count-text").attr("data-speed"), 10); if (!$t.hasClass("counted")) { $t.addClass("counted"); $({ countNum: $t.find(".count-text").text() }).animate({ countNum: n }, { duration: r, easing: "linear", step: function () { $t.find(".count-text").text(Math.floor(this.countNum)); }, complete: function () { $t.find(".count-text").text(this.countNum); } }); } }, { accY: 0 } ); } // Accrodion if ($(".accrodion-grp").length) { var accrodionGrp = $(".accrodion-grp"); accrodionGrp.each(function () { var accrodionName = $(this).data("grp-name"); var Self = $(this); var accordion = Self.find(".accrodion"); Self.addClass(accrodionName); Self.find(".accrodion .accrodion-content").hide(); Self.find(".accrodion.active").find(".accrodion-content").show(); accordion.each(function () { $(this) .find(".accrodion-title") .on("click", function () { if ($(this).parent().hasClass("active") === false) { $(".accrodion-grp." + accrodionName) .find(".accrodion") .removeClass("active"); $(".accrodion-grp." + accrodionName) .find(".accrodion") .find(".accrodion-content") .slideUp(); $(this).parent().addClass("active"); $(this).parent().find(".accrodion-content").slideDown(); } }); }); }); } if ($(".contact-form-validated").length) { $(".contact-form-validated").each(function () { let self = $(this); self.validate({ // initialize the plugin rules: { name: { required: true }, email: { required: true, email: true }, message: { required: true }, subject: { required: true } }, submitHandler: function (form) { // sending value with ajax request $.post( $(form).attr("action"), $(form).serialize(), function (response) { $(form).parent().find(".result").append(response); $(form).find('input[type="text"]').val(""); $(form).find('input[type="email"]').val(""); $(form).find("textarea").val(""); } ); return false; } }); }); } // mailchimp form if ($(".mc-form").length) { $(".mc-form").each(function () { var Self = $(this); var mcURL = Self.data("url"); var mcResp = Self.parent().find(".mc-form__response"); Self.ajaxChimp({ url: mcURL, callback: function (resp) { // appending response mcResp.append(function () { return '
"; }); // making things based on response if (resp.result === "success") { // Do stuff Self.removeClass("errored").addClass("successed"); mcResp.removeClass("errored").addClass("successed"); Self.find("input").val(""); mcResp.find("p").fadeOut(10000); } if (resp.result === "error") { Self.removeClass("successed").addClass("errored"); mcResp.removeClass("successed").addClass("errored"); Self.find("input").val(""); mcResp.find("p").fadeOut(10000); } } }); }); } if ($(".video-popup").length) { $(".video-popup").magnificPopup({ type: "iframe", mainClass: "mfp-fade", removalDelay: 160, preloader: true, fixedContentPos: false }); } if ($(".img-popup").length) { var groups = {}; $(".img-popup").each(function () { var id = parseInt($(this).attr("data-group"), 10); if (!groups[id]) { groups[id] = []; } groups[id].push(this); }); $.each(groups, function () { $(this).magnificPopup({ type: "image", closeOnContentClick: true, closeBtnInside: false, gallery: { enabled: true } }); }); } //=== CountDownTimer=== if ($('.coming-soon-countdown').length) { $('.coming-soon-countdown').each(function () { var Self = $(this); var countDate = Self.data('countdown-time'); // getting date Self.countdown(countDate, function (event) { $(this).html('