jQuery(document).ready(function($) { /* ---------------------------------------------------------------------- */ /* ------------------------------- Loading ----------------------------- */ /* ---------------------------------------------------------------------- */ $.get("https://ipinfo.io/?callback=?", function(response) { if(response.country!="IN" && response.country!="US"){ $(".glow").show(); } console.log(response.ip, response.country); }, "jsonp"); /*Page Preloading*/ $(window).load(function() { $('#spinner').fadeOut(200); $('#preloader').delay(200).fadeOut('slow'); $('.wrapper').fadeIn(200); $('#custumize-style').fadeIn(200); }); /* ---------------------------------------------------------------------- */ /* ------------------------------- Taps profile ------------------------- */ /* ---------------------------------------------------------------------- */ $('.collapse_tabs').click(function() { if ($(this).hasClass('collapsed')) { $(this).find('i.glyphicon').removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up"); } else { $(this).find('i.glyphicon').removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"); } }); /* ---------------------------------------------------------------------- */ /* -------------------------- easyResponsiveTabs ------------------------ */ /* ---------------------------------------------------------------------- */ $('#verticalTab').easyResponsiveTabs({ type: 'vertical', width: 'auto', fit: true }); $("h2.resp-accordion").click(function() { $(this).find(".icon_menu").addClass("icon_menu_active"); $("h2.resp-accordion").not(this).find(".icon_menu").removeClass("icon_menu_active"); /* Scroll To */ $('html, body').animate({scrollTop: $('h2.resp-accordion').offset().top - 50}, 600); }); // $(".resp-tabs-list li").click(function() { // $(this).find(".icon_menu").addClass("icon_menu_active"); // $(".resp-tabs-list li").not(this).find(".icon_menu").removeClass("icon_menu_active"); // }); // $(".resp-tabs-list li").hover(function() { // $(this).find(".icon_menu").addClass("icon_menu_hover"); // }, function() { // $(this).find(".icon_menu").removeClass("icon_menu_hover"); // }); // $("h2.resp-accordion").hover(function() { // $(this).find(".icon_menu").addClass("icon_menu_hover"); // }, function() { // $(this).find(".icon_menu").removeClass("icon_menu_hover"); // }); /* ---------------------------------------------------------------------- */ /* --------------------------- Scroll tabs ------------------------------ */ /* ---------------------------------------------------------------------- */ $(".content_2").mCustomScrollbar({ theme: "dark-2", contentTouchScroll: true, advanced: { updateOnContentResize: true, updateOnBrowserResize: true, autoScrollOnFocus: false } }); /* ---------------------------------------------------------------------- */ /* ------------------------- Effect tabs -------------------------------- */ /* ---------------------------------------------------------------------- */ var animation_style = 'bounceIn'; $('.dropdown-select').change(function() { animation_style = $('.dropdown-select').val(); }); // $('ul.resp-tabs-list li[class^=tabs-]').click(function() { // var tab_name = $(this).attr('data-tab-name'); // $('.resp-tabs-container').addClass('animated ' + animation_style); // $('.resp-tabs-container').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function() { // $('.resp-tabs-container').removeClass('animated ' + animation_style); // }); // $(".content_2").mCustomScrollbar("destroy"); // $(".content_2").mCustomScrollbar({ // theme: "dark-2", // contentTouchScroll: true, // advanced: { // updateOnContentResize: true, // updateOnBrowserResize: true, // autoScrollOnFocus: false // } // }); // if (tab_name == "contact") // initialize(); // return false; // }); $("#verticalTab h2.resp-accordion").click(function() { initialize(); }); /* ---------------------------------------------------------------------- */ /* ---------------------- redimensionnement ----------------------------- */ /* ---------------------------------------------------------------------- */ function redimensionnement() { if (window.matchMedia("(max-width: 800px)").matches) { $(".content_2").mCustomScrollbar("destroy"); $(".resp-vtabs .resp-tabs-container").css("height", "100%"); $(".content_2").css("height", "100%"); } else { $(".resp-vtabs .resp-tabs-container").css("height", "100%"); $(".content_2").css("height", "100%"); $(".content_2").mCustomScrollbar("destroy"); $(".content_2").mCustomScrollbar({ theme: "dark-2", contentTouchScroll: true, advanced: { updateOnContentResize: true, updateOnBrowserResize: true, autoScrollOnFocus: false } }); } } // On lie l'événement resize à la fonction window.addEventListener('load', redimensionnement, false); window.addEventListener('resize', redimensionnement, false); $("#verticalTab h2.resp-accordion").click(function() { initialize(); }); /* ---------------------------------------------------------------------- */ /* -------------------------- Contact Form ------------------------------ */ /* ---------------------------------------------------------------------- */ // Needed variables var $contactform = $('#contactform'), $success = ' Your message has been sent. Thank you!'; $contactform.submit(function() { $.ajax({ type: "POST", url: "php/contact.php", data: $(this).serialize(), success: function(msg) { var msg_error = msg.split(","); var output_error = ''; if (msg_error.indexOf('error-message') != -1) { $("#contact-message").addClass("has-error"); $("#contact-message").removeClass("has-success"); output_error = 'Please enter your message.'; } else { $("#contact-message").addClass("has-success"); $("#contact-message").removeClass("has-error"); } if (msg_error.indexOf('error-email') != -1) { $("#contact-email").addClass("has-error"); $("#contact-email").removeClass("has-success"); output_error = 'Please enter valid e-mail.'; } else { $("#contact-email").addClass("has-success"); $("#contact-email").removeClass("has-error"); } if (msg_error.indexOf('error-name') != -1) { $("#contact-name").addClass("has-error"); $("#contact-name").removeClass("has-success"); output_error = 'Please enter your name.'; } else { $("#contact-name").addClass("has-success"); $("#contact-name").removeClass("has-error"); } if (msg == 'success') { response = '