//LOADER $(window).on("load", function () { "use strict"; $(".loader").fadeOut(800); setTimeout(function () { $(window).scrollTop(0); }, 200); $("a.pagescroll").on("click", function (event) { event.preventDefault(); $("html,body").animate({ scrollTop: $(this.hash).offset().top }, 1200); }); }); jQuery(function ($) { "use strict"; var windowsize = $(window).width(); // ************ Back to Top var amountScrolled = 700; var backBtn = $("a.scrollToTop"); $(window).on("scroll", function () { if ($(window).scrollTop() > amountScrolled) { backBtn.fadeIn("slow"); } else { backBtn.fadeOut("slow"); } }); backBtn.on("click", function () { $("html, body").animate({ scrollTop: 0 }, 700); return false; }); /*---Header Scroll---*/ $(window).on('scroll', function () { if ($(this).scrollTop() > 50) { $(".navbar:not(.fixed-bottom)").addClass("fixedmenu"); } else { $(".navbar").removeClass("fixedmenu"); } }); if ($("nav.navbar").hasClass("fixed-bottom")) { var navHeight = $(".fixed-bottom").offset().top; $(window).scroll(function () { if ($(window).scrollTop() > navHeight) { $('.fixed-bottom').addClass('fixedmenu'); } else { $('.fixed-bottom').removeClass('fixedmenu'); } }); } if ($(".just-sidemenu").length) { var anchor_point = $(".banner-fullscreen").outerHeight(); var side_toggle = $(".just-sidemenu #sidemenu_toggle"); side_toggle.addClass("toggle_white"); $(window).on("scroll", function () { if ($(window).scrollTop() >= anchor_point) { side_toggle.removeClass("toggle_white"); } else { side_toggle.addClass("toggle_white"); } }); } if (navigator.userAgent.match(/msie/i) || navigator.userAgent.match(/trident/i)) { $(".rev_overlay").addClass("d-none"); $("#rev_slider_video .rs-fullvideo-cover").css("background", "rgba(0,0,0,0)"); } $(document).on('contextmenu', function () { return false; }); /*document.onkeydown = function (e) { if (e.ctrlKey && (e.keyCode === 67 || e.keyCode === 86 || e.keyCode === 85 || e.keyCode === 117)) { return false; } else { return true; }};*/ /*----- Menu On click -----*/ if ($("#sidemenu_toggle").length) { $("body").addClass("pushwrap"); $("#sidemenu_toggle").on("click", function () { $(".pushwrap").toggleClass("active"); $(".side-menu").addClass("side-menu-active"), $("#close_side_menu").fadeIn(700) }), $("#close_side_menu").on("click", function () { $(".side-menu").removeClass("side-menu-active"), $(this).fadeOut(200), $(".pushwrap").removeClass("active") }), $("#btn_sideNavClose").on("click", function () { $(".side-menu").removeClass("side-menu-active"), $("#close_side_menu").fadeOut(200), $(".pushwrap").removeClass("active") }); } /* ----- Full Screen ----- */ function resizebanner() { var $fullscreen = $(".full-screen"); $fullscreen.css("height", $(window).height()); $fullscreen.css("width", $(window).width()); } resizebanner(); $(window).resize(function () { resizebanner(); }); /*----- Accordions -----*/ $(".items > li:first-child .sub-items").fadeIn(); $(".items > li:first-child >").addClass("expanded"); $(".items > li > a").on('click', function (e) { e.preventDefault(); var $this = $(this); if ($this.hasClass("expanded")) { $this.removeClass("expanded"); } else { $(".items a.expanded").removeClass("expanded"); $this.addClass("expanded"); $(".sub-items").filter(":visible").slideUp("normal"); } $this.parent().children("ul").stop(true, true).slideToggle("normal"); }); /*----- Tabs init -----*/ $(function () { initTabsToAccordion(); }); function initTabsToAccordion() { var animSpeed = 500; var win = $(window); var isAccordionMode = true; var tabWrap = $(".tab-to-accordion"); var tabContainer = tabWrap.find(".tab-container"); var tabItem = tabContainer.children("div[id]"); var tabsetList = tabWrap.find(".tabset-list"); var tabsetLi = tabsetList.find("li"); var tabsetItem = tabsetList.find("a"); var activeId = tabsetList .find(".active") .children() .attr("href"); cloneTabsToAccordion(); accordionMode(); tabsToggle(); hashToggle(); win.on("resize orientationchange", accordionMode); function cloneTabsToAccordion() { $(tabsetItem).each(function () { var $this = $(this); var activeClass = $this.parent().hasClass("active"); var listItem = $this.attr("href"); var listTab = $(listItem); if (activeClass) { var activeClassId = listItem; listTab.show(); } var itemContent = $this.clone(); var itemTab = $this.attr("href"); if (activeClassId) { itemContent .insertBefore(itemTab) .wrap('
'); } else { itemContent .insertBefore(itemTab) .wrap('
'); } }); } function accordionMode() { var liWidth = Math.round(tabsetLi.outerWidth()); var liCount = tabsetLi.length; var allLiWidth = liWidth * liCount; var tabsetListWidth = tabsetList.outerWidth(); if (tabsetListWidth <= allLiWidth) { isAccordionMode = true; tabWrap.addClass("accordion-mod"); } else { isAccordionMode = false; tabWrap.removeClass("accordion-mod"); } } function tabsToggle() { tabItem.hide(); $(activeId).show(); $(tabWrap).on("click", 'a[href^="#tab"]', function (e) { e.preventDefault(); var $this = $(this); var activeId = $this.attr("href"); var activeTabSlide = $(activeId); var activeOpener = tabWrap.find('a[href="' + activeId + '"]'); $('a[href^="#tab"]') .parent() .removeClass("active"); activeOpener.parent().addClass("active"); if (isAccordionMode) { tabItem.stop().slideUp(animSpeed); activeTabSlide.stop().slideDown(animSpeed); } else { tabItem.hide(); activeTabSlide.show(); } }); } function hashToggle() { var hash = location.hash; var activeId = hash; var activeTabSlide = $(activeId); var activeOpener = tabWrap.find('a[href="' + activeId + '"]'); if ($(hash).length > 0) { $('a[href^="#tab"]') .parent() .removeClass("active"); activeOpener.parent().addClass("active"); tabItem.hide(); activeTabSlide.show(); win .scrollTop(activeTabSlide.offset().top) .scrollLeft(activeTabSlide.offset().left); } } } /*----Equal Heights----*/ checheight(); $(window).on("resize", function () { checheight(); }); function checheight() { if ($(".equalheight").length) { if (windowsize > 767) { $(".equalheight").matchHeight({ property: "height", }); } } } fiximBlocks(); $(window).on("resize", function () { fiximBlocks(); }); function fiximBlocks() { if (windowsize < 993) { $(".half-section").each(function () { $(".img-container", this).insertAfter($(".split-box > .heading-title h2", this)); }); } } //contact form $("#btn_submit").on("click", function () { //get input field values var user_name = $('input[name=name]').val(); var user_email = $('input[name=email]').val(); var user_website = $('input[name=website]').val(); var user_message = $('textarea[name=message]').val(); var post_data, output; //simple validation at client's end var proceed = true; if (user_name == "") { proceed = false; } if (user_email == "") { proceed = false; } if (user_message == "") { proceed = false; } //everything looks good! proceed... if (proceed) { //alert(proceed); //data to be sent to server post_data = { 'userName': user_name, 'userEmail': user_email, 'userWebsite': user_website, 'userMessage': user_message }; //Ajax post data to server $.post('contact_me.php', post_data, function (response) { //load json data from server and output message if (response.type == 'error') { output = '
' + response.text + '
'; } else { output = '
' + response.text + '
'; //reset values in all input fields $('.form-inline input').val(''); $('.form-inline textarea').val(''); $('#btn_submit').val('Submit'); } $("#result").hide().html(output).slideDown(); }, 'json'); } }); //reset previously set border colors and hide all message on .keyup() $(".form-inline input, .form-inline textarea").keyup(function () { $("#result").slideUp(); }); // ************ Fun Facts $(".number-counters").appear(function () { $(".number-counters [data-to]").each(function () { var e = $(this).attr("data-to"); $(this).delay(6e3).countTo({ from: 1, to: e, speed: 3500, refreshInterval: 50 }) }) }); /*Owl Carousel*/ /*Testimonial 3 cols*/ $("#testimonial-slider, #team_slider , #news_slider").owlCarousel({ items: 3, autoplay: 2500, autoplayHoverPause: true, loop: true, margin: 30, dots: true, nav: false, rtl: callback, responsive: { 1280: { items: 3, }, 980: { items: 3, }, 600: { items: 2, }, 320: { items: 1, }, } }); /*Services Box Slider*/ $("#services-slider").owlCarousel({ autoplay: true, autoplayTimeout: 3000, autoplayHoverPause: true, smartSpeed: 1200, loop: true, nav: false, navText: false, dots: false, mouseDrag: true, touchDrag: true, center: true, rtl: callback, responsive: { 0: { items: 1 }, 640: { items: 3 } } }); /*Partners / LOgo*/ $("#partners-slider").owlCarousel({ items: 5, autoplay: 1500, smartSpeed: 1500, autoplayHoverPause: true, slideBy: 1, loop: true, margin: 30, dots: false, nav: false, rtl: callback, responsive: { 1200: { items: 5, }, 900: { items: 4, }, 768: { items: 3, }, 480: { items: 2, }, 320: { items: 1, }, } }); /*Simple text fadng banner*/ $("#text-fading").owlCarousel({ items: 1, autoplay: true, autoplayHoverPause: true, loop: true, mouseDrag: false, animateIn: "fadeIn", animateOut: "fadeOut", dots: true, nav: false, rtl: callback, responsive: { 0: { items: 1 } } }); function callback() { if($("body").hasClass("rtl-layout")){ rtl: true } } /*----- Parallax Backgrounds -----*/ if (windowsize > 992) { $(".parallaxie").parallaxie({ speed: 0.4, offset: 0, }); } /*----- FancyBox -----*/ $('[data-fancybox]').fancybox({ protect: true, animationEffect: "fade", hash: null, }); /*main slider*/ $("#main-banner").show().revolution({ sliderType: "standard", sliderLayout: "fullscreen", scrollbarDrag: "true", dottedOverlay: "none", navigation: { keyboardNavigation: "off", keyboard_direction: "horizontal", mouseScrollNavigation: "off", bullets: { style: "", enable: false, rtl: false, hide_onmobile: false, hide_onleave: false, hide_under: 767, hide_over: 9999, tmp: '', direction: "vertical", space: 10, h_align: "right", v_align: "center", h_offset: 40, v_offset: 0 }, arrows: { enable: true, hide_onmobile: true, hide_onleave: false, hide_under: 767, left: { h_align: "left", v_align: "center", h_offset: 20, v_offset: 30, }, right: { h_align: "right", v_align: "center", h_offset: 20, v_offset: 30 }, }, touch: { touchenabled: "on", swipe_threshold: 75, swipe_min_touches: 1, swipe_direction: "horizontal", drag_block_vertical: false, } }, viewPort: { enable: true, outof: "pause", visible_area: "90%" }, responsiveLevels: [4096, 1024, 778, 480], gridwidth: [1140, 1024, 768, 480], gridheight: [600, 500, 500, 350], lazyType: "none", parallax: { type: "mouse", origo: "slidercenter", speed: 9000, levels: [2, 3, 4, 5, 6, 7, 12, 16, 10, 50], }, shadow: 0, spinner: "off", stopLoop: "off", stopAfterLoops: -1, stopAtSlide: -1, shuffle: "off", autoHeight: "off", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", nextSlideOnWindowFocus: "off", disableFocusListener: false, } }); /*Video bg*/ $("#rev_slider_video").show().revolution({ sliderType: "standard", sliderLayout: "fullscreen", scrollbarDrag: "true", dottedOverlay: "none", navigation: { touch: { touchenabled: "on", swipe_threshold: 75, swipe_min_touches: 1, swipe_direction: "horizontal", drag_block_vertical: false, } }, viewPort: { enable: true, outof: "pause", visible_area: "90%" }, responsiveLevels: [4096, 1024, 778, 480], gridwidth: [1140, 1024, 768, 480], gridheight: [600, 500, 500, 350], lazyType: "none", parallax: { type:"scroll", origo:"slidercenter", speed:1000, levels: [2, 3, 4, 5, 6, 7, 12, 16, 10, 50], }, shadow: 0, spinner: "off", stopLoop: "off", stopAfterLoops: -1, stopAtSlide: -1, shuffle: "off", autoHeight: "off", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", nextSlideOnWindowFocus: "off", disableFocusListener: false, } }); /*columns layout*/ $("#rev_carousel").show().revolution({ sliderType: "carousel", jsFileLocation: "js/revolution", sliderLayout: "fullscreen", dottedOverlay: "none", delay: 7000, navigation: { keyboardNavigation: "off", keyboard_direction: "horizontal", mouseScrollNavigation: "off", mouseScrollReverse: "default", onHoverStop: "off", bullets: { style: "", enable: true, hide_onmobile: true, hide_under: 480, hide_onleave: false, hide_delay: 200, direction: "horizontal", space: 10, h_align: "center", v_align: "bottom", h_offset: 0, v_offset: 30 } }, carousel: { horizontal_align: "center", vertical_align: "center", fadeout: "on", vary_fade: "on", maxVisibleItems: 3, infinity: "on", space: 0, stretch: "off", showLayersAllTime: "off", easing: "Power3.easeInOut", speed: "900" }, responsiveLevels: [1240, 1024, 778, 480], visibilityLevels: [1240, 1024, 778, 480], gridwidth: [1140, 960, 750, 480], gridheight: [720, 720, 480, 360], lazyType: "none", parallax: { type: "scroll", origo: "enterpoint", speed: 400, speedbg: 0, speedls: 0, levels: [5, 7, 10, 15, 20, 25, 30, 35, 40, 45, 25, 47, 48, 49, 50, 51, 55], }, shadow: 0, spinner: "off", stopLoop: "on", stopAfterLoops: 0, stopAtSlide: 1, shuffle: "off", autoHeight: "off", disableProgressBar: "on", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", nextSlideOnWindowFocus: "off", disableFocusListener: false, } }); /*thumbs*/ $("#thumb-banner").show().revolution({ sliderType: "standard", sliderLayout: "fullscreen", scrollbarDrag: "true", dottedOverlay: "none", navigation: { keyboardNavigation: "off", keyboard_direction: "horizontal", mouseScrollNavigation: "off", thumbnails: { style: "hades", enable: true, width: 70, height: 70, min_width: 50, wrapper_padding: 5, wrapper_color: "transparent", wrapper_opacity: "1", tmp: ' ', visibleAmount: 5, hide_onmobile: false, hide_onleave: false, direction: "horizontal", span: false, position: "inner", space: 5, h_align: "center", v_align: "bottom", h_offset: 0, v_offset: 20 }, touch: { touchenabled: "on", swipe_threshold: 75, swipe_min_touches: 1, swipe_direction: "horizontal", drag_block_vertical: false, } }, viewPort: { enable: true, outof: "pause", visible_area: "90%" }, responsiveLevels: [4096, 1024, 778, 480], gridwidth: [1140, 1024, 768, 480], gridheight: [600, 500, 500, 350], lazyType: "none", parallax: { type: "mouse", origo: "slidercenter", speed: 9000, levels: [2, 3, 4, 5, 6, 7, 12, 16, 10, 50], }, shadow: 0, spinner: "off", stopLoop: "off", stopAfterLoops: -1, stopAtSlide: -1, shuffle: "off", autoHeight: "off", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", nextSlideOnWindowFocus: "off", disableFocusListener: false, } }); /*arrows thumb Slider*/ $("#rev_arrows").show().revolution({ sliderType: "standard", jsFileLocation: "js/revolution/", sliderLayout: "fullwidth", dottedOverlay: "none", delay: 9000, navigation: { keyboardNavigation: "off", keyboard_direction: "horizontal", mouseScrollNavigation: "off", mouseScrollReverse: "default", onHoverStop: "off", touch: { touchenabled: "on", swipe_threshold: 75, swipe_min_touches: 1, swipe_direction: "horizontal", drag_block_vertical: false }, arrows: { style: "zeus", enable: true, hide_onmobile: true, hide_under: 600, hide_onleave: true, hide_delay: 200, hide_delay_mobile: 1200, tmp: '
', left: { h_align: "left", v_align: "center", h_offset: 30, v_offset: 0 }, right: { h_align: "right", v_align: "center", h_offset: 30, v_offset: 0 } } }, viewPort: { enable: true, outof: "pause", visible_area: "80%", presize: false }, responsiveLevels: [1240, 1024, 778, 480], visibilityLevels: [1240, 1024, 778, 480], gridwidth: [1140, 1024, 768, 480], gridheight: [660, 650, 600, 490], lazyType: "none", parallax: { type: "mouse", origo: "slidercenter", speed: 2000, speedbg: 0, speedls: 0, levels: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 25, 55], disable_onmobile: "on" }, shadow: 0, spinner: "off", stopLoop: "off", stopAfterLoops: -1, stopAtSlide: -1, shuffle: "off", autoHeight: "off", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", nextSlideOnWindowFocus: "off", disableFocusListener: false, } }); /*animated elements hero banner*/ $("#rev_single").show().revolution({ sliderType: "hero", jsFileLocation: "js/revolution", sliderLayout: "fullscreen", scrollbarDrag: "true", dottedOverlay: "none", delay: 9000, navigation: {}, responsiveLevels: [1240, 1024, 778, 480], visibilityLevels: [1240, 1024, 778, 480], gridwidth: [1170, 1024, 778, 480], gridheight: [868, 768, 960, 720], lazyType: "none", parallax: { type: "scroll", origo: "slidercenter", speed: 400, levels: [10, 15, 20, 25, 30, 35, 40, -10, -15, -20, -25, -30, -35, -40, -45, 55] }, shadow: 0, spinner: "off", autoHeight: "off", fullScreenAutoWidth: "off", fullScreenAlignForce: "off", fullScreenOffsetContainer: "", disableProgressBar: "on", hideThumbsOnMobile: "off", hideSliderAtLimit: 0, hideCaptionAtLimit: 0, hideAllCaptionAtLilmit: 0, debugMode: false, fallbacks: { simplifyAll: "off", disableFocusListener: false } }); //Project Filter $("#projects").cubeportfolio({ layoutMode: 'grid', filters: '#project-filter', defaultFilter: '*', animationType: "quicksand", gapHorizontal: 30, gapVertical: 30, gridAdjustment: "responsive", mediaQueries: [{ width: 1500, cols: 4 }, { width: 1100, cols: 4 }, { width: 800, cols: 3 }, { width: 480, cols: 2 }, { width: 320, cols: 1 }], }); /*Testimonials Grids*/ $("#testimonial-grid").cubeportfolio({ layoutMode: 'grid', defaultFilter: '*', animationType: "quicksand", gapHorizontal: 30, gapVertical: 50, gridAdjustment: "responsive", mediaQueries: [{ width: 1500, cols: 4 }, { width: 1100, cols: 4 }, { width: 800, cols: 3 }, { width: 480, cols: 2 }, { width: 320, cols: 1 }], }); /*Gallery without spaces*/ $("#grid-mosaic").cubeportfolio({ filters: "#filters-mosaic", layoutMode: 'mosaic', defaultFilter: "*", animationType: "quicksand", gapHorizontal: 0, gapVertical: 0, gridAdjustment: 'responsive', mediaQueries: [{ width: 1500, cols: 3, }, { width: 1100, cols: 3, }, { width: 800, cols: 3, }, { width: 480, cols: 2, }], }); /*rotating words*/ $("#js-rotating").Morphext({ animation: "bounceIn", separator: ",", speed: 2000, }); /* Initializing Particles */ if ($("#particles-js").length) { window.onload = function () { Particles.init({ selector: '#particles-js', color: '#ffffff', connectParticles: false, sizeVariations: 14, maxParticles: 140, }); }; } /*Wow Animations*/ if ($(".wow").length) { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: false, live: true }); new WOW().init(); } });