Server : Apache System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64 User : nobody ( 99) PHP Version : 8.1.23 Disable Function : NONE Directory : /home/dnlcambodia/public_html/assets/js/ |
(function($) { "use strict"; //Update Header Style and Scroll to Top function headerStyle() { if($('.ft1-main-header').length){ var windowpos = $(window).scrollTop(); var siteHeader = $('.ft1-main-header'); var scrollLink = $('.scroll-to-top'); var HeaderHight = $('.ft1-main-header').height(); if (windowpos >= HeaderHight) { siteHeader.addClass('fixed-header'); scrollLink.fadeIn(300); } else { siteHeader.removeClass('fixed-header'); scrollLink.fadeOut(300); } } } headerStyle(); //Submenu Dropdown Toggle if($('.ft1-main-header .navigation li.dropdown').length){ $('.ft1-main-header .navigation li.dropdown').append('<div class="dropdown-btn"><span class="fa fa-angle-down"></span></div>'); //Dropdown Button $('.ft1-main-header li.dropdown .dropdown-btn').on('click', function() { $(this).prev('ul').slideToggle(500); }); //Megamenu Toggle $('.ft1-main-header .main-menu li.dropdown .dropdown-btn').on('click', function() { $(this).prev('.mega-menu').slideToggle(500); }); //Disable dropdown parent link $('.ft1-main-header .navigation li.dropdown > a,.hidden-bar .side-menu li.dropdown > a').on('click', function(e) { e.preventDefault(); }); } //Mobile Nav Hide Show if($('.mobile-menu').length){ $('.mobile-menu .menu-box').mCustomScrollbar(); var mobileMenuContent = $('.ft1-main-header .nav-outer .main-menu').html(); $('.mobile-menu .menu-box .menu-outer').append(mobileMenuContent); $('.sticky-header .main-menu').append(mobileMenuContent); //Dropdown Button $('.mobile-menu li.dropdown .dropdown-btn').on('click', function() { $(this).toggleClass('open'); $(this).prev('ul').slideToggle(500); }); //Menu Toggle Btn $('.mobile-nav-toggler').on('click', function() { $('body').addClass('mobile-menu-visible'); }); //Menu Toggle Btn $('.mobile-menu .menu-backdrop,.mobile-menu .close-btn').on('click', function() { $('body').removeClass('mobile-menu-visible'); }); } //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}); } //Jquery Knob animation if($('.dial').length){ $('.dial').appear(function(){ var elm = $(this); var color = elm.attr('data-fgColor'); var perc = elm.attr('value'); var thickness = elm.attr('thickness'); elm.knob({ 'value': 0, 'min':0, 'max':100, 'skin':'tron', 'readOnly':true, 'thickness':thickness, 'dynamicDraw': true, 'thickness':0.16, 'displayInput':false }); $({value: 0}).animate({ value: perc }, { duration: 3500, easing: 'swing', progress: function () { elm.val(Math.ceil(this.value)).trigger('change'); } }); },{accY: 0}); } //Progress Bar if($('.progress-line').length){ $('.progress-line').appear(function(){ var el = $(this); var percent = el.data('width'); $(el).css('width',percent+'%'); },{accY: 0}); } //Parallax Scene for Icons if($('.parallax-scene-1').length){ var scene = $('.parallax-scene-1').get(0); var parallaxInstance = new Parallax(scene); } if($('.parallax-scene-2').length){ var scene = $('.parallax-scene-2').get(0); var parallaxInstance = new Parallax(scene); } if($('.parallax-scene-3').length){ var scene = $('.parallax-scene-3').get(0); var parallaxInstance = new Parallax(scene); } if($('.parallax-scene-4').length){ var scene = $('.parallax-scene-4').get(0); var parallaxInstance = new Parallax(scene); } if($('.paroller').length){ $('.paroller').paroller({ factor: 0.2, // multiplier for scrolling speed and offset, +- values for direction control factorLg: 0.4, // multiplier for scrolling speed and offset if window width is less than 1200px, +- values for direction control type: 'foreground', // background, foreground direction: 'horizontal' // vertical, horizontal }); } //Custom Seclect Box if($('.custom-select-box').length){ $('.custom-select-box').selectmenu().selectmenu('menuWidget').addClass('overflow'); } //Header Search if($('.search-box-outer').length) { $('.search-box-outer').on('click', function() { $('body').addClass('search-active'); }); $('.close-search').on('click', function() { $('body').removeClass('search-active'); }); } //Main Slider Carousel if ($('.banner-carousel').length) { $('.banner-carousel').owlCarousel({ animateOut: 'fadeOut', animateIn: 'slideInUp', loop:true, margin:0, nav:true, //autoHeight: true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="flaticon-left-arrow"></span>', '<span class="flaticon-right-arrow"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1200:{ items:1 } } }); } // Single Item Carousel if ($('.single-item-carousel').length) { $('.single-item-carousel').owlCarousel({ //animateOut: 'fadeOut', //animateIn: 'fadeIn', loop:true, margin:0, nav:true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1200:{ items:1 } } }); } // Services Carousel if ($('.services-carousel').length) { $('.services-carousel').owlCarousel({ //animateOut: 'fadeOut', //animateIn: 'fadeIn', loop:true, center:true, margin:30, nav:true, //autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1200:{ items:1 } } }); } //Product Tabs if($('.service-tab').length){ $('.service-tab .product-tab-btns .p-tab-btn').on('click', function(e) { e.preventDefault(); var target = $($(this).attr('data-tab')); if ($(target).hasClass('actve-tab')){ return false; }else{ $('.service-tab .product-tab-btns .p-tab-btn').removeClass('active-btn'); $(this).addClass('active-btn'); $('.service-tab .p-tabs-content .p-tab').removeClass('active-tab'); $(target).addClass('active-tab'); } }); } // Service Carousel if ($('.service-carousel').length) { $('.service-carousel').owlCarousel({ loop:true, margin:0, nav:true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1200:{ items:1 } } }); } // Testimonial Carousel if ($('.testimonial-carousel').length) { $('.testimonial-carousel').owlCarousel({ loop:true, margin:30, nav:true, //autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 500:{ items:1 }, 600:{ items:1 }, 800:{ items:2 }, 1024:{ items:3 }, 1200:{ items:3 } } }); } // Service Carousel Two if ($('.service-carousel-two').length) { $('.service-carousel-two').owlCarousel({ loop:true, margin:20, nav:true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:2 }, 1024:{ items:2 }, 1200:{ items:2 } } }); } // Team Carousel if ($('.team-carousel').length) { $('.team-carousel').owlCarousel({ loop:true, margin:30, nav:true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 800:{ items:2 }, 1024:{ items:3 }, 1200:{ items:4 } } }); } // Team Carousel Two if ($('.team-carousel-two').length) { $('.team-carousel-two').owlCarousel({ loop:true, margin:0, nav:true, autoplayHoverPause: true, // Stops autoplay smartSpeed: 500, autoplay: 6000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 800:{ items:2 }, 1024:{ items:3 }, 1200:{ items:4 } } }); } // Product Carousel if ($('.project-carousel').length) { $('.project-carousel').owlCarousel({ loop:true, margin:0, nav:true, center:true, smartSpeed: 700, autoplay: 5000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:2 }, 800:{ items:2 }, 1024:{ items:3 }, 1200:{ items:3 }, 1400:{ items:3 }, 1600:{ items:3 } } }); } // Product Carousel Two if ($('.project-carousel-two').length) { $('.project-carousel-two').owlCarousel({ loop:true, margin:0, nav:true, center:true, smartSpeed: 700, autoplay: 5000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 600:{ items:1 }, 800:{ items:1 }, 1024:{ items:1 }, 1200:{ items:1 }, 1400:{ items:1 }, 1600:{ items:1 } } }); } //Masonary function enableMasonry() { if($('.masonry-items-container').length){ var winDow = $(window); // Needed variables var $container=$('.masonry-items-container'); $container.isotope({ itemSelector: '.masonry-item', masonry: { columnWidth : '.masonry-item.col-lg-3' }, animationOptions:{ duration:500, easing:'linear' } }); winDow.bind('resize', function(){ $container.isotope({ itemSelector: '.masonry-item', animationOptions: { duration: 500, easing : 'linear', queue : false } }); }); } } enableMasonry(); //Product Tabs if($('.project-tab').length){ $('.project-tab .project-tab-btns .p-tab-btn').on('click', function(e) { e.preventDefault(); var target = $($(this).attr('data-tab')); if ($(target).hasClass('actve-tab')){ return false; }else{ $('.project-tab .project-tab-btns .p-tab-btn').removeClass('active-btn'); $(this).addClass('active-btn'); $('.project-tab .p-tabs-content .p-tab').removeClass('active-tab'); $(target).addClass('active-tab'); } }); } //Tabs Box if($('.tabs-box').length){ $('.tabs-box .tab-buttons .tab-btn').on('click', function(e) { e.preventDefault(); var target = $($(this).attr('data-tab')); if ($(target).is(':visible')){ return false; }else{ target.parents('.tabs-box').find('.tab-buttons').find('.tab-btn').removeClass('active-btn'); $(this).addClass('active-btn'); target.parents('.tabs-box').find('.tabs-content').find('.tab').fadeOut(0); target.parents('.tabs-box').find('.tabs-content').find('.tab').removeClass('active-tab'); $(target).fadeIn(300); $(target).addClass('active-tab'); } }); } // Product Carousel Slider if ($('.ft3-main-slider-two .image-carousel').length && $('.ft3-main-slider-two .thumbs-carousel').length) { var $sync1 = $(".ft3-main-slider-two .image-carousel"), $sync2 = $(".ft3-main-slider-two .thumbs-carousel"), flag = false, duration = 500; $sync1 .owlCarousel({ loop:true, items: 1, margin: 0, nav: true, navText: [ '<span class="icon fa fa-angle-left"></span>', '<span class="icon fa fa-angle-right"></span>' ], dots: false, autoplay: true, autoplayTimeout: 5000 }) .on('changed.owl.carousel', function (e) { if (!flag) { flag = false; $sync2.trigger('to.owl.carousel', [e.item.index, duration, true]); flag = false; } }); $sync2 .owlCarousel({ loop:true, margin: 0, items: 1, nav: false, navText: [ '<span class="icon fa fa-angle-left"></span>', '<span class="icon fa fa-angle-right"></span>' ], dots: false, center: false, autoplay: true, autoplayTimeout: 5000, responsive: { 0:{ items:1, autoWidth: false }, 400:{ items:2, autoWidth: false }, 600:{ items:3, autoWidth: false }, 900:{ items:4, autoWidth: false }, 1400:{ items:4, autoWidth: false }, 1600:{ items:5, autoWidth: false } }, }) .on('click', '.owl-item', function () { $sync1.trigger('to.owl.carousel', [$(this).index(), duration, true]); }) .on('changed.owl.carousel', function (e) { if (!flag) { flag = true; $sync1.trigger('to.owl.carousel', [e.item.index, duration, true]); flag = false; } }); } // Sponsors Item Carousel if ($('.sponsors-carousel').length) { $('.sponsors-carousel').owlCarousel({ loop:true, margin:30, nav:true, smartSpeed: 500, autoplay: 4000, navText: [ '<span class="fa fa-angle-left"></span>', '<span class="fa fa-angle-right"></span>' ], responsive:{ 0:{ items:1 }, 480:{ items:2 }, 600:{ items:3 }, 800:{ items:4 }, 1024:{ items:4 } } }); } //Gallery Filters if($('.filter-list').length){ $('.filter-list').mixItUp({}); } //LightBox / Fancybox if($('.lightbox-image').length) { $('.lightbox-image').fancybox({ openEffect : 'fade', closeEffect : 'fade', helpers : { media : {} } }); } // Scroll to a Specific Div if($('.scroll-to-target').length){ $(".scroll-to-target").on('click', function() { var target = $(this).attr('data-target'); // animate $('html, body').animate({ scrollTop: $(target).offset().top }, 1500); }); } // Elements Animation if($('.wow').length){ var wow = new WOW( { boxClass: 'wow', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true // act on asynchronously loaded content (default is true) } ); wow.init(); } /* ========================================================================== When document is Scrollig, do ========================================================================== */ $(window).on('scroll', function() { headerStyle(); }); /* ========================================================================== When document is loading, do ========================================================================== */ $(window).on('load', function() { enableMasonry(); }); })(window.jQuery);