Server : Apache/2.4.18 (Ubuntu) System : Linux canvaswebdesign 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 User : oppastar ( 1041) PHP Version : 7.0.33-0ubuntu0.16.04.15 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, Directory : /var/www/asietex.co.id/public_html/theme/js/ |
Upload File : |
(function(){ "use strict"; // Variables // ========================================================================================= var $html = $('html'), $document = $(document), $window = $(window), i = 0; // Scripts initialize // =================== document.write('<script async defer src="//maps.googleapis.com/maps/api/js?key=AIzaSyAYjhWq7DvCwCiRKotPu9_IXQxupSQbhuo" type="text/javascript"></script>'); $window.on('load', function () { // ================================================================================= // WOW // ================================================================================= if ($html.hasClass('desktop')) { new WOW().init(); } // ================================================================================= // Google Map // ================================================================================= var map = $(".map"); if(map.length){ var mapWrapper = $('#google-map'), latlng = new google.maps.LatLng(mapWrapper.data("x-coord"), mapWrapper.data("y-coord")), styles = [ { "featureType": "water", "elementType": "geometry", "stylers": [ { "color": "#e9e9e9" }, { "lightness": 17 } ] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [ { "color": "#f5f5f5" }, { "lightness": 20 } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" }, { "lightness": 17 } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "color": "#ffffff" }, { "lightness": 29 }, { "weight": 0.2 } ] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [ { "color": "#ffffff" }, { "lightness": 18 } ] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [ { "color": "#ffffff" }, { "lightness": 16 } ] }, { "featureType": "poi", "elementType": "geometry", "stylers": [ { "color": "#f5f5f5" }, { "lightness": 21 } ] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [ { "color": "#dedede" }, { "lightness": 21 } ] }, { "elementType": "labels.text.stroke", "stylers": [ { "visibility": "on" }, { "color": "#ffffff" }, { "lightness": 16 } ] }, { "elementType": "labels.text.fill", "stylers": [ { "saturation": 36 }, { "color": "#333333" }, { "lightness": 40 } ] }, { "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "elementType": "geometry", "stylers": [ { "color": "#f2f2f2" }, { "lightness": 19 } ] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [ { "color": "#fefefe" }, { "lightness": 20 } ] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [ { "color": "#fefefe" }, { "lightness": 17 }, { "weight": 1.2 } ] } ], myOptions = { scrollwheel: false, zoom: 10, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP, disableDefaultUI: false, styles: styles }, map = new google.maps.Map(mapWrapper[0], myOptions), marker = new google.maps.Marker({ position: {lat: mapWrapper.data("x-coord"), lng: mapWrapper.data("y-coord")}, draggable: false, animation: false, map: map, icon: 'img/marker.png' }), infowindow = new google.maps.InfoWindow({ content: mapWrapper.data("text") }); marker.addListener('click', function() { infowindow.open(map, marker); }); } }); $document.ready(function () { // ================================================================================= // Contact Form // ================================================================================= var contactForm = $(".contact-form, .question-form"); if(contactForm.length){ var contactResault = $("body").append("<span class='form-resault'></span>").find(".form-resault"); contactForm.each(function(){ var this_form = $(this); var contactFormInput = this_form.find(".form-control.required"); contactFormInput.on("blur", function(){ if(!$.trim($(this).val())){ $(this).parent().addClass("input-error"); } }); contactFormInput.on("focus", function(){ $(this).parent().removeClass("input-error"); }); this_form.on("submit", function() { var form_data1 = $(this).serialize(); if($(this).hasClass("question-form")){ var url_link = "php/question.php"} if($(this).hasClass("contact-form")){ var url_link = "php/contact.php"} if(!contactFormInput.parent().hasClass("input-error") && contactFormInput.val()){ $.ajax({ type: "POST", url: url_link, data: form_data1, success: function() { contactResault.addClass("correct"); contactResault.html("Your data has been sent!"); setTimeout(function(){ contactResault.removeClass("incorrect").removeClass("correct"); }, 4500); } }); } else{ if(contactFormInput.val() == ""){ var contactFormInputEmpty = contactFormInput.filter(function(){ return $(this).val() == ""; }); contactFormInputEmpty.parent().addClass("input-error"); } contactResault.addClass("incorrect"); contactResault.html("You must fill in all required fields"); setTimeout(function(){ contactResault.removeClass("incorrect").removeClass("correct"); }, 4500); } return false; }); }); } // ================================================================================= // jQuery ajaxChimp // ================================================================================= var chimpForm = $('.subscription-form form'); chimpForm.ajaxChimp({ callback: function(){ var panel = $('.js-result'); setTimeout(function () { panel.removeClass("error").removeClass("success"); }, 4500); }, language: 'cm', url: '//adr.us14.list-manage.com/subscribe/post?u=474217a166648c3e7e0c53b55&id=57bd6ccefc' //XXX.us13.list-manage.com/subscribe/post?u=YYY&id=ZZZ }); $.ajaxChimp.translations.cm = { 'submit': 'Submitting...', 0: 'We have sent you a confirmation email', 1: 'Please enter a value', 2: 'An email address must contain a single @', 3: 'The domain portion of the email address is invalid (the portion after the @: )', 4: 'The username portion of the email address is invalid (the portion before the @: )', 5: 'This email address looks fake or invalid. Please enter a real email address' }; // ================================================================================= // Fancybox // ================================================================================= var fancybox = $(".fancybox"); if(fancybox.length){ fancybox.fancybox({ openEffect: 'elastic', closeEffect: 'elastic' }); } var fancybox_media = $('.fancybox-media'); if(fancybox_media.length){ fancybox_media.fancybox({ openEffect : 'fade', closeEffect : 'fade', helpers : { media : {} } }); } // ================================================================================= // sub Navigation Fixed // ================================================================================= var sub_nav = $(".sub-page .k-nav"); if(sub_nav.length){ var sub_nav_offset = sub_nav.offset().top; } function stuckNav() { if(sub_nav.length){ var scrollTop = $window.scrollTop(); if (scrollTop > sub_nav_offset) { sub_nav.css('top', scrollTop - sub_nav_offset); } else { sub_nav.css('top', '0'); } } } $window.on("scroll", stuckNav); $window.on("resize", stuckNav); // ================================================================================= // Responsive Nav // ================================================================================= var responsiveNav = new Navigation({ init: true, stuck: true, responsive: true, breakpoint: 992, // don't forget to change in css as well }); // ================================================================================= // Countdown // ================================================================================= var countDown = $('.countdown'); if (countDown.length) { countDown.each(function(){ var item = $(this), date = new Date(), settings = [], time = item[0].getAttribute('data-time'), type = item[0].getAttribute('data-type'), format = item[0].getAttribute('data-format'); date.setTime(Date.parse(time)).toLocaleString(); settings[type] = date; settings['format'] = format; item.countdown(settings); }); } // ================================================================================= // UIToTop // ================================================================================= $().UItoTop(); // ================================================================================= // Owl carousel // ================================================================================= var slider_main = $('.slider-main'); if (slider_main.length) { slider_main.owlCarousel({ mouseDrag: false, nav: true, loop: true, autoplay: true, autoplayTimeout: 3500, autoplaySpeed: 1500, autoHeight:true, dots: false, items: 1, }); } $window.on('resize', function (e) { slider_main.find('.owl-height').css('height', slider_main.find('.owl-item.active').height()); }); var owl1 = $('.slider-1'); if (owl1.length) { owl1.owlCarousel({ mouseDrag: false, nav: true, loop: true, autoplay: false, autoplayTimeout: 3500, autoplaySpeed: 1500, autoplayHoverPause: true, dots: false, items: 2, responsiveClass: true, responsive:{ 0:{ items: 1 }, 480:{ items: 1 }, 768:{ items: 2 }, } }); } var owl_blog = $('.slider-blog'); if (owl_blog.length) { owl_blog.owlCarousel({ mouseDrag: false, nav: true, loop: true, autoplay: true, autoplayTimeout: 3000, autoplaySpeed: 1500, dots: false, items: 1, }); } var owl_brand = $('.slider-brand'); if (owl_brand.length) { owl_brand.owlCarousel({ mouseDrag: true, nav: false, loop: true, autoplay: true, autoplayTimeout: 5000, autoplaySpeed: 1500, autoplayHoverPause: true, dots: false, items: 5, margin: 30, responsiveClass: true, responsive:{ 0:{ items: 1 }, 480:{ items: 2 }, 768:{ items: 3 }, 992:{ items: 5 }, } }); } var owl_portfolio_single = $('.slider-portfolio-single'); if (owl_portfolio_single.length) { owl_portfolio_single.owlCarousel({ mouseDrag: false, nav: true, loop: true, animateIn: "fadeIn", animateOut: "fadeOut", autoplay: true, autoplayTimeout: 3000, autoplaySpeed: 1500, dots: false, items: 1, }); } // ================================================================================= // Navigation Search Bar // ================================================================================= var nav_search = $(".nav-search-form"); if(nav_search.length){ $(".search-btn").on("click", function(){ nav_search.toggleClass("open"); nav_search.find("input").trigger("focus"); return false; }); $(".search-close").on("click", function(){ nav_search.removeClass("open"); }); } // ================================================================================= // ISOTOPE // ================================================================================= var isotope = $('.iso'); if (isotope.length) { isotope.each(function() { var $grid = $(this).find('.grid').isotope({ itemSelector: 'article' }); // filter buttons $(this).find('.filters-button-group button').on( 'click', function() { var filterValue = $(this).attr('data-filter'); $grid.isotope({ filter: filterValue }); $window.trigger("resize"); }); $(this).find('.button-group').each( function( i, buttonGroup ) { var $buttonGroup = $(buttonGroup); $buttonGroup.on( 'click', 'button', function() { $buttonGroup.find('.is-checked').removeClass('is-checked'); $(this).addClass('is-checked'); }); }); }); $window.on("load", function() { $('.iso .button-group .button.is-checked').trigger("click"); }); } // ================================================================================= // Style Switcher // ================================================================================= var switcher = $("#style-switcher"); var switcher_toggle = switcher.find(".toggle-switcher"); if (switcher.length){ var body = $("body"); //switcher toggle switcher_toggle.on("click", function(e){ e.preventDefault(); switcher.toggleClass("active"); }); //color toggle var color_stylesheet = $("#colors"); var color_link = $("#style-switcher .colors > li > a"); color_link.each(function(){ var it = $(this); it.on("click", function(){ var color_src = it.attr("data-color-src"); color_stylesheet.attr("href", color_src); return false; }); }); //layout toggle var layouts = $("#layout li"); layouts.on("click", function(){ layouts.removeClass("active"); $(this).addClass("active"); $window.trigger("resize"); if($(this).hasClass("boxed")){ body.addClass("boxed"); } if($(this).hasClass("wide")){ body.removeClass("boxed"); } if($(".iso").length){ $('.iso .button-group .button.is-checked').trigger("click"); } }); //layout bg var layout_link = $("#style-switcher .layout-bg > li > a"); layout_link.each(function(){ var it = $(this); it.on("click", function(){ if(body.hasClass("boxed")){ var layout_src = it.attr("data-bg-src"); body.css("background-image", "url("+layout_src+")"); return false; } }); }); }; // ================================================================================= // Progress Bar // ================================================================================= var progressBar = $(".progress-bar"); if (progressBar.length) { $(document).on("scroll", function () { progressBar.not('.scrolled').each(function () { var position = $(this).offset().top; var item_offset = $window.scrollTop() + $window.height(); if (item_offset > position) { var item = $(this); var start = item.attr("data-valuemin"); var end = item.attr("data-valuenow"); item.css({width: end + '%'}); item.parent().find('.progress-bar-counter') .removeClass("hide") .counter({ start: start, end: end, time: 0.7, step: 50 }); item.addClass('scrolled'); } }); }).trigger("scroll"); } // ================================================================================= // Circular Progress Bars // ================================================================================= var proBar = $(".progr-bar"); if(proBar.length){ proBar.each(function(){ var Bar = this; var pBar = $(this).attr("data-percent") * 0.01; var circle = new ProgressBar.Circle(Bar, { strokeWidth: 5, trailWidth: 5, easing: 'easeInOut', duration: 1400, text: { autoStyleContainer: false }, from: { width: 1 }, to: { width: 5 }, // Set default step function for all animate calls step: function(state, circle) { circle.path.setAttribute('stroke-width', 5); var value = Math.round(circle.value() * 100 ); if (value === 0) { circle.setText(''); } else { circle.setText(value + '%'); } } }); var doOnce; $window.on("scroll", function(){ var Bar_offset = proBar.offset().top; var win_offset = $window.height() + $window.scrollTop(); if(win_offset >= Bar_offset && !doOnce){ doOnce = true; circle.animate(pBar); } }); $window.trigger("scroll"); }); } // ================================================================================= // Accordion // ================================================================================= var accordion = $(".accordion"); if(accordion.length){ accordion.each(function(){ var all_panels = $(this).find('.accordion-inner').hide(); var all_titles = $(this).find('.accordion-title'); $(this).find('.accordion-inner.active').slideDown(); all_titles.on("click", function() { var acc_title = $(this); var acc_inner = acc_title.next(); if(!acc_inner.hasClass('active')){ all_panels.removeClass('active').slideUp(); acc_inner.addClass('active').slideDown(); all_titles.removeClass('active'); acc_title.addClass('active'); } else { all_panels.removeClass('active').slideUp(); all_titles.removeClass('active'); } }); }); } /* var nilai1 = $("a[title]").attr("href"); if (nilai1 == "history-milestone.php") { } */ });/*document ready end*/ })();/*main function end*/