/****************************************** Version: 1.0 /****************************************** */ (function($) { "use strict"; /* ============================================== LOADER --> =============================================== */ $(window).on('load', function() { $('.preloader').fadeOut(); $('#preloader').delay(550).fadeOut('slow'); $('body').delay(450).css({'overflow':'visible'}); }) /* ============================================== Navbar Bar =============================================== */ $('.navbar-nav .nav-link').on('click', function() { var toggle = $('.navbar-toggler').is(':visible'); if (toggle) { $('.navbar-collapse').collapse('hide'); } }); /* ============================================== Mousemove Animation =============================================== */ var windowWidth = $(window).width(); $('.noover').mousemove(function(event){ var moveX = (($(window).width() / 2) - event.pageX) * 0.1; var moveY = (($(window).height() / 2) - event.pageY) * 0.1; $('.move').css('margin-left', moveX + 'px'); $('.move').css('margin-top', moveY + 'px'); }); /* ============================================== Fixed menu =============================================== */ //$(window).on('scroll', function () { //if ($(window).scrollTop() > 50) { //$('.header_style_01').addClass('fixed-menu'); //} else { //$('.header_style_01').removeClass('fixed-menu'); //} //}); /* ============================================== BACK TOP =============================================== */ jQuery(window).scroll(function() { if (jQuery(this).scrollTop() > 1) { jQuery('.dmtop').css({ bottom: "20px" }); } else { jQuery('.dmtop').css({ bottom: "-100px" }); } }); /* ============================================== Smooth Scroll =============================================== */ $('a[href*="#"]:not([href="#"])').on('click', function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { $('html,body').animate({ scrollTop: target.offset().top - 65, }, 1000); return false; } } }); /* ============================================== FUN FACTS --> =============================================== */ $('.selectpicker').selectpicker(); /* ============================================== FUN FACTS --> =============================================== */ function count($this) { var current = parseInt($this.html(), 10); current = current + 50; /* Where 50 is increment */ $this.html(++current); if (current > $this.data('count')) { $this.html($this.data('count')); } else { setTimeout(function() { count($this) }, 30); } } $(".stat_count, .stat_count_download").each(function() { $(this).data('count', parseInt($(this).html(), 10)); $(this).html('0'); count($(this)); }); /* ============================================== TOOLTIP --> =============================================== */ $('[data-toggle="tooltip"]').tooltip() $('[data-toggle="popover"]').popover() /* ============================================== CONTACT --> =============================================== */ jQuery(document).ready(function() { $('#contactform').submit(function() { var action = $(this).attr('action'); $("#message").slideUp(750, function() { $('#message').hide(); $('#submit') .after('') .attr('disabled', 'disabled'); $.post(action, { first_name: $('#first_name').val(), last_name: $('#last_name').val(), email: $('#email').val(), phone: $('#phone').val(), select_service: $('#select_service').val(), select_price: $('#select_price').val(), comments: $('#comments').val(), verify: $('#verify').val() }, function(data) { document.getElementById('message').innerHTML = data; $('#message').slideDown('slow'); $('#contactform img.loader').fadeOut('slow', function() { $(this).remove() }); $('#submit').removeAttr('disabled'); if (data.match('success') != null) $('#contactform').slideUp('slow'); } ); }); return false; }); }); /* ============================================== CODE WRAPPER --> =============================================== */ $('.code-wrapper').on("mousemove", function(e) { var offsets = $(this).offset(); var fullWidth = $(this).width(); var mouseX = e.pageX - offsets.left; if (mouseX < 0) { mouseX = 0; } else if (mouseX > fullWidth) { mouseX = fullWidth } $(this).parent().find('.divider-bar').css({ left: mouseX, transition: 'none' }); $(this).find('.design-wrapper').css({ transform: 'translateX(' + (mouseX) + 'px)', transition: 'none' }); $(this).find('.design-image').css({ transform: 'translateX(' + (-1 * mouseX) + 'px)', transition: 'none' }); }); $('.divider-wrapper').on("mouseleave", function() { $(this).parent().find('.divider-bar').css({ left: '50%', transition: 'all .3s' }); $(this).find('.design-wrapper').css({ transform: 'translateX(50%)', transition: 'all .3s' }); $(this).find('.design-image').css({ transform: 'translateX(-50%)', transition: 'all .3s' }); }); })(jQuery);