(function($) { 'use strict'; //========================= // About carowsel //========================= if ($('.aboutCarowsel').length > 0) { $('.aboutCarowsel').owlCarousel({ items: 1, singleItem: true }); } //========================= // About carowsel //========================= if ($('.testCaro').length > 0) { $('.testCaro').owlCarousel({ items: 1, navigation: true, navigationText: ["", ""], singleItem: true }); } //========================= // Client carowsel //========================= if ($('.clientCaro').length > 0) { $('.clientCaro').owlCarousel({ items: 4, pagination: false }); } //========================= // Client carowsel About Page //========================= if ($('.clientCaroAbout').length > 0) { $('.clientCaroAbout').owlCarousel({ items: 4 }); } //========================= //Filter carowsel home2 //========================= if ($('.filterContent.filterCaro').length > 0) { $('.filterContent.filterCaro').owlCarousel({ items: 4 }); } //========================= //Blog carowsel home2 //========================= if ($('.blogTwowrap').length > 0) { $('.blogTwowrap').owlCarousel({ items: 5 }); } //========================= //Blog carowsel home3 //========================= if ($('.slideShowBlog').length > 0) { $('.slideShowBlog').owlCarousel({ singleItem: true, navigation: true, pagination: false, navigationText: ["", ""] }); } //========================= //Blog carowsel home3 //========================= if ($('.blogCaroHome3').length > 0) { $('.blogCaroHome3').owlCarousel({ items: 3, itemsTablet: [1024, 2] }); } //========================= // Portfolio //========================= $('.filterContent').mixItUp(); //========================= // Revolution Slider //========================= if ($(".sliderSection").length > 0) { $('.tp-banner').revolution({ delay: 5000, startwidth: 1170, startheight: 860, startWithSlide: 0, fullScreenAlignForce: "off", navigationType: "bullet", navigationArrows: "on", navigationStyle: "round", touchenabled: "on", onHoverStop: "off", navOffsetHorizontal: 0, navOffsetVertical: 20, shadow: 0, fullWidth: "off", fullScreen: "off", navigationVOffset: 35 }); } //======================== // About Skill //======================== if ($(".ourSkills").length > 0) { $('.ourSkills').appear(); $('.ourSkills').on('appear', loadSkills); } var coun = true; function loadSkills() { $(".singleSkill").each(function() { var datacount = $(this).attr("data-limit"); $(".skillBar", this).animate({'width': datacount + '%'}, 2000); if (coun) { $(this).find('.skilPercent').each(function() { var $this = $(this); $({Counter: 0}).animate({Counter: datacount}, { duration: 2000, easing: 'swing', step: function() { $this.text(Math.ceil(this.Counter) + '%'); } }); }); } }); coun = false; } //======================== // Contact Map //======================== if ($('#map').length > 0) { var map; map = new GMaps({ el: '#map', lat: -12.043333, lng: -77.028333, zoomControl: true, zoomControlOpt: { style: 'SMALL', position: 'TOP_LEFT' }, panControl: false, streetViewControl: false, mapTypeControl: false, overviewMapControl: false }); } //======================== // search icon //======================== $('.searchIco').on('click', function() { $('.searchBox').fadeIn(); return false; }); $('.cluseSearch').on('click', function() { $('.searchBox').fadeOut(); return false; }); //======================================================= // Color Preset //======================================================= if ($(".colorPresetArea").length > 0) { var switchs = true; $(".gearBtn").on('click', function(e) { e.preventDefault(); if (switchs) { $(this).addClass('active'); $(".colorPresetArea").animate({'left': '0px'}, 400); switchs = false; } else { $(this).removeClass('active'); $(".colorPresetArea").animate({'left': '-290px'}, 400); switchs = true; } }); $(".mainColors a").click(function(e) { e.preventDefault(); var color = $(this).attr('href'); $(".mainColors a").removeClass('active'); $(this).addClass('active'); $("#colorChem").attr('href', 'css/lay_colors/' + color + '.css'); }); } ; $("#patterns a").on('click', function(e) { e.preventDefault(); var bg = $(this).attr('href'); if ($(".boxed").hasClass('active')) { //alert(bg); $('#patterns a').removeClass('active'); $(this).addClass('active'); $('body').removeClass('pat1 pat2 pat3 pat4 pat5'); $('body').addClass(bg); } else { alert('Please, active box layout First.'); } }); $(".layout").on('click', function(e) { e.preventDefault(); var layout = $(this).attr('href'); if (layout == 'wide') { $('body').removeClass('pat1 pat2 pat3 pat4 pat5 pat6 pat7 pat8 pat9 pat10'); } $('.layout').removeClass('active'); $(this).addClass('active'); $("#layout").attr('href', 'css/lay_colors/' + layout + '.css'); }); //=================================== // Pre loader //=================================== $(window).load(function() { $('#loading').delay(1000).fadeOut(1000); $('body').delay(500).css({'overflow': 'visible'}); }); //=================================== // Fixed Header //=================================== $(window).on('scroll', function() { if ($(window).scrollTop() > 40) { $(".headerBottom").addClass('fixedHeader'); } else { $(".headerBottom").removeClass('fixedHeader'); } }) //=================================== // Bootstrap collaps pluse minuse //=================================== $('.panel-heading').on('click', function() { $('.panel-heading').removeClass('active'); $(this).addClass('active'); }); //=================================== // Mobile Menu //=================================== $('.mobileMenu').on('click', function() { $(this).toggleClass('active'); $('#mainNav > ul').slideToggle(); }); if($(window).width() < 768) { $("#mainNav > ul > li.hasChild > a").on('click', function() { $(this).parent().toggleClass('active'); $(this).parent().children('.sub-menu').slideToggle('slow'); return false; }); } //=================================== // modal //=================================== $('.registration a').on('click', function() { $('.singInform').hide(); $('.singUpform').fadeIn('slow'); }); $('.regLogin').on('click', function() { $('.singUpform').hide(); $('.singInform').fadeIn('slow'); }); //======================== // Back To Top //======================== $(window).on('scroll', function() { if ($(window).scrollTop() > $(window).height()) { $("#backToTop").addClass('showit'); } else { $("#backToTop").removeClass('showit'); } }); $("body, html").on("click", "#backToTop", function(e) { e.preventDefault(); $('html, body').animate({scrollTop: 0}, 800); }); //======================== // Subscriptions //======================== if ($("#subscriptionsforms").length > 0) { $("#subscriptionsforms").on('submit', function(e) { e.preventDefault(); var sub_email = $("#sub_email").val(); $("#subs_submit").html(''); if (sub_email == '') { $("#sub_email").addClass('reqError'); $("#subs_submit").html(''); } else { $("#sub_email").removeClass('reqError'); $.ajax({ type: "POST", url: "php/subscribe.php", data: {sub_email: sub_email}, success: function(data) { $("#subscriptionsforms input").val(''); $("#subs_submit").html(''); } }); } }); $("#sub_email").on('keyup', function() { $(this).removeClass('reqError'); }); } //======================== // Contact Submit //======================== if ($("#contactForm").length > 0) { $("#contactForm").on('submit', function(e) { e.preventDefault(); $("#con_submit").html('Processsing...'); var con_name = $("#con_name").val(); var con_email = $("#con_email").val(); var con_message = $("#con_message").val(); var required = 0; $(".required", this).each(function() { if ($(this).val() == '') { $(this).addClass('reqError'); required += 1; } else { if ($(this).hasClass('reqError')) { $(this).removeClass('reqError'); if (required > 0) { required -= 1; } } } }); if (required === 0) { $.ajax({ type: "POST", url: 'php/mail.php', data: {con_name: con_name, con_email: con_email, con_message: con_message}, success: function(data) { $("#con_submit").html('Done!'); $("#contactForm input, #contactForm textarea").val(''); } }); } else { $("#con_submit").html('Failed!'); } }); $(".required").on('keyup', function() { $(this).removeClass('reqError'); }); } })(jQuery);